📜 ⬆️ ⬇️

Configure the Cisco 79XX Series Phone to Work with Asterisk



The article will describe the nuances of configuring a Cisco IP Phone using the example of the 7942G tsiskofona.
So, if you are looking at Cisco VoIP devices of the 79XX series, then welcome under cat.


Used by:


Cisco VoIP Phone 7942G
Asterisk 1.4.39
TFTP-server-0.49
Attention! The instruction is not suitable for all Cisco 79XX phones. See here
')

Customization



Keyboard shortcuts in Cisco

** # ** - reboot the phone (via the menu)
** # - unlock settings (also through the menu). Unlocking is needed, for example, in order to set the DHCP client settings

Tftp

The first thing we need to do is configure tftpserver. I used the standard Linux. I recommend to immediately set up that tftp requests are recorded in a log file (by default / var / log / messages).
cat /etc/xinetd.d/tftp:
...
server_args = -s /tftpboot -v
...

Firmware change

So, first you need to find the necessary firmware for working on SIP, because The default is SCCP version. For this there is a Google or torrents .

Next, go to the well-known site voip-info.org . The link contains information about the firmware. Because I have an asterisk version 1.4 (which does not know how to work on tcp), then it is advised to take version 8.5.4. This link has a lot of other useful information.
Thus, we need a file cmterm-7942_7962-sip.8-5-4.zip. All files that are there need to be dumped into the root of the tftp server.

Russian locale

Still the Russian locale would not prevent us. Well, that is so that all the inscriptions on the screen were in Russian.
I took it from the file po-locale-ru_RU-8.4.3.1000-1.exe (can also be found on the Internet). There is one trick here - when you start the program, it throws out an error and then closes. But we just need the locale files, we can install them ourselves.
Therefore, after launching, go to the% TEMP% folder (I advise you to clear it beforehand) and see what the program will throw out.
There among other things will be the folder Russian_Russian_Federation. Here we will need to place it in the root of the tftp server.
The locale version will be just 8.4.3.1000-1.

Tsiskofon configuration file

