{"id":792,"date":"2012-10-19T01:00:00","date_gmt":"2012-10-18T23:00:00","guid":{"rendered":"https:\/\/www.fussylogic.co.uk\/blog\/?p=792"},"modified":"2012-10-19T10:59:27","modified_gmt":"2012-10-19T09:59:27","slug":"asterisk-and-cisco-7940","status":"publish","type":"post","link":"https:\/\/www.fussylogic.co.uk\/blog\/?p=792","title":{"rendered":"Asterisk and Cisco 7940"},"content":{"rendered":"<p>There are a number of guides out on the Internet for getting Cisco phones working with Asterisk. I didn\u00e2\u20ac\u2122t particularly find any of them 100% thorough. This then is my guide, documenting the moment I ordered the phone to the moment I made a call on it.<\/p>\n<p>I bought a Cisco 7940 phone from eBay. It was a brand new boxed version. I\u00e2\u20ac\u2122ve changed the MAC to <code>00:18:b9:ff:ff:ff<\/code> in this document in case the real MAC could be used by an attacker (paranoia is good for security).<\/p>\n<p>I\u00e2\u20ac\u2122d suggest beginning by running Wireshark and set it to filter on the phone\u00e2\u20ac\u2122s MAC so that you can follow what it\u00e2\u20ac\u2122s doing more easily (I used <code>'ether host xx:xx:xx:xx:xx or broadcast'<\/code>). Leave that running for the whole of this guide.<\/p>\n<h2 id=\"power-supply\">Power Supply<\/h2>\n<p>The main difference between the 79&#215;0 and 79&#215;1 phones from Cisco is that the \u00e2\u20ac\u02dc0\u00e2\u20ac\u2122 are pre-standard power-over-ethernet, so unless you want to buy a Cisco power over ethernet supply, you\u00e2\u20ac\u2122ll probably need a power block for the 79&#215;0 phones. They\u00e2\u20ac\u2122re 48V with a slightly unusual connector.<\/p>\n<h2 id=\"prerequistes\">Prerequistes<\/h2>\n<p>I\u00e2\u20ac\u2122m going to assume you\u00e2\u20ac\u2122ve already got a DHCP server on your network, and I\u00e2\u20ac\u2122m assuming you\u00e2\u20ac\u2122re already running a working Asterisk system.<\/p>\n<h2 id=\"first-boot\">First Boot<\/h2>\n<p>Here\u00e2\u20ac\u2122s the sequence:<\/p>\n<ul>\n<li>Green headset light<\/li>\n<li>Red Mute light<\/li>\n<li>Green speaker light<\/li>\n<li>\u00e2\u20ac\u0153Cisco Systems, Inc. Copyright 2000\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u0153Configuring VLAN\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u0153Configuring IP\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u0153Configuring CM List\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u0153TFTP Timeout\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u0153Configuring IP\u00e2\u20ac\u009d<\/li>\n<li>\u00e2\u20ac\u00a6 repeat \u00e2\u20ac\u00a6<\/li>\n<\/ul>\n<p>Here\u00e2\u20ac\u2122s the syslog for the \u00e2\u20ac\u0153Configuring IP\u00e2\u20ac\u009d period:<\/p>\n<pre><code>11:44:37 dhcpd: DHCPREQUEST for 10.10.202.71 from 00:18:b9:ff:ff:ff via eth0: ignored (not authoritative).\n11:44:41 dhcpd: DHCPREQUEST for 10.10.202.71 from 00:18:b9:ff:ff:ff via eth0: ignored (not authoritative).\n11:44:49 dhcpd: DHCPREQUEST for 10.10.202.71 from 00:18:b9:ff:ff:ff via eth0: ignored (not authoritative).\n11:45:05 dhcpd: DHCPREQUEST for 10.10.202.71 from 00:18:b9:ff:ff:ff via eth0: ignored (not authoritative).\n11:45:37 dhcpd: DHCPDISCOVER from 00:18:b9:ff:ff:ff via eth0\n11:45:37 dhcpd: DHCPOFFER on 192.168.1.12 to 00:18:b9:ff:ff:ff via eth0\n11:45:37 dhcpd: DHCPREQUEST for 192.168.1.12 (192.168.1.3) from 00:18:b9:ff:ff:ff via eth0\n11:45:37 dhcpd: DHCPACK on 192.168.1.12 to 00:18:b9:ff:ff:ff via eth0<\/code><\/pre>\n<p>It\u00e2\u20ac\u2122s trying for one minute to get a preprogrammed address, 10.10.202.71, then it falls back to DHCPDISCOVER and gets a valid IP for my internal network, \u00e2\u20ac\u0153192.168.1.12\u00e2\u20ac\u009d. My suggestion is to configure your DHCP server to allocate a fixed address to the phone (at least for now).<\/p>\n<p>Even though the phone is booting, you do have access to the settings page (the bottom right button on the cluster above the volume button). On that, you\u00e2\u20ac\u2122ll find menu options for<\/p>\n<ul>\n<li>Contrast<\/li>\n<li>Ring Type<\/li>\n<li>Network Configuration<\/li>\n<li>Status<\/li>\n<\/ul>\n<p><code>Status-&gt;Firmware Versions<\/code> will show you a useful set of data you should note down. Here\u00e2\u20ac\u2122s what I saw.<\/p>\n<pre><code>App Load ID:\n  P0030301MFG2\nBoot Load ID:\n  PC0303010200\nVersion:\n  3.1(MF.G2)\nExpansion Module 1:\n\nExpansion Module 2:<\/code><\/pre>\n<p>My network configuration page was locked, but it did show that <code>10.10.202.71<\/code> address.<\/p>\n<p>On the top settings page there is also a \u00e2\u20ac\u02dcmore\u00e2\u20ac\u2122 option. Under which you\u00e2\u20ac\u2122ll get a \u00e2\u20ac\u0153factory\u00e2\u20ac\u009d option. It\u00e2\u20ac\u2122s not unreasonable to push that. It won\u00e2\u20ac\u2122t do much anyway.<\/p>\n<h2 id=\"tftp\">TFTP<\/h2>\n<p>The \u00e2\u20ac\u0153TFTP Timeout\u00e2\u20ac\u009d isn\u00e2\u20ac\u2122t a surprise as I\u00e2\u20ac\u2122ve not installed a TFTP server. Use whatever you like. I tried the Debian package, <code>tftpd<\/code> first, but found it wasn\u00e2\u20ac\u2122t verbose enough in logs to help debugging. I settled on <code>atftpd<\/code>. Debian defaults this to inetd mode, so you can configure it in <code>\/etc\/inetd.conf<\/code>.<\/p>\n<p>It defaulted to using <code>\/srv\/tftp<\/code> as its root directory. Change this to whatever you\u00e2\u20ac\u2122d like (or just use this default).<\/p>\n<p>Now we need to tell the DHCP server to tell the phone about our TFTP server. I did this by matching on MAC address:<\/p>\n<pre><code>host cisco7940 {\n    hardware ethernet 00:18:b9:ff:ff:ff;\n    fixed-address cisco7940.example.com;\n    option tftp-server-name &quot;192.168.1.3&quot;;\n    next-server 192.168.1.3;\n}<\/code><\/pre>\n<p>Obviously you should put your own TFTP server IP address in this section.<\/p>\n<p>After you\u00e2\u20ac\u2122ve done this, your syslog will show you that the phone is requesting the following files via TFTP:<\/p>\n<pre><code>12:45:17 atftpd[1483]: Serving OS79XX.TXT to 192.168.1.12:52578\n12:45:17 atftpd[1483]: Serving SEP0018B9FFFFFF.cnf.xml to 192.168.1.12:52579\n12:45:17 atftpd[1483]: Serving XMLDefault.cnf.xml to 192.168.1.12:52580\n12:45:17 atftpd[1483]: Serving SEP0018B9FFFFFF.cnf to 192.168.1.12:52581\n12:45:17 atftpd[1483]: Serving SEPDefault.cnf to 192.168.1.12:52582<\/code><\/pre>\n<p>They don\u00e2\u20ac\u2122t exist yet so the phone issues a TFTP error message.<\/p>\n<h2 id=\"firmware\">Firmware<\/h2>\n<p>You\u00e2\u20ac\u2122ll need to find yourself the appropriate firmware. Officially that firmware is only available from Cisco and is copyright. You therefore shouldn\u00e2\u20ac\u2122t go to Google and make any efforts at all to locate it.<\/p>\n<p>The <code>OS79XX.TXT<\/code> file on your TFTP server tells the phone which file it should TFTP-fetch to use as a firmware.<\/p>\n<p>The suggested order of firmware installation is as follows (note, after version 5 the binaries are signed so you will only be able to upgrade to Cisco signed versions):<\/p>\n<ul>\n<li>Version 5: P0S3-05-3-00<\/li>\n<li>Version 8: P003-8-11-00<\/li>\n<\/ul>\n<p>For each, you should edit the <code>OS79XX.TXT<\/code> and fill in the name of the firmware binary without its extension. The phone will use that name to fetch from the TFTP server and will install it:<\/p>\n<ul>\n<li>Edit <code>OS79XX.TXT<\/code><\/li>\n<li>Power up phone<\/li>\n<li>TFTP Download of <code>OS79XX.TXT<\/code><\/li>\n<li>TFTP Download of <code>P0S3-05-3-00.bin<\/code><\/li>\n<li>Mute light lights<\/li>\n<li>All three lights light<\/li>\n<li>Phone self reboots<\/li>\n<\/ul>\n<p>After this I got a different boot logo, \u00e2\u20ac\u0153SIP\u00e2\u20ac\u009d in the top right corner and some different messages and menus. Most notably \u00e2\u20ac\u0153Phone Unprovisioned\u00e2\u20ac\u009d.<\/p>\n<p>Go again\u00e2\u20ac\u00a6<\/p>\n<ul>\n<li>Edit <code>OS79XX.TXT<\/code><\/li>\n<li>Power up phone<\/li>\n<li>TFTP Download of <code>OS79XX.TXT<\/code><\/li>\n<li>TFTP Download of <code>P003-8-11-00.sbn<\/code><\/li>\n<li>Mute light lights<\/li>\n<li>All three lights light<\/li>\n<li>Phone self reboots<\/li>\n<\/ul>\n<p>Now we get the \u00e2\u20ac\u0153Universal Application Loader\u00e2\u20ac\u009d boot page. You can now do a factory reset like this:<\/p>\n<ul>\n<li>Power down phone<\/li>\n<li>Hold \u00e2\u20ac\u02dc#\u00e2\u20ac\u2122<\/li>\n<li>Power up phone<\/li>\n<li>Wait for light cycle to finish<\/li>\n<li>\u00e2\u20ac\u0153Reset sequence detected\u00e2\u20ac\u009d message is shown<\/li>\n<li>Enter <code>'1,2,3,4,5,6,7,8,9,*,0,#'<\/code><\/li>\n<li>You\u00e2\u20ac\u2122ll be offered the option to save network cfg, press \u00e2\u20ac\u02dc2\u00e2\u20ac\u2122 for \u00e2\u20ac\u02dcno\u00e2\u20ac\u2122.<\/li>\n<\/ul>\n<p>The boot then stops with the message \u00e2\u20ac\u0153TFTP file not found\u00e2\u20ac\u009d. Here\u00e2\u20ac\u2122s the syslog. None of these files exist yet in my TFTP directory. Note that the phone is actually looking for the same configuration but starts at configuration specific to itself and works to more generic files.<\/p>\n<pre><code>13:24:01 atftpd[7926]: Serving CTLSEP0018B9FFFFFF.tlv to 192.168.1.12:50367\n13:24:01 atftpd[7926]: Serving SEP0018B9FFFFFF.cnf.xml to 192.168.1.12:50368\n13:24:01 atftpd[7926]: Serving SIP0018B9FFFFFF.cnf to 192.168.1.12:50369\n13:24:01 atftpd[7926]: Serving MGC0018B9FFFFFF.cnf to 192.168.1.12:50370\n13:24:01 atftpd[7926]: Serving XMLDefault.cnf.xml to 192.168.1.12:50371\n13:24:01 atftpd[7926]: Serving SIPDefault.cnf to 192.168.1.12:50372\n13:24:01 atftpd[7926]: Serving MGCDefault.cnf to 192.168.1.12:50373<\/code><\/pre>\n<p>No buttons have any effect at this point. The reason is that the Universal Application Loader is not phone software, it will load phone software from the TFTP server.<\/p>\n<p>We\u00e2\u20ac\u2122ll use <code>XMLDefault.cnf.xml<\/code>. I\u00e2\u20ac\u2122ve deleted the now-unused v5 firmwares, the unused v8 SCCP firmwares and am left with the following in my TFTP directory<\/p>\n<ul>\n<li><code>OS79XX.TXT<\/code><\/li>\n<li><code>P003-8-11-00.bin<\/code><\/li>\n<li><code>P003-8-11-00.sbn<\/code><\/li>\n<li><code>P0S3-8-11-00.loads<\/code><\/li>\n<li><code>P0S3-8-11-00.sb2<\/code><\/li>\n<li><code>XMLDefault.cnf.xml<\/code><\/li>\n<\/ul>\n<p>My <code>XMLDefault.cnf.xml<\/code> contains the following:<\/p>\n<pre><code>&lt;Default&gt;\n  &lt;loadInformation&gt;P0S3-8-12-00&lt;\/loadInformation&gt;\n&lt;\/Default&gt;<\/code><\/pre>\n<p>Which results in<\/p>\n<pre><code>13:52:21 atftpd[7926]: Serving P0S3-8-12-00.loads to 192.168.1.12:50382<\/code><\/pre>\n<p>The <code>P0S<\/code> that this is a SIP firmware. Reboot the phone and the \u00e2\u20ac\u0153Universal Application Loader\u00e2\u20ac\u009d is gone, and we get SIP phone software again. You can use the settings button to check the firmware version. It should now be <code>'P0S3-8-11-00'<\/code> (I originally used v8.12.00 but it stripped the non-alphanumeric characters from the caller IDs, so I\u00e2\u20ac\u2122ve switched to v8.11.00).<\/p>\n<h2 id=\"provisioning\">Provisioning<\/h2>\n<p>The SIP firmware now loaded makes the following TFTP request.<\/p>\n<pre><code>13:53:05 atftpd[7926]: Serving SIPDefault.cnf to 192.168.1.12:50346\n13:53:05 atftpd[7926]: Serving SIP0018B9FFFFFF.cnf to 192.168.1.12:50347<\/code><\/pre>\n<p>These two files are the generic SIP configuration and the per-phone SIP configuration. The following sections give some examples. Your changes for them are your own preference, the main settings are the <code>proxy1_address<\/code> and the <code>line1_xxxx<\/code> settings which you\u00e2\u20ac\u2122ll copy from your Asterisk <code>sip.conf<\/code>.<\/p>\n<h3 id=\"sipdefault.cnf\"><code>SIPDefault.cnf<\/code><\/h3>\n<pre><code># Proxy server address should probably be more accuratly be called\n# the SIP server\nproxy1_address: x.x.x.x\n# proxy_register tell it to connect to the SIP server (why would you\n# want to set this to 0?!\nproxy_register: 1\n\nsntp_server: &quot;pool.ntp.org&quot;\nsntp_mode: unicast\ntime_zone: GMT\ndst_offset: 1\ndst_start_month: March\ndst_start_day_of_week: Sun\ndst_start_week_of_month: 8\ndst_start_time: 01\ndst_stop_month: Oct\ndst_stop_day_of_week: Sun\ndst_stop_week_of_month: 8\ndst_stop_time: 02\ndst_auto_adjust: 1\ntime_format_24hr: 1\ndate_format : D\/M\/Y\n\n# The directory_url contains a URL to the directory XML file\ndirectory_url: &quot;http:\/\/www.example.com\/directory.xml&quot;\n\nmessages_uri: &quot;8500&quot;<\/code><\/pre>\n<h3 id=\"sip0018b9ffffff.cnf\"><code>SIP0018B9FFFFFF.cnf<\/code><\/h3>\n<pre><code># The following lines contain the authenication details\nline1_name: line1\nline1_authname: &quot;line1&quot;\nline1_password: &quot;supersecret&quot;\n# Asterisk overrides this\nline1_displayname: &quot;Caller ID&quot;\n# What to show on screen next to the line button\nline1_shortname: &quot;BUTTONLABEL&quot;<\/code><\/pre>\n<h3 id=\"directory.xml\"><code>directory.xml<\/code><\/h3>\n<pre><code>&lt;CiscoIPPhoneInput&gt;\n    &lt;Title&gt;Phone book&lt;\/Title&gt;\n    &lt;Prompt&gt;Prompt text.&lt;\/Prompt&gt;\n    &lt;URL&gt;http:\/\/www.example.com\/phonebook.pl&lt;\/URL&gt;\n    &lt;InputItem&gt;\n            &lt;DisplayName&gt;search&lt;\/DisplayName&gt;\n            &lt;QueryStringParam&gt;search&lt;\/QueryStringParam&gt;\n            &lt;InputFlags&gt;&lt;\/InputFlags&gt;\n            &lt;DefaultValue&gt;&lt;\/DefaultValue&gt;\n    &lt;\/InputItem&gt;\n&lt;\/CiscoIPPhoneInput&gt;\n\n&lt;CiscoIPPhoneDirectory&gt;\n&lt;Title&gt;Directory&lt;\/Title&gt;\n&lt;Prompt&gt;Who you gonna call?&lt;\/Prompt&gt;\n&lt;DirectoryEntry&gt;\n     &lt;Name&gt;Tom&lt;\/Name&gt;\n     &lt;Telephone&gt;6905&lt;\/Telephone&gt;\n&lt;\/DirectoryEntry&gt;\n&lt;DirectoryEntry&gt;\n     &lt;Name&gt;Dick&lt;\/Name&gt;\n     &lt;Telephone&gt;6906&lt;\/Telephone&gt;\n&lt;\/DirectoryEntry&gt;\n&lt;\/CiscoIPPhoneDirectory&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are a number of guides out on the Internet for getting Cisco phones working with Asterisk. I didn\u00e2\u20ac\u2122t particularly find any of them 100% thorough. This then is my guide, documenting the moment I ordered the phone to the moment I made a call on it. I bought a Cisco 7940 phone from eBay.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.fussylogic.co.uk\/blog\/?p=792\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[31,43,6],"_links":{"self":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/792"}],"collection":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=792"}],"version-history":[{"count":12,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/792\/revisions"}],"predecessor-version":[{"id":836,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/792\/revisions\/836"}],"wp:attachment":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}