Putting a Cisco 7940G VoIP Phone on Allstar

The Shack.

The Shack.

Recently I bought a Cisco 7940G on ebay, inspired by Michael Carey, VK5ZEA‘s work

The Device

The Good:

  • Big Screen
  • Nice Buttons
  • Straight forward user interface
  • Everything is configured from a central location.

The Bad:

  • Cisco PoE is not compliant with the IEEE 802.3af PoE standard, you cannot use an off-the-shelf power injector to power this, it has to be a Cisco model. 7941G and later models have moved to the IEEE standard.
  • Typically no SIP support out of the box, has to be flashed to SIP from SCCP.
  • Everything has to be configured from a TFTP server.
  • Takes up a considerable amount of desk real-estate.

Hindsight being 20/20, I would have gone for a Grandstream or Polycom unit since they negate all the issues I have with this device, supporting SIP and standardized PoE out of the box as well as being slightly smaller. They also have the additional benefit of being able to configure from a self-hosted web page as opposed to a TFTP server.

Modifying the Device

I found this information on flashing SIP firmware 8.12 on the phone some minor revisions to the code were required, notably that there is a S03-08-12-00 firmware now available. One thing I will recommend is running a linux based TFTP server versus the windows equivalents. I spent about half an hour trying to get the Solarwinds TFTP application on windows to work whereas the TFTP server I tossed on my linux box/Allstar node worked immediately.

Files to have

If you looked at the walkthough on flashing SIP firmware you will need the following files:

Note: File names for the S003/S0S3 files may or may not drop leading zeroes, check those before you proceed.

The S003/S0S3 files are the actual firmware, it changes the phone from the SCCP protocol (S003) to the SIP protocol (S0S3). Since this is the firmware version you can also confirm this on your phone’s setting screen. Where <MAC ADDRESS> is replace that with the MAC address of your phone, remove all “:”. If you connect to a factory default-cisco phone you can also connect to the local IP to see a status page with the correct name listed at the top. Aside from making sure the file names “image_version” attribute in all files matches up with the firmware files, the only file you really need to touch is SIP<MAC ADDRESS>.cnf.

Allstar

So now thats out of the way, we move onto the Allstar side of things. Allstar is an application of the Asterisk PBX. You can either install/compile Asterisk itself or install the images available, I’m running the DIAL image on a Raspberry Pi which my phone then connects to, it also happens to be my TFTP server. For simplicity I’m going to assume you’re installing the DIAL image.

Things you will need to edit to get online:

  • iax.conf
  • extensions.conf
  • modules.conf (Only needed for the SIP Phone)
  • sip.conf (Only needed for the SIP Phone)

For iax.conf you only need to edit one line:

register = <node ID>:<passcode>@register.allstarlink.org

If you don’t know where to find the passcode, it can be found here.

 

In extensions.conf append the following:

[radio-control]
exten => <NODEIDCHANGETHIS>,1,Answer
exten => <NODEIDCHANGETHIS>,1,Playback(rpt/node)
exten => <NODEIDCHANGETHIS>,n,Playback(digits/4) ;say node digits one at a time
exten => <NODEIDCHANGETHIS>,n,Playback(digits/3) ; You should probably change these
exten => <NODEIDCHANGETHIS>,n,Playback(digits/3)
exten => <NODEIDCHANGETHIS>,n,Playback(digits/9)
exten => <NODEIDCHANGETHIS>,n,Playback(digits/3)
exten => <NODEIDCHANGETHIS>,n,Rpt,<NODEIDCHANGETHIS>|P ;phone control mode

On the last line you will see a |P, this sets the mode to “Push to Talk” by dialing *99. You can change the phone to VOX by changing that to |Pv.

In modules.conf find the line:

noload => chan_sip.so

And change it to:

load => chan_sip.so

Now reboot both devices and everything should be functioning. Past that you can modify the SIP<MAC ADDRESS>.cnf.xml file to your hearts content to add functionality. There are some cool things to do such as add macros and change the banner.

In sip.conf you will need to append the following. This is shamelessly taken from W2YMM’s post on the subject.

[linie1] ; Cisco 7940G
deny=0.0.0.0/0.0.0.0
username=linie1
secret=linie1
dtmfmode=rfc2833
canreinvite=no
context=radio-control ; this interfaces with the extensions.conf stuff
host=dynamic
trustrpid=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
sendrpid=no
type=friend
nat=auto
port=5060
qualify=yes
qualifyfre=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/<NODEIDCHANGETHIS>
mailbox=
permit=0.0.0.0/0.0.0.0
callerid=<CALLSIGN><NODEIDCHANGETHIS>

You can add another one of these for Line 2 if you want to.

Controls

So now everything is setup and (hopefully) working, we move onto operation of the device. There is a wide variety of commands issuable on the line, and more can be added if you’re intrepid enough. But the ones only ones really needed are the following:

  • *1<node> – Disconnect from the node.
  • *2<node> – Connect to the node in Monitor mode, you will not be able to TX with this command.
  • *3<node> – Connect to the node in Transceive mode, you can talk to others with this mode either by setting the VOX or PTT option in extensions.conf
  • *4<node> – Enter command mode on another node. Example: *427391*342230 (command node 27391 to connect to node 42230)
  • *70 – Local node status.
  • *71 – Disconnect local node from everything else, a bit faster than the *1<node> command.
  • *99 – Push to Talk. Unlike a PTT button on a radio you only need to punch these numbers in then start talking, there’s nothing to indicate that you’ve finished talking which is a bit disconcerting.

Thanks

Thanks to VA3BFW for providing some tech support to me pig headedly bashing things together in software, as well as a few other people on the #redditnet IRC channel on geekshed.