Posts Tagged ‘voip phones’

Asterisk and Cisco VOIP Phones

Saturday, April 3rd, 2010

A few years ago we needed an office phone system.  Having a limited budget and being a tech-head, I decided to deploy Asterisk, an open-source PBX solution.  The outlays were minimal since we only needed a telephony card (Digium TDM400P), several VOIP  phones (GrandStream 2000 – hello, eBay!), and an old PC.  We chose to install Trixbox, which is based on Asterisk and promotes itself as easier to install than Asterisk.

After perhaps too much futzing, we ended up with a small business phone system without any monthly PBX charges other than the analog phone lines from the phone company.  We had an automated phone directory, the phones worked as intercoms, voice mail turned into attached WAV sound files send as e-mail.  I was able to add phone extensions easily.  I love Asterisk!

Perhaps the success went to my head, since I set my sights on a fancy conference room phone for our growing business.  I bought a used Cisco Polycom CP-7935 phone for 1/3rd the price of a new device.  I’ll admit it – I’m an amateur at telephony and didn’t know the difference between SIP and SCCP.  It turns out that Trixbox only supports SIP extensions by default, and this conference room phone requires SCCP channel protocol.

So finally I am coming to the purpose of this post – simple instructions on to hook up a Cisco VOIP phone (that only uses SCCP protocol) to Trixbox version 2.8.  The following instructions were gleaned from some Google searches, and I am summarizing them since no one had simple steps online for the most-recent Trixbox version.

First we need to install some packages and retrieve the most-recent version of an SCCP solution from SourceForge.  Do the following commands signed in as root user on your Trixbox server:

# yum install asterisk16-devel gcc subversion
# cd /usr/local/
# wget http://sourceforge.net/projects/chan-sccp-b/files/V2/Chan_SCCP-2.0_Final.tar.gz/download
# tar xvfz Chan_SCCP-2.0_Final.tar.gz/download
# cd /usr/local/chan_sccp-b_20090602
# make

If you perform the above steps, you will see that the make operation will not work without modifying some source code.  Thanks to a posting (http://lostentropy.com/2009/09/28/making-chan_sccp-build-with-asterisk-1-6/) I learned that I have to change a reference to a constant from CS_AST_CONTROL_T38 to CS_AST_CONTROL_T38_PARAMETERS.  Make this change to the file /usr/local/chan_sccp-b_20090602/sccp_pbx.c on line 587 using your favorite text editor.

# make
# make install
# amportal restart

Now comes the hard part.  The CP-7935 gets its provisioning file from a TFTP server.  Reset the CP-7935 to its default factor settings.  Next use the device menu to set the TFTP server to your Trixbox IP address (follow steps in the manual from the Cisco website).  The Trixbox should have its TFTP service activated by default; for my server the TFTP directory on the server is /tftpboot/.

Monitor the TFTP log file (/var/log/atftp.log) while you reboot the CP-7935.  You should see a request in the format “SEP#.cnf.xml” in the log file, where the “#” is the MAC address of the CP-7935.  Now create the following file /tftpboot/SEP#.cnf.xml (mine is /tftpboot/SEP00e0752442c5.cnf.xml) with this content and replacing the TRIXBOX_IP_ADDRESS with your Trixbox server address:

<Default>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<processNodeName>TRIXBOX_IP_ADDRESS</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<authenticationURL></authenticationURL>
<loadInformation</loadInformation>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
<versionStamp>{Apr 03 2010 12:00:00}</versionStamp>
</Default>

The last configuration entry tag for <versionStamp> is important since it is used by the device to determine if the settings have changed.  Update this versionStamp value to a later date to force the device to reload the settings in the file.

Next we need to write the SCCP configuration file that Asterisk reads. First make a backup of the existing file, and then we will replace it with one tailored for our solution.

# mv /etc/asterisk/sccp.conf /etc/asterisk/sccp.conf.bak

Here are the new contents for the file /etc/asterisk/sccp.conf, and remember to replace the all-capital letter phrases but the specifics of your setup, for example TRIXBOX_SERVER_IP_ADDRESS is replace by the IP address of your trixbox, and the SEP00e0752442c5 with the string “SEP” and the MAC address of your Cisco phone.  Our phone model is 7935, so you will also need to change this to your phone type.

[general]
servername = trixbox
keepalive = 60
debug = 1
context = from-internal
dateFormat = M/D/YA
bindaddr = TRIXBOX_SERVER_IP_ADDRESS
port = 2000
disallow=all
;allow=alaw
allow=ulaw
firstdigittimeout = 16
digittimeout = 8
digittimeoutchar = #
autoanswer_ring_time = 1
autoanswer_tone = 0x32
remotehangup_tone = 0x32
transfer_tone = 0
callwaiting_tone = 0x2d
musicclass=default
language=en
deny=0.0.0.0/0.0.0.0
permit=TRIXBOX_SERVER_IP_ADDRESS/255.255.255.0
localnet = 192.168.93.0/255.255.255.0
dnd = on
rtptos = 184
echocancel = on
silencesuppression = off
trustphoneip = no
tos = 0x68
private = on
mwilamp = on
mwioncall = on
blindtransferindication = ring
cfwdall = on
cfwdbusy = on
[devices]
type = 7935
autologin = CONFERENCE_PHONE_EXTENSION
description = Phone7935
keepalive = 60
transfer = on
park = on
cfwdall = on
cfwdbusy = on
dtmfmode = outband
imageversion = P00308000100
deny=0.0.0.0/0.0.0.0
permit=192.168.93.3/255.255.255.255
dnd = on
trustphoneip = no
private = on
mwilamp = on
mwioncall = on
device => SEP00e0752442c5
[lines]
id = CONFERENCE_PHONE_EXTENSION
pin = 1234
label = CONFERENCE_PHONE_EXTENSION
description = Conference Room
context = from-internal
incominglimit = 3
transfer = on
cid_name = Conference Room
cid_num = CONFERENCE_PHONE_EXTENSION
trnsfvm = 1
secondary_dialtone_digits = 9
secondary_dialtone_tone = 0x22
musicclass=default
language=en
rtptos = 184
echocancel = on
silencesuppression = on
line => CONFERENCE_PHONE_EXTENSION

We’re almost done.  Now restart the asterisk service:

# amportal restart

Finally create an extension in the Trixbox administrator interface, and make sure it matches the value of the CONFERENCE_ROOM_EXTENSION in the sccp.conf file above (we used “30″).  Do a hardware reboot of the conference room phone.

Missing from this posting is any explanation about firmware and provisioning.  Cisco sells firmware upgrades to their devices, and we bet that the existing firmware on the used conference phone device was sufficient.  Our bet paid off.

In summary, this solution may still take a few hours of work for your particular Cisco phone.  The payoff is grand – our office Trixbox solution saves us money daily by not having to lease or maintain an expensive private PBX system.

worked in academia, corporate research labs and several technology startup companies prior to GORGES. His expertise is software architecture, database development, and system administration. Matt brings GORGES over 25 years experience developing fast and robust software on a multitude of platforms and languages.
©2012 GORGES - All rights reserved
where programming meets design and lives happily ever after