7906, meet Asterisk: the config

I have gotten numerous requests for actual configuration details from people who have come to this blog by way of the search engines, looking to set up their Cisco IP Phone 7906 on Asterisk or another non-Cisco PBX.

The 7906 has Cisco’s SCCP firmware by default; Asterisk will support this, but there are plenty of reasons to choose SIP over SCCP in a non-Cisco environment.

For me this was an academic exercise. We are running CallManager for our enterprise PBX and whether SCCP or SIP firmware, CUCM will automatically provision the phone. Use the SCCP firmware with CUCM.

The config

What you’ll need:

  • PBX that uses the SIP protocol
  • 7906 or 7911 IP phone. General idea can be applied to any of this generation of Cisco IP phone (41, 61, 42, 62, 45, 65, 71) because they use the same provisioning method and files.
  • TFTP server
  • SmartNet contract on your IP phone hardware so you can get firmware from Cisco
  • DHCP server where you can set client options (the DHCP built into the Linksys router won’t cut it, but most any other DHCP will)

Steps:

  • Go get the SIP load from Cisco. You need a SmartNet contract on your IP phone in order to get the firmware. They change their site around from time to time but I just navigated the menus in this way: Downloads – Voice and Unified Communications – IP telephony – IP Phones – 7900 series – 7906G – SIP Software. Pick the latest or a former release (at this time the latest is 8.5(2) SR1). Download the ZIP file; the .cop.sgn file is the CUCM installation package.
  • Unzip this file to the TFTP root location on your TFTP server, and verify that you can successfully get a file by using a TFTP client in Windows, Mac or Linux to fetch one of the files. (This is especially important if you don’t already have an established TFTP service and you are setting it up just for this.)
  • Create a file named SEPmacaddress.cnf.xml in the TFTP root location. If your phone’s MAC address is 001122334455, the file will be named SEP001122334455.cnf.xml. Use my config as an example, filling in your own variables:

    <device>
      <deviceProtocol>SIP</deviceProtocol>
      <sshUserId></sshUserId>     <!-- log in then use log/log or debug/debug -->
      <sshPassword></sshPassword> <!-- debug commands similar to IOS commands -->
      <devicePool>
         <dateTimeSetting>
            <dateTemplate>M-D-Ya</dateTemplate>   <!-- a=12hr, not case-sensitive -->
            <timeZone>Eastern Standard/Daylight Time</timeZone>
            <ntps>
                 <ntp>
                     <name>IP.ADDRESS.OF.NTP.SERVER</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.SIP.REGISTRAR/PROXY</processNodeName>
                  </callManager>               <!-- addr may work on some -->
               </member>
            </members>
         </callManagerGroup>
      </devicePool>
      <sipProfile>
         <sipProxies>
            <backupProxy></backupProxy>             <!-- most wont need this -->
            <backupProxyPort></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>
         <preferredCodec>none</preferredCodec>
         <dtmfAvtPayload>101</dtmfAvtPayload>
         <dtmfDbLevel>3</dtmfDbLevel>
         <dtmfOutofBand>avt</dtmfOutofBand>
         <alwaysUsePrimeLine>false</alwaysUsePrimeLine>
          <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
         <kpml>3</kpml>
    <!-- WARNING: if PhoneLabel is longer than 10 characters a 7941 will be "unprovisioned" and a 7961 will refuse to accept any settings!!!!! -->
         <phoneLabel>LABEL</phoneLabel>
         <stutterMsgWaiting>2</stutterMsgWaiting>
         <callStats>false</callStats>
         <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
         <disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
         <startMediaPort>16384</startMediaPort>
         <stopMediaPort>32766</stopMediaPort>
         <sipLines>
            <line button="1">
               <featureID>9</featureID>
               <featureLabel>LABEL</featureLabel>  <!-- label next to button -->
               <proxy>PROXY.ADDR.ESS</proxy>       <!-- proxy ADDRESS -->
               <port>5060</port>
               <name>USERNAME</name>  <!-- this is the registrar auth name -->
               <displayName>NAME</displayName>  <!-- outgoing name -->
               <autoAnswer>
                  <autoAnswerEnabled>2</autoAnswerEnabled>
               </autoAnswer>
               <callWaiting>3</callWaiting>
               <authName>USERNAME</authName>    <!-- Auth Username -->
               <authPassword>REG PASSWORD</authPassword>  <!-- registration passwd -->
               <sharedLine>false</sharedLine>
               <messageWaitingLampPolicy>3</messageWaitingLampPolicy>
               <messagesNumber>*97</messagesNumber>  <!-- VM Pilot, *97 for FreePBX -->
               <ringSettingIdle>4</ringSettingIdle>
               <ringSettingActive>5</ringSettingActive>
               <contact>NAME</contact><!-- reg contact field, usually your number -->
               <forwardCallInfoDisplay>
                  <callerName>true</callerName>
                  <callerNumber>false</callerNumber>
                  <redirectedNumber>false</redirectedNumber>
                  <dialedNumber>true</dialedNumber>
               </forwardCallInfoDisplay>
            </line>
         </sipLines>
         <voipControlPort>5060</voipControlPort>
         <dscpForAudio>184</dscpForAudio>
         <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
         <dialTemplate>dialplan.xml</dialTemplate>      <!-- dialplan to load -->
      </sipProfile>
      <commonProfile>
         <phonePassword></phonePassword>
         <backgroundImageAccess>true</backgroundImageAccess>
         <callLogBlfEnabled>2</callLogBlfEnabled>
      </commonProfile>
      <loadInformation>SIP11.8-5-2SR1S</loadInformation> <!-- .loads filename minus the .loads to upgrade to -->
      <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>0</webAccess>             <!-- 0 = enabled? -->
         <spanToPCPort>1</spanToPCPort>
         <loggingDisplay>1</loggingDisplay>
         <loadServer></loadServer>
      </vendorConfig>
     <versionStamp>1143565489-a3cbf294-7526-4c29-8791-c4fce4ce4c37</versionStamp>
      <networkLocale></networkLocale>         <!-- defines tones, default is US -->
      <networkLocaleInfo>
         <name></name>
         <version></version>
      </networkLocaleInfo>
      <deviceSecurityMode>1</deviceSecurityMode>
    <!-- Contents of authenticate.php can be: <?php echo "AUTHORIZED"; ?> -->
      <authenticationURL></authenticationURL>
      <directoryURL>XML DIRECTORY OR EMPTY</directoryURL>
      <idleURL>IDLE SCREEN XML OR EMPTY</idleURL>
      <informationURL></informationURL>
      <messagesURL></messagesURL>
      <proxyServerURL></proxyServerURL>
      <servicesURL></servicesURL>
      <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>

    I emphasized the variables that you need to set by putting in dummy values in UPPERCASE. This config was gleaned from postings on voip-info.org and includes some comments that one of the original posters made. Experiment with it. There are many settings available here; I left much of it “default” (that is, how I got it from voip-info.org). If you are familiar with the device setup screen on CallManager, you’ll recognize these settings from that screen.
  • Create a dialplan.xml in your TFTP root directory.  See the DialPlan Notes section on this voip-info.org page.  Sample:

    <DIALTEMPLATE>
     <TEMPLATE MATCH="10.." Timeout="0"/> <!-- internal extensions are 10xx -->
     <TEMPLATE MATCH="1.........." Timeout="0"/> <!-- 11 digit dialing -->
     <TEMPLATE MATCH="011*" Timeout="5"/> <!-- international -->
     <TEMPLATE MATCH="......." Timeout="3"/> <!-- 7 digit dialing -->
     <TEMPLATE MATCH="*" Timeout="15"/> <!-- Anything else -->
    </DIALTEMPLATE>

  • Review the TFTP root directory.  It should have the contents of the firmware ZIP file, the SEPmacaddress.cnf.xml file, and dialplan.xml.
  • Set up DHCP on your network.  If you want to use static IP addressing, I recommend setting up static clients in DHCP.  Here’s why DHCP is required:  you won’t be able to program the IP address and TFTP information into the phone directly when you do a factory reset to change out the firmware.  If you know of a way to do that, let me know!  Your DHCP configuration for this phone or this phone’s network (depending on whether you use dynamic or static DHCP) must include the following two options:

    option-66 = TFTP server hostname
    option-150 = TFTP server IP address

    Option-66 is also known as “tftp-server-name” on our DHCP server.  Option-150 has no name.  For redundancy or load balancing, you can specify a list of IP addresses in option 150 if you have multiple TFTP servers.

  • Configure the endpoint on your PBX.  In my Asterisk config, the endpoints all register, so I specified the auth username and secret in the appropriate places in the SEPxxx.cnf.xml config above.  If you’re not registering, you’ll want to remove the registrar components from the above config.  Experimentation will likely be required unless your PBX is set up exactly like my test system.
  • The moment of truth arrives:  power up the phone.  Whether your phone is fresh out of the box or coming from another installation, boot up using the factory reset sequence.  Hold down # while plugging in the phone and keep holding it until the message waiting indicator (red light) starts blinking.  Then release # and type 123456789*0# in sequence.  The light will stop blinking and the firmware loading screen will appear.  The phone will get its information from DHCP, contact the TFTP server and download the config and the load files.  Finally, it should register with the PBX (if that’s how you’ve configured it) and be ready to make and receive calls.
  • Test.  Does the Msgs softkey speed dial your voicemail pilot number?  Does your dial plan work (e.g. you can dial your internal extensions without pressing the Dial softkey at the end, and you can dial 11 digits without pressing Dial at the end or waiting for the digit timeout)?  Do you have functional two-way audio?  Browse to the IP address of the phone and check out the information.  (This is read-only; no settings can be changed here.)

See also: