Configuring a Cisco 9951 Phone for Asterisk

Was this helpful? Share it!

    Keep in Mind

    The Cisco Unified IP Phone 8961, 9951, and 9971 phones were not designed to work with any phone system other than Cisco Unified Communications Manager. So, this effort is essentially a hack. If you are OK with certain features not working, like the Contacts button or aspects of Voicemail indication/calling, proceed. If you are looking for tight integration between your endpoints and your Asterisk PBX, you’ll want to consider a phone that supports Asterisk, such as a Polycom, Snom, Grandstream, Aastera, or Linksys device.

    What are the Tricky Parts?

    Cisco phones have never been terribly straightforward to configure. The 9951 introduces a few more curveballs, which I will mention here. Other peculiar aspects, which the 9951 shares with the previous 79XX series of phones have been left out as there are ample resources available elsewhere.

    The 9951 brought these additional challenges:

    • SIP over TCP support only (no traditional SIP over UDP allowed)
    • A particular bug that can cause troubleshooting confusion
    • Seemingly different XML configuration requirements

    Configuring Asterisk for SIP over TCP

    We are using Asterisk 1.8, so adding TCP support is simply a matter of configuration. I believe this is a similar case for 1.6. If you are using Asterisk 1.4, you will need to determine how to add TCP support as it is not native.

    There are two steps to configuring SIP over TCP. The first is to enable it at the global level in Asterisk. Add the following to your SIP configuration. If you’re using vanilla Asterisk, you can put this in your sip.conf file below [general]. If you’re using FreePBX, the most appropriate place is in sip_general_custom.conf.

    tcpenable=yes
    tcpbindaddr=0.0.0.0

    Next, make sure that transport=tcp for each extension that you plan to use the 9951 with.

    Once you’ve completed these steps, open the Asterisk CLI and run sip reload to apply the settings.

    Self Call Bug

    We found that calling ourselves from the 9951 and then answering the call resulted in the phone keeping a “dead” call open on the screen. This seems like nothing more than a visual artifact, but it actually causes loss of additional functionality on the phone. During our troubleshooting, we’d SSH into the device and issue reset soft commands to force the device to grab it’s new configuration. Once we had one of these dead calls, reset soft would no longer do anything, adding to our confusion as we tried to get the phone up and running. Beware!

    XML Configuration Files

    Yes, the part that most of you have been waiting for. Here is the configuration that ended up working for us. You will want to modify this configuration and save it to a file named SEP[MAC_ADDRESS].cnf.xml on your TFTP server. Replace all of the bracketed sections with your applicable settings.

    Note: Make sure that the proxy node under the sipLines/line node remains set to USECALLMANAGER. We were unable to get the device to register with Asterisk when we individually added the hostname or IP of our PBX here.

    <device> 
       <deviceProtocol>SIP</deviceProtocol> 
       <sshUserId>admin</sshUserId> 
       <sshPassword>password</sshPassword> 
       <devicePool> 
          <dateTimeSetting> 
             <dateTemplate>M/D/YA</dateTemplate> 
             <timeZone>Pacific Standard/Daylight Time</timeZone> 
             <ntps> 
                <ntp> 
                   <name>pool.ntp.org</name> 
                   <ntpMode>Unicast</ntpMode> 
                </ntp>         
             </ntps> 
          </dateTimeSetting> 
          <callManagerGroup> 
             <members> 
                <member priority="0"> 
                   <callManager> 
                      <ports> 
                         <ethernetPhonePort>2000</ethernetPhonePort> 
                         <sipPort>5060</sipPort> 
                         <securedSipPort>5061</securedSipPort> 
                      </ports> 
                      <processNodeName>[YOUR PBX HOST/IP]</processNodeName> 
                   </callManager> 
                </member> 
             </members> 
          </callManagerGroup> 
       </devicePool> 
       <sipProfile> 
          <sipProxies> 
             <backupProxy></backupProxy> 
             <backupProxyPort>5060</backupProxyPort> 
             <emergencyProxy></emergencyProxy> 
             <emergencyProxyPort></emergencyProxyPort> 
             <outboundProxy></outboundProxy> 
             <outboundProxyPort></outboundProxyPort> 
             <registerWithProxy>true</registerWithProxy> 
          </sipProxies> 
          <sipCallFeatures> 
             <cnfJoinEnabled>true</cnfJoinEnabled> 
             <callForwardURI>x-serviceuri-cfwdall</callForwardURI> 
             <callPickupURI>x-cisco-serviceuri-pickup</callPickupURI> 
             <callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI> 
             <callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI> 
             <meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI> 
             <abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI> 
             <rfc2543Hold>false</rfc2543Hold> 
             <callHoldRingback>2</callHoldRingback> 
             <localCfwdEnable>true</localCfwdEnable> 
             <semiAttendedTransfer>true</semiAttendedTransfer> 
             <anonymousCallBlock>2</anonymousCallBlock> 
             <callerIdBlocking>2</callerIdBlocking> 
             <dndControl>0</dndControl> 
             <remoteCcEnable>true</remoteCcEnable> 
          </sipCallFeatures> 
          <sipStack> 
             <sipInviteRetx>6</sipInviteRetx> 
             <sipRetx>10</sipRetx> 
             <timerInviteExpires>180</timerInviteExpires> 
             <timerRegisterExpires>3600</timerRegisterExpires> 
             <timerRegisterDelta>5</timerRegisterDelta> 
             <timerKeepAliveExpires>120</timerKeepAliveExpires> 
             <timerSubscribeExpires>120</timerSubscribeExpires> 
             <timerSubscribeDelta>5</timerSubscribeDelta> 
             <timerT1>500</timerT1> 
             <timerT2>4000</timerT2> 
             <maxRedirects>70</maxRedirects> 
             <remotePartyID>false</remotePartyID> 
             <userInfo>None</userInfo> 
          </sipStack> 
          <autoAnswerTimer>1</autoAnswerTimer> 
          <autoAnswerAltBehavior>false</autoAnswerAltBehavior> 
          <autoAnswerOverride>true</autoAnswerOverride> 
          <transferOnhookEnabled>false</transferOnhookEnabled> 
          <enableVad>false</enableVad> 
          <dtmfAvtPayload>101</dtmfAvtPayload> 
          <dtmfDbLevel>3</dtmfDbLevel> 
          <dtmfOutofBand>avt</dtmfOutofBand> 
          <alwaysUsePrimeLine>false</alwaysUsePrimeLine> 
          <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail> 
          <kpml>3</kpml> 
          <phoneLabel>[LABEL THAT APPEARS AT TOP OF SCREEN]</phoneLabel> 
          <stutterMsgWaiting>1</stutterMsgWaiting> 
          <callStats>false</callStats> 
          <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts> 
          <disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig> 
          <sipLines> 
             <line button="1"> 
                <featureID>9</featureID> 
                <featureLabel>[LINE LABEL ON SCREEN]</featureLabel> 
                <proxy>USECALLMANAGER</proxy> 
                <port>5060</port> 
                <name>[SIP EXTENSION]</name> 
                <displayName>[SIP EXTENSION]</displayName> 
                <autoAnswer> 
                   <autoAnswerEnabled>2</autoAnswerEnabled> 
                </autoAnswer> 
                <callWaiting>3</callWaiting> 
                <authName>[SIP EXTENSION]</authName> 
                <authPassword>[SIP PASSWORD]</authPassword> 
                <sharedLine>false</sharedLine> 
                <messageWaitingLampPolicy>1</messageWaitingLampPolicy> 
                <messagesNumber>*97</messagesNumber> 
                <ringSettingIdle>4</ringSettingIdle> 
                <ringSettingActive>5</ringSettingActive> 
                <contact>[SIP EXTENSION]</contact> 
                <forwardCallInfoDisplay> 
                   <callerName>true</callerName> 
                   <callerNumber>false</callerNumber> 
                   <redirectedNumber>false</redirectedNumber> 
                   <dialedNumber>true</dialedNumber> 
                </forwardCallInfoDisplay> 
             </line>
          </sipLines> 
          <voipControlPort>5060</voipControlPort> 
          <startMediaPort>16348</startMediaPort> 
          <stopMediaPort>20134</stopMediaPort> 
          <dscpForAudio>184</dscpForAudio> 
          <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy> 
          <dialTemplate>dialplan.xml</dialTemplate> 
          <softKeyFile></softKeyFile> 
       </sipProfile> 
       <commonProfile> 
          <phonePassword></phonePassword> 
          <backgroundImageAccess>true</backgroundImageAccess> 
          <callLogBlfEnabled>2</callLogBlfEnabled> 
       </commonProfile> 
       <loadInformation>SIP45.8-4-2S</loadInformation> 
       <vendorConfig> 
          <disableSpeaker>false</disableSpeaker> 
          <disableSpeakerAndHeadset>false</disableSpeakerAndHeadset> 
          <pcPort>0</pcPort> 
          <settingsAccess>1</settingsAccess> 
          <garp>0</garp> 
          <voiceVlanAccess>0</voiceVlanAccess> 
          <videoCapability>0</videoCapability> 
          <autoSelectLineEnable>0</autoSelectLineEnable> 
          <webAccess>1</webAccess> 
          <daysDisplayNotActive>1,2,3,4,5,6,7</daysDisplayNotActive> 
          <displayOnTime>00:00</displayOnTime> 
          <displayOnDuration>00:00</displayOnDuration> 
          <displayIdleTimeout>00:00</displayIdleTimeout> 
          <spanToPCPort>1</spanToPCPort> 
          <loggingDisplay>1</loggingDisplay> 
          <loadServer></loadServer> 
       </vendorConfig> 
       <userLocale> 
          <name></name> 
          <uid></uid> 
          <langCode>en_US</langCode> 
          <version>1.0.0.0-1</version> 
          <winCharSet>iso-8859-1</winCharSet> 
       </userLocale> 
       <networkLocale></networkLocale> 
       <networkLocaleInfo> 
          <name></name> 
          <uid></uid> 
          <version>1.0.0.0-1</version> 
       </networkLocaleInfo>    
       <deviceSecurityMode>1</deviceSecurityMode> 
       <authenticationURL></authenticationURL> 
       <directoryURL></directoryURL> 
       <servicesURL></servicesURL> 
       <idleURL></idleURL> 
       <informationURL></informationURL> 
       <messagesURL></messagesURL> 
       <proxyServerURL></proxyServerURL> 
       <dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig> 
       <dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices> 
       <dscpForCm2Dvce>96</dscpForCm2Dvce> 
       <transportLayerProtocol>4</transportLayerProtocol> 
       <capfAuthMode>0</capfAuthMode> 
       <capfList> 
          <capf> 
             <phonePort>3804</phonePort> 
          </capf> 
       </capfList> 
       <certHash></certHash> 
       <encrConfig>false</encrConfig> 
    </device>

    We also found that the dialplan.xml file is respected as it was with previous Cisco phones. Ours looks like this, though yours may vary:

    <DIALTEMPLATE>
    	<TEMPLATE MATCH="91.........." Timeout="0"/>
    	<TEMPLATE MATCH="911" Timeout="0"/>
    	<TEMPLATE MATCH="\*.." Timeout="0"/>
    	<TEMPLATE MATCH="[1-8].." Timeout="1"/>
    	<TEMPLATE MATCH="*" Timeout="5"/>
    </DIALTEMPLATE>
    

    Voicemail

    The Cisco 9951 has a Messages button on the front that presumably integrates with a Cisco Communications Manager to provide some form of visual voicemail. We have yet to find a way to reprogram this button to integrate with Asterisk.

    As a workaround, we’ve created a speed dial button that does connect directly to Asterisk Voicemail. We added this config to our SEP[MAC_ADDRESS].cnf.xml file:

    <line button="2">
    	<featureID>21</featureID>
    	<featureLabel>Voicemail</featureLabel>
    	<speedDialNumber>*97</speedDialNumber>
    </line>

    Outstanding Issues

    We’d still like to find answers to the following:

    • How can we wire the Messages button to automatically dial *97 (Asterisk Voicemail)?
    • Can we configure the Contacts button to show contacts populated by an XML file? Setting DirectoryURL didn’t seem to do anything.

    Control Apple Devices and Apps Remotelysimplemdm.com

    SimpleMDM allows you to configure, secure, and track iPads, iPhones, and OS X remotely, via the web. SimpleMDM provides advanced functionality usually exclusive to convoluted enterprise offerings.

    Was this helpful? Share it!
      Rating: 4.0, from 2 votes.
      Please wait...

      39 thoughts on “Configuring a Cisco 9951 Phone for Asterisk”

      1. I have contacts working pretty well on the 9971 with the latest version of freepbx. I adapted some PHP scripts from an ancient trixbox installation to pick up directory entries from a contacts table in mysql and made that php script available to the 9971 via the XML file using this entry:

        http://PBX_IP_ADDRESS/cisco/services/PhoneDirectory.php

        In addition, i used another script that allows searching of contacts and added that to the provisioning section using these config lines:

        Search by Name
        http://PBX_IP_ADDRESS/cisco/services/searchDirectory.php

        Finally, I set 2 under

        This gives me a very functional contacts button on the 9971 that provides a contact list search function on top and a list of all contacts from the database right below.

        I learnt all of that from lots of googling so very little of this is my original work, except for the customizing of scripts and experimenting with config files to get the contacts button to function just as i wanted.

        No votes yet.
        Please wait...

        1. @Jayant – Thanks for this information. We haven’t had a chance to try it out, but seeing that the 9971 has a lot of similarities with older Cisco phones, it seems that there’d be a good chance that this would work. Hopefully we can get some additional feedback from the community on this.

          Thanks again!

          No votes yet.
          Please wait...

        2. Warum gibt es keine Fotos von der Rückseite mit der Gürtelschnalle ? Völlig undästernvlich.Ausserdem ist die Tasche überhaupt nicht bestellbar, da nur 1 verfügbar ist und die ein anderer bereits im Warenkorb hat. Schade….

          Rating: 5.0, from 1 vote.
          Please wait...

        3. May you please share how to configure the button of cisco 7821 as i already create the XML file with below syntax and when press the directory button i got “requesting…” with no result.
          what may be missing in my configureatoin.

          IP Telephony Directory
          People reachable via VoIP

          Rich
          3000

          Todd
          3001

          No votes yet.
          Please wait...

      2. Hi,

        Beware of the loadInformation tag – the file it points to is for a 7945.

        No votes yet.
        Please wait...

      3. The above XML file has worked with voip.ms inbound and outbound calls working. Just need to tweek the features file, and dial plan files for my needs. I had been working on this for about 18 months on and off, and just as a joke I tried it again, dead tired, and WHAM, worked! Thanks to everyone who put the effort and time in for this, much appreciated!

        No votes yet.
        Please wait...

        1. Thanks for the kind words, Mike. The nature of these phones and their config make it extremely difficult to debug hand-made XML so when we find something that works, we share it!

          No votes yet.
          Please wait...

      4. Spoke a BIT too soon. When there is a missed call, the number is still displayed on the right hand side, and they keep getting listed but only if unanswered. if answered, the number disappears from the list when hung up on, but will leave any missed calls. They cannot be removed until a power cycle, reset or reset all is not available since the phone thinks its still in a call. Conference calls and transfers do not work for some reason either.

        No votes yet.
        Please wait...

        1. I did confirm that the line:
          4
          4 is UDP
          The other options were 1 and 2, one is TLS and the other is TCP, sorry I cannot recall which is which. However this has been documented on other places, google is your friend…
          I am 100 % sure 4 is UDP because voip.ms only supports UDP

          No votes yet.
          Please wait...

          1. Funny, that “4” was cut and pasted, but that was for TransportLayerProtocol.

            No votes yet.
            Please wait...

            1. Also Note that the Field ” PhoneLabel” has a restriction on amount of characters, with 9 characters (Alphanumeric) it worked for me, even with spaces, with 13 it did not. The problem is that the phone has an issue validating the XML file, and will not load it. This can be seen on the admin/status/staus messages. Having the Cisco 9971 connected to a call manager, the Phone label is my phone number, 10 digits, so this MIGHT be the limit of characters.

              Rating: 5.0, from 1 vote.
              Please wait...

              1. PhoneLabel is limited to 12 characters across all the 79xx devices

                No votes yet.
                Please wait...

      5. i was try to register cp-9951 on asterisk but not register. firmware update and others succes but not reigister. i am using elastix. could you help me .thank you for your invitation

        No votes yet.
        Please wait...

      6. Thank you for sharing ! This post was very helpful in resurrecting those “zombified” cisco terminal .

        Merry Christmas

        No votes yet.
        Please wait...

      7. Thanks for this helpful example, unfortunately I’m using FreeSWITCH and doesn’t seem to work for me. I simply copied and pasted your example (with my own settings for sip server etc) and it didn’t work. I also updated my firmware to 9.4.

        FS is listens for TCP and UDP at the same time. I’m assuming there shouldn’t be too much of a change for this to work with FS.

        Any ideas on how I can debug what is happening with the registration ?

        thanks again

        No votes yet.
        Please wait...

        1. It sounds like having some extra debug information would help point you in the right direction. I suggest running a SIP trace (this can be done with a third party software like Wireshark or FreeSWITCH may provide a built-in utility). You could also investigate debug options on the Cisco phone, though I am not familiar with any in particular.

          Hope this helps!

          No votes yet.
          Please wait...

      8. does anyone try to use KEM unit with asterisk,my 9971 working with asterisk well ,but i tried to activate the KEM unit to work with it, unfortunately not succeed…

        No votes yet.
        Please wait...

        1. Hi Cem,

          Can you finally activate the KEM unit?
          Today I get a KEM unit and I’m trying to activate.

          Also, this extra unit need a POE plus port in the swith or an external power.

          Thanks
          Jaime

          No votes yet.
          Please wait...

          1. Yeah I din28#&d17;t actually take that shot, I just ripped it from flickr. It IS nice, isn’t it? Yeah I think that place is a front for money laundering or something dark. I always get creeped out by it. I wasn’t going to eat there anyway, but now I’m DEFINITELY not going to. That place is on my permanent black list.

            No votes yet.
            Please wait...

      9. Any luck with getting the “dead calls” off the screen at all? That seems to be the last piece of this puzzle. I now at least have it registered properly and making AND recieving calls…

        No votes yet.
        Please wait...

      10. Hi, thank you so much for your help and insights. I’m fighting with some 9951 because I can’t get them to show the Call History. The LCD button is greyed out and there’s no Call History app in the Apps menu.

        Any ideas or tips to make this work??

        No votes yet.
        Please wait...

      11. Dear Andres!

        Would be so kind to share your files? eg. dump or config.xml
        thx a lot in advance!

        No votes yet.
        Please wait...

      12. Struggling with this. Trying to get a 6941 running SIP 9.2.1.0 running with FreePBX…..Running a wireshark trace, it appears to pull it’s xml config, and the .loads file via a HTTP GET request, not TFTP as i’d imagine.

        I have tried serving the files to it both by TFTP and HTTP, but it still just says ‘Phone not registered’

        Can upload a pcap if someone wants to take a look but running out of ideas

        Paul

        No votes yet.
        Please wait...

      13. Good post. I learn something totally new and challenging on blogs I stumbleupon everyday.
        It’s always exciting to read articles from other writers and practice a little someething from
        their web sites.

        Have a look att my web site; Safaris in Botswana

        No votes yet.
        Please wait...

      14. Great info here.

        Is there a way to get the phone to register to user@domain instead of user@ipadd? The phone resolves the domain to an IP address and registers with that. This does not work for multi-tenancy, where the switch uses the domain/subdomain info for registration.

        I tried changing the proxy from USECALLMANAGER to a domain name to no avail. Any ideas?

        Thanks.

        – Phil

        No votes yet.
        Please wait...

        1. @Phil,

          Did you ever get this figured out with the domain/subdomain? If so, what did you do? I have several phones that I would like to get setup for this, but running into the same issue as you have shown here. I’ve ran wireshark captures and I see the issue, and have even tried modifying the XML file with the displayName and even the name with the user@fqdn with still no success. Can’t understand why older phones have no issue with this, but newer phones do.

          Thanks,

          -Gordon

          No votes yet.
          Please wait...

      15. I got a Cisco 9951, the missed/dead call bug is happening even with the latest firmware sip9951.9-4-2SR1-2.
        However it doesn’t happen with the firmware sip9951.9-2-2SR1-9 or older.

        So I guess a workaround for now, is to downgrade the firmware to sip9951.9-2-2SR1-9 or to an older version than that.

        I hope this helps someone.

        Rating: 5.0, from 3 votes.
        Please wait...

        1. Could you post your config for the 9951.
          I tried downngrading the firmware to sip9951.9-2-2SR1-9 yet still having the missed call bug.

          btw, here is a wonderfull link covering all parameters in the SEP conf file
          http://docs.acsdata.co.nz/asterisk-cisco/sepmac-cnf-xml.shtml

          No votes yet.
          Please wait...

      16. please can someone share with me the authentification.php and directory.php file for cisco phone 79XX i will really appreciate thanks in advance

        No votes yet.
        Please wait...

      17. Hello,
        I am trying but does not work. Can you share an example of the config in asterisk for sip.conf?
        Thanks

        No votes yet.
        Please wait...

      18. Thanks a lot, man!

        No votes yet.
        Please wait...

      19. Here there is a script that may help people with the configuration of the cisco files. It is not finished but it can be adapted to modify configuration files aswell as to show important configuration values:

        https://github.com/xpheres/SipManagerSuite

        No votes yet.
        Please wait...

      20. Hello, I managed to register to my local number on a fritzbox and to my asterisk line by writing USECALLMANAGER in proxy node under the sipLine and the ip of fritzbox / asterisk in . The problem is that I can not register the two lines simultaneously as I can just write one ip on processNodeName and the fritzbox and asterisk have different local Ips, anyone know a workaround to connect two lines simultaneously from different ip?

        No votes yet.
        Please wait...

      21. IT WORKED ON CISCO 8941 !!!!!!
        THANK YOU VERY MUCH
        RUNNING FIRMWARE SIP894x.9-2-1-00

        No votes yet.
        Please wait...

        1. Ciao Gustavo,
          avrei bisogno di contattarti per la configurazione del modello 8941?

          Grazie

          No votes yet.
          Please wait...

      22. Is there no possibility to config Cisco 9951 via Web? 🙁

        No votes yet.
        Please wait...

        1. As I said above, I’ve started a graphical interface to configurate SIP for cisco. The project is not finished but it is able to show all parameters via browser and as a service that can be seen directly in the cisco screen. I just need to add a form in the service and you will be able to change sip parameters in the telephone itself or a browser.

          Please check the project here:

          https://github.com/xpheres/SipManagerSuite

          No votes yet.
          Please wait...

      23. Hi,
        I am using here Cisco 8961 with Dlink DVX2005f ipbox. still i didnt get any access from 8961 by graphical interface and support.
        I need the help for access this phone with Asterisk. Because this phone for our Boss.

        No votes yet.
        Please wait...

      24. good morning nice people, I have the same issue as ” Mohamed”:

        May you please share how to configure the button of cisco 7821 as i already create the XML file with below syntax and when press the directory button i got “requesting…” with no result.
        what may be missing in my configureation.”

        Also my 7821 keep showing requesting. Has anyone a working example of directory working on a 7821?

        thks in advance

        Fabio

        No votes yet.
        Please wait...

      Leave a Reply

      Your email address will not be published. Required fields are marked *