Now let's go directly to the configuration file. The audio player downloads it exclusively from the tftp server. At first it seems inconvenient, on the other hand, you need to configure it only once, and then you can buy these phones at least in stacks - they will be set up in the same way and take the least amount of time. In addition, this Cisco secured the phone from the "playful hands" of users. Almost nothing can be done through the menu.
The file should be called SEP <Cisco Phone MAC Address> .cnf.xml.
Mac address is written on the back of the device.
We define some values:
$ ASTERISK - ah-pi our asterisk
$ SERVICESURL - full path to the script that generates the address book (for example, 192.168.0.22/asterisk/directory.php )
$ ACCOUNT - user / number of our account on the asterisk. If you do not have a matching user number <=>, then the config will need to be changed accordingly.
$ ACCOUNT_PASS - password from SIP account
 <device> <fullConfig>true</fullConfig> <deviceProtocol>SIP</deviceProtocol> <devicePool> <dateTimeSetting> <dateTemplate>DMY</dateTemplate> <timeZone>Ekaterinburg Standard Time</timeZone> <ntps> <ntp> <name>$ASTERISK</name> <ntpMode>Unicast</ntpMode> </ntp> </ntps> </dateTimeSetting> <callManagerGroup> <tftpDefault>true</tftpDefault> <members> <member priority="0"> <callManager> <name>$ASTERISK</name> <description>CallManager 5.0</description> <ports> <ethernetPhonePort>2000</ethernetPhonePort> <sipPort>5060</sipPort> <securedSipPort>5061</securedSipPort> </ports> <processNodeName>$ASTERISK</processNodeName> </callManager> </member> </members> </callManagerGroup> </devicePool> <commonProfile> <phonePassword></phonePassword> <backgroundImageAccess>true</backgroundImageAccess> <callLogBlfEnabled>0</callLogBlfEnabled> </commonProfile> <loadInformation>SIP42.8-5-4S</loadInformation> <loadInformation434 model="Cisco 7942">SIP42.8-5-4S</loadInformation434> <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> <daysDisplayNotActive>1,7</daysDisplayNotActive> <displayOnTime>10:30</displayOnTime> <displayOnDuration>06:05</displayOnDuration> <displayIdleTimeout>00:05</displayIdleTimeout> <webAccess>1</webAccess> <spanToPCPort>1</spanToPCPort> <loggingDisplay>1</loggingDisplay> <loadServer></loadServer> </vendorConfig> <userLocale> <name>Russian_Russian_Federation</name> <uid></uid> <langCode>ru_RU</langCode> <version>8.4.3.1000-1</version> <winCharSet>utf-8</winCharSet> </userLocale> <networkLocale>Russian_Federation</networkLocale> <networkLocaleInfo> <name>Russian_Federation</name> <uid></uid> <version>8.4.3.1000-1</version> </networkLocaleInfo> <deviceSecurityMode>1</deviceSecurityMode> <idleTimeout>0</idleTimeout> <directoryURL></directoryURL> <servicesURL>$SERVICESURL</servicesURL> <idleURL></idleURL> <messagesURL></messagesURL> <proxyServerURL></proxyServerURL> <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> <sipProfile> <sipProxies> <backupProxy>$ASTERISK</backupProxy> <backupProxyPort>5060</backupProxyPort> <emergencyProxy>$ASTERISK</emergencyProxy> <emergencyProxyPort>5060</emergencyProxyPort> <outboundProxy>$ASTERISK</outboundProxy> <outboundProxyPort>5060</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>g711alaw</preferredCodec> <dtmfAvtPayload>101</dtmfAvtPayload> <dtmfDbLevel>3</dtmfDbLevel> <dtmfOutofBand>avt</dtmfOutofBand> <alwaysUsePrimeLine>false</alwaysUsePrimeLine> <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail> <kpml>3</kpml> <stutterMsgWaiting>1</stutterMsgWaiting> <callStats>true</callStats> <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts> <disableLocalSpeedDialConfig>true</disableLocalSpeedDialConfig> <startMediaPort>10100</startMediaPort> <stopMediaPort>10300</stopMediaPort> <voipControlPort>5060</voipControlPort> <dscpForAudio>184</dscpForAudio> <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy> <dialTemplate>dialplan.xml</dialTemplate> <phoneLabel>Cisco</phoneLabel> <natReceivedProcessing>false</natReceivedProcessing> <natEnabled>false</natEnabled> <natAddress></natAddress> <sipLines> <line button="1"> <featureID>9</featureID> <featureLabel>$ACCOUNT</featureLabel> <proxy>$ASTERISK</proxy> <port>5060</port> <name>$ACCOUNT</name> <displayName>$ACCOUNT</displayName> <autoAnswer> <autoAnswerEnabled>2</autoAnswerEnabled> </autoAnswer> <callWaiting>3</callWaiting> <authName>$ACCOUNT</authName> <authPassword>$ACCOUNT_PASS</authPassword> <sharedLine>false</sharedLine> <messageWaitingLampPolicy>3</messageWaitingLampPolicy> <messagesNumber></messagesNumber> <ringSettingIdle>4</ringSettingIdle> <ringSettingActive>5</ringSettingActive> <contact>$ACCOUNT</contact> <forwardCallInfoDisplay> <callerName>true</callerName> <callerNumber>false</callerNumber> <redirectedNumber>false</redirectedNumber> <dialedNumber>true</dialedNumber> </forwardCallInfoDisplay> </line> <line button="2"> <featureID></featureID> <featureLabel></featureLabel> <speedDialNumber></speedDialNumber> </line> </sipLines> </sipProfile> </device> 


Now we will comment.

 <timeZone>Ekaterinburg Standard Time</timeZone> -   ,        NTP- (    ). 

All time zones can be found, for example, here .

 <loadInformation>SIP42.8-5-4S</loadInformation> -  ,    


The following settings are needed to set the locale:
 <userLocale> <name>Russian_Russian_Federation</name> <uid></uid> <langCode>ru_RU</langCode> <version>8.4.3.1000-1</version> <winCharSet>utf-8</winCharSet> </userLocale> <networkLocale>Russian_Federation</networkLocale> <networkLocaleInfo> <name>Russian_Federation</name> <uid></uid> <version>8.4.3.1000-1</version> </networkLocaleInfo> 


 <servicesURL>$SERVICESURL</servicesURL> -    XML   (       ). 


 <dialTemplate>dialplan.xml</dialTemplate> -    ,    . 


 <line button="2"> -   , ..   SIP-. 


 <preferredCodec>g711alaw</preferredCodec> -  G711 alaw    . 


Asterisk sip.conf configuration

 ... [$ACCOUNT] deny=0.0.0.0/0.0.0.0 permit=192.168.0.0/255.255.255.0 type=friend host=dynamic context=_ dtmfmode=rfc2833 disallow=all allow=alaw allow=ulaw allow=gsm username=$ACCOUNT secret=$ACCOUNT_PASS call-limit=2 ... 

The most interesting thing here is call-limit = 2. The bottom line is that it will be possible to receive 1 or 2 calls (3 calls already on a tsiska will not work - why strain it?), They can be processed on the phone, switching between them. More than 2 calls in this device are not supported (it will probably be supported in new firmware), although it is already quite expensive to process 3 calls.

Setting up the dial plan

Cisco is so smart that it can use its own dialplan. But there is a reverse side of the coin. If this dialplan is not specified, then outgoing calls will not go at all. Will be more exact, but only on numbers from 0 to 9 =).
 <DIALTEMPLATE> <TEMPLATE MATCH="*" Timeout="3"/> <!-- Anything else --> </DIALTEMPLATE> 

In this config, we essentially transfer all the responsibility to the asterisk - i.e. just after 3 seconds we give the number. More elegant numbering plans can be found at voip-info.org.

Subscriber Address Book

We have LDAP (in conjunction with samba), it has information about the users' phones. So why not take advantage of this?
LDAP server, filter search will need to change to their settings.
directory.php:
 <? header("Content-type: text/xml"); header("Connection: close"); header("Expires: -1"); $page=1; if(isset($_GET['page'])) { $page = $_GET['page']; if(settype($page,"integer") == false) die("<b>BAD REQUEST (invalid type)</b>"); } echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; $ldapconfig['host'] = '192.168.0.8'; $ldapconfig['port'] = NULL; $ldapconfig['basedn'] = 'ou=users,dc=MyCompany,dc=ru'; $ldapconfig['filter'] = "(&(uid=*)(objectClass=sambaSamAccount)(objectClass=inetOrgPerson))"; print("<CiscoIPPhoneDirectory>\n"); print("\t<Title> </Title>\n"); print("\t<Prompt> </Prompt>\n"); $DS = @ldap_connect($ldapconfig['host'], $ldapconfig['port']); if ( $DS === false ) exit("ldap_connect problem: ".ldap_error($DS)); $SRes = @ldap_search($DS, $ldapconfig['basedn'], $ldapconfig['filter']); if ( $SRes === false ) exit("ldap_search problem: ".ldap_error($DS)); $res = @ldap_get_entries($DS, $SRes); if ( $res === false ) exit("ldap_get_entries problem: ".ldap_error($DS)); $results = array(); for ($i = 0; $i < $res["count"]; $i++) { if (!isset($res[$i]["telephonenumber"])) continue; if (!isset($res[$i]["displayname"])) continue; $r_ar = array(); $r_ar['displayname']=$res[$i]["displayname"][0]; $r_ar['telephonenumber']=$res[$i]["telephonenumber"][0]; array_push($results, $r_ar); } for ($i = 0; $i < (count($results)-1); $i++) for ($k = $i+1; $k < count($results); $k++) { if (strcmp($results[$i]['displayname'],$results[$k]['displayname']) > 0) { $r_tmp = array(); $r_tmp = $results[$i]; $results[$i] = $results[$k]; $results[$k] = $r_tmp; } } for ($i = (32*($page-1)); $i < (32*$page); $i++) { if ($i == count($results)) break; print("\t<DirectoryEntry>\n"); print("\t\t<Name>"); print($results[$i]['displayname']); print("</Name>\n"); print("\t\t<Telephone>"); print($results[$i]['telephonenumber']); print("</Telephone>\n"); print("\t</DirectoryEntry>\n"); } print("<SoftKeyItem>"); print("<Name>Dial</Name>"); print("<URL>SoftKey:Dial</URL>"); print("<Position>1</Position>"); print("</SoftKeyItem>"); if ($page > 1) { print("<SoftKeyItem>"); print("<Name>Prev</Name>"); print("<URL>http://".$_SERVER['SERVER_NAME']."/asterisk/directory.php?page=".($page-1)."</URL>"); print("<Position>2</Position>"); print("</SoftKeyItem>"); } $count_pages = (int) (count($results) / 32); if ((count($results) % 32) !=0) $count_pages++; if ($page < $count_pages) { print("<SoftKeyItem>"); print("<Name>Next</Name>"); print("<URL>http://".$_SERVER['SERVER_NAME']."/asterisk/directory.php?page=".($page+1)."</URL>"); print("<Position>3</Position>"); print("</SoftKeyItem>"); } print("<SoftKeyItem>"); print("<Name>Exit</Name>"); print("<URL>SoftKey:Exit</URL>"); print("<Position>4</Position>"); print("</SoftKeyItem>"); print("</CiscoIPPhoneDirectory>\n"); ?> 

Update . Notice that there are only 32 contacts on the page. Why is that? I do not know how to explain this, but it is implemented in the firmware this way - more than 32 contacts are not supported. However, it does not matter, because can be implemented with the help of softkey mapping mechanism before. and next pages.

Making settings for the logo

To begin with, look at the tftp logs where cisco is looking for a picture. This happens at the moment of selecting the background image.
through the phone menu (how to unlock the menu is written above).
images from the menu
/tftpboot/Desktops/320x196x4/List.xml:
 <CiscoIPPhoneImageList> <ImageItem Image="TFTP:Desktops/320x196x4/Logo-TN.png" URL="TFTP:Desktops/320x196x4/Logo.png"/> </CiscoIPPhoneImageList> 

We need to create one image 320x196 and one image 4 times smaller (80x49).
Logo-TN.png - sketch.
Logo.png - full picture.
You need to change the logo through the phone menu.

What is not included in the article


- Customize call signals. Yes, it can also be done. Another thing - why? If it makes sense to you, go ahead.
- Setting up directories. It is possible, for example, to read RSS from a phone and in general add various content directories.

Problems encountered during the setup process


1. I needed firmware for SIP (default SCCP)
2. The phone did not register (I installed firmware 9.0.3, which only works over TCP)
3. There were no outgoing calls (see dialplan.xml)
4. Only 32 contacts in the address book are displayed (firmware limitation)

Links


www.voip-info.org/wiki/view/Asterisk+phone+cisco+79x1+xml+configuration+files+for+SIP
www.voip-info.org/wiki/view/Asterisk+phone+cisco+7970+SIP
www.asteriskguru.com/tutorials/cisco_7960_ip_phone_configuration.html
Customization experience:
3090607.ru/note/27-cisco-ip-phone-locale
forum.sysadmins.su/index.php?showtopic=20489
www.voipstore.com/configuring-cisco-7975-ip-phones-for-sip
asteriskpbx.ru/display/Asterisk/CISCO+7911
www.gho.no/2009/05/cisco-ip-phone-configuration-with-asterisk
Officer leadership:
www.cisco.com/en/US/docs/voice_ip_comm/cuipph/7960g_7940g/sip/2_0/english/administration/guide/admin2.pdf
www.cisco.com/en/US/docs/voice_ip_comm/cuipph/7962g_7942g/6_0/english/administration/guide/7962G-Admin-Book-Wrapper.html
XML objects:
www.cisco.com/univercd/cc/td/doc/product/voice/vpdd/cdd/5_0/5_0_1/ipphsv/ip503ch2.htm#wp1033491
www.ibm.com/developerworks/wireless/library/wi-voip
webmaxtor.blogspot.com/2009/04/cisco-ipphonedirectory-exit-softkey.html
www.cisco.com/univercd/cc/td/doc/product/voice/vpdd/cdd/5_0/5_0_1/ipphsv/ip503ch2.htm
docstore.mik.ua/univercd/cc/td/doc/product/voice/vpdd/cdd/5_0/ipphsv/ip502apa.htm#wp1007090
my.safaribooksonline.

Source: https://habr.com/ru/post/121140/


All Articles