Skip to content

Instantly share code, notes, and snippets.

@itpcc
Last active November 30, 2023 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itpcc/9099a21128ff0d34d8d971364d0a7610 to your computer and use it in GitHub Desktop.
Save itpcc/9099a21128ff0d34d8d971364d0a7610 to your computer and use it in GitHub Desktop.
How I configure my Cisco CP-6921 to use with my FreePBX

Why

Recently, I've buy a "new old stock" Cisco CP-6921 in order to replace my old POTS phone used in conjunction with my FXS that I've configured not long ago. So, as Cisco do their best, it's not straightforwardly to configured without their proprietary softwares. Fortunately, there's tons of resources to help and, finally, got me through and got it done. So, to help alleviate the pain that I've gone through, I decide to, once again, write this memo.

Disclaimers

This is how I done, not a tutorial. Use your own discrestion. I won't take any responsibility if things break.

Pre-requirements

How?

  1. Setup a tftp server so the phone can fetch configurations and firmwares:
apt install tftp-server
  1. Edit /etc/default/tftpd-hpa by chage TFTP_OPTIONS line to TFTP_OPTIONS="--secure --verbose". This is to make us easy to debug what file do they need.

  2. sudo systemctl restart tftpd-hpa.service

  3. Download SIP firmwares and things. I use the following files from staskobzar/cisco_prov Git repo:

    • BOOT69xx.0-0-0-14.zz.sgn
    • DSP69xx.12-4-122-99.131025.zz.sgn
    • SIP69xx.9-4-1-3SR2.loads
    • SIP69xx.9-4-1-3SR2.zz.sgn
  4. Create XMLDefault.cnf.xml, dialplan.xml, and Thailand/g3-tones.xml from the file below.

  5. See MAC address from the bottom of the phone. Write that down! Write that down!

image

  1. Create SEP<MAC>.cnf.xml from the file below. Replace <MAC> with the MAC address taken from the last step in uppercase format.

  2. Generate ITLFile.tlv. follow this tutorial for more info. Note that, on asterisk.pem step, I create a PEM file by combining ca.key and ca.crt stored in /etc/asterisk/keys.

  3. Upload to TFTP server. I use default location: /srv/tftp

  4. Find the server's IP address: ip address

  5. Power up the phone. It'll show "Phone not registered".

  6. Set Alternative TFTP server

  • Push Application button (the one with cog icon) > 4. Admin Settings (Down 4 times) > 1. Network Setup > 1. IPv4 Setup > 6. Alternative TFTP Server > Yes > Save
  • Application > 4. Admin Settings (Down 4 times) > 1. Network Setup > 1. IPv4 Setup > 7. TFTP Server 1 > Punch in IP address (use * in substitute of .) > Validate > Save
  • Restart The phone: Push Application button (the one with cog icon) > Push **#** > Wait
  1. If you done right, in sudo journalctl -u tftpd-hpa.service, the log will show RRQ from <Phone IP> filename : <Filename> and the phone will set itself up.

  2. Enjoy the call!

XMLDefault.cnf.xml

This file is to define what firmware do the phone use. Mainly on loadInformation495 tag, define firmware name which you use without file extension. In my case, I use SIP69xx.9-4-1-3SR2.

Replace SERVER_IP with PBX IP.

dialplan.xml

This file is to define how the phone should trigger the call when the use punch the number. For example, if use punch 4 digit hotline number; the one without leading zero prefix, it should start the call as soon as the user finish punching the number. Or, when the user punch direct phone number which in Thailand, my country, use either 9 numbers for a landline or 10 for mobile one, I decide that once the use punch the 9th digit, let them wait for one second for the last number should user want to dial the mobile phone number. Etc, etc.

The format can be readed at USECALLMANAGER.nz tutorial page.

SEP<MAC>.cnf.xml

This file is to define how the phone should interact with PBX server and its configuration.

  • device.devicePool.dateTimeSetting.dateTemplate I set to Date-month-year in 4 digits, 24 hours format.
  • device.devicePool.dateTimeSetting.ntps.ntp.name I set to my country NTP pool. Should you use in another country, find the one for you at pool.ntp.org
  • device.devicePool.callManagerGroup.members.member.callManager.processNodeName Change to either PBX server hostname, DNS name, or IP address.
  • device.sipProfile.sipLines.line.displayName Set the one used in FreePBX display name for consistency reason.
  • device.loadInformation Set firmware name like XMLDefault.cnf.xml.loadInformation495 field.
  • device.vendorConfig Set how you want. In my case, I've found that the default value is so damn bright it glow in the dark once I turn off the light to have a fun on the bed. So, I set backlightOnDuration and its related config so the light will dim once I stop using the phone.

image

Resources

<DIALTEMPLATE>
<TEMPLATE MATCH="..." TIMEOUT="1"/><!-- Hotline number. Wait 1 sec for 4 th digit if nay -->
<TEMPLATE MATCH="...." TIMEOUT="0"/>
<TEMPLATE MATCH="0........" TIMEOUT="1"/><!-- Dial Landline Phone -->
<TEMPLATE MATCH="0........." TIMEOUT="0"/><!-- Dial Mobile Phone -->
<TEMPLATE MATCH="\*97" TIMEOUT="0"/><!-- *97 for voicemail. Dial immediately. -->
<TEMPLATE MATCH="*#" TIMEOUT="0" REWRITE="%1"/><!-- Dial immediately after pressing #. Do not send the # sign. -->
<TEMPLATE MATCH="*" TIMEOUT="5"/> <!-- Anything else, wait 5 seconds then dial. -->
</DIALTEMPLATE>
<device>
<deviceProtocol>SIP</deviceProtocol>
<sshUserId>cisco</sshUserId>
<sshPassword>cisco</sshPassword>
<devicePool>
<dateTimeSetting>
<dateTemplate>D/M/YY</dateTemplate>
<timeZone>New Zealand Standard</timeZone>
<ntps>
<ntp>
<name>th.pool.ntp.org</name>
<ntpMode>Unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<sipPort>5060</sipPort>
</ports>
<processNodeName>{SERVER_DOMAIN_NAME}</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
</devicePool>
<sipProfile>
<sipProxies>
<backupProxy></backupProxy>
<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>true</remotePartyID>
<userInfo>None</userInfo>
</sipStack>
<autoAnswerTimer>1</autoAnswerTimer>
<autoAnswerAltBehavior>false</autoAnswerAltBehavior>
<autoAnswerOverride>true</autoAnswerOverride>
<transferOnhookEnabled>false</transferOnhookEnabled>
<enableVad>false</enableVad>
<preferredCodec>g711ulaw</preferredCodec>
<dtmfAvtPayload>101</dtmfAvtPayload>
<dtmfDbLevel>3</dtmfDbLevel>
<dtmfOutofBand>avt</dtmfOutofBand>
<alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
<kpml>3</kpml>
<natEnabled>false</natEnabled>
<natAddress></natAddress>
<phoneLabel>300</phoneLabel>
<stutterMsgWaiting>0</stutterMsgWaiting>
<callStats>false</callStats>
<silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
<disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
<startMediaPort>16384</startMediaPort>
<stopMediaPort>32766</stopMediaPort>
<sipLines>
<line button="1">
<featureID>9</featureID>
<featureLabel>{DISPLAY_NAME}</featureLabel>
<proxy>USECALLMANAGER</proxy>
<port>5060</port>
<name>{EXTENSION_NUMBER}</name>
<displayName>{DISPLAY_NAME}</displayName>
<autoAnswer>
<autoAnswerEnabled>2</autoAnswerEnabled>
</autoAnswer>
<callWaiting>3</callWaiting>
<authName>{EXTENSION_NUMBER}</authName>
<authPassword>{EXTENSION_PASSWORD}</authPassword>
<sharedLine>false</sharedLine>
<messageWaitingLampPolicy>1</messageWaitingLampPolicy>
<messagesNumber>*97</messagesNumber>
<ringSettingIdle>4</ringSettingIdle>
<ringSettingActive>5</ringSettingActive>
<contact>{EXTENSION_NUMBER}</contact>
<forwardCallInfoDisplay>
<callerName>true</callerName>
<callerNumber>true</callerNumber>
<redirectedNumber>false</redirectedNumber>
<dialedNumber>true</dialedNumber>
</forwardCallInfoDisplay>
</line>
</sipLines>
<voipControlPort>5060</voipControlPort>
<dscpForAudio>184</dscpForAudio>
<ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
<dialTemplate>dialplan.xml</dialTemplate>
</sipProfile>
<commonProfile>
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>1</callLogBlfEnabled>
</commonProfile>
<loadInformation>SIP69xx.9-4-1-3SR2</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>
<spanToPCPort>1</spanToPCPort>
<loggingDisplay>1</loggingDisplay>
<loadServer></loadServer>
<backlightIdleTimeout>00:01</backlightIdleTimeout>
<backlightOnDuration>00:05</backlightOnDuration>
<daysBacklightNotActive>1,2,3,4,5,6,7</daysBacklightNotActive>
<backlightOnWhenIncomingCall>1</backlightOnWhenIncomingCall>
</vendorConfig>
<versionStamp>1143565489-a3cbf294-7526-4c29-8791-c4fce4ce4c37</versionStamp>
<networkLocale>Thailand</networkLocale>
<networkLocaleInfo>
<name>Thailand</name>
<uid>64</uid>
<version>1.0.0.0-1</version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<authenticationURL></authenticationURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<messagesURL></messagesURL>
<proxyServerURL></proxyServerURL>
<servicesURL></servicesURL>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>96</dscpForCm2Dvce>
<transportLayerProtocol>2</transportLayerProtocol>
<capfAuthMode>0</capfAuthMode>
<capfList>
<capf>
<phonePort>3804</phonePort>
</capf>
</capfList>
<certHash></certHash>
<encrConfig>false</encrConfig>
</device>
<tone c1="31538″ i1="-780″ c2="30831" i2="-973" d="2" t="odial">
<part m="on" t="65535"/>
<repeat c="65535"/>
</tone>
<?xml version="1.0"?>
<Default>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<processNodeName>SERVER_IP</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<loadInformation307 model="SIP: Cisco IP Phone 7911">SIP11.8-5-4S</loadInformation307>
<loadInformation30007 model="SIP: Cisco 7912">CP7912080000SIP060111A</loadInformation30007>
<loadInformation495 model="SIP: Cisco 6921">SIP69xx.9-4-1-3SR2</loadInformation495>
<loadInformation8 model="SIP: Cisco 7940">P0S3-8-12-00</loadInformation8>
<loadInformation7 model="SIP: Cisco 7960">P0S3-8-12-00</loadInformation7>
<loadInformation115 model="SIP: Cisco 7941">SIP41.8-5-4S</loadInformation115>
<loadInformation309 model="SIP: Cisco 7941G-GE">SIP41.8-5-4S</loadInformation309>
<loadInformation30018 model="SIP: Cisco 7961">SIP41.8-5-4S</loadInformation30018>
<loadInformation308 model="SIP: Cisco 7961G-GE">SIP41.8-5-4S</loadInformation308>
<loadInformation434 model="SIP: Cisco 7942">SIP42.8-5-4S</loadInformation434>
<loadInformation404 model="SIP: Cisco 7962">SIP42.8-5-4S</loadInformation404>
<loadInformation435 model="SIP: Cisco 7945">SIP45.8-5-4S</loadInformation435>
<loadInformation436 model="SIP: Cisco 7965">SIP45.8-5-4S</loadInformation436>
<loadInformation621 model="SIP: Cisco 7821">sip78xx.11-0-1-11</loadInformation621>
<authenticationURL></authenticationURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
<sshUserId>cisco</sshUserId>
<sshPassword>cisco</sshPassword>
<userLocale>
<name>French_France-8.5.3</name>
<uid>2</uid>
<langCode>fr</langCode>
<version>4.1(3.645)FRA</version>
<winCharSet>iso-8859-1</winCharSet>
</userLocale>
</Default>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment