login | register
Sun 07 of Sep, 2008 [10:24 UTC]

voip-info.org

Asterisk Presence for Cisco 79x1 Phones

Created by: daroz,Last modification on Tue 12 of Aug, 2008 [05:07 UTC] by brighton36

Asterisk Presence for Cisco 79x1 Phones


Newer Cisco IP Phones such as the 7941, 7961, and 7971 now support BLF or presence information for speed dial numbers. Unfortunately, configuring the phones for this to work is not easy, nor straightforward.

To get BLF working on the Cisco phones:
  • The phone must be configured for a Call Manager server. (Though you don't actually need one)
This means setting your SIPDefault.cnf as so:
 
         call_manager1_addr: "server.address.here"
         # You may also want to add the speed dial entries to your SIP000XXXXXXX.cnf files:
         speed_line2: "50"
         speed_label2: "Employee A"
         speed_line3: "51"
         speed_label3: "Employee B"
         speed_line4: "52"
         speed_label4: "Lunch Room"


To accomplish this with Asterisk:
  • You need to implement a TCP2UDP SIP proxy or use the SIP TCP patch
  8/12: The instructions used by a_lemin on http://www.trixbox.org/forums/trixbox-forums/open-discussion/tcp-sip-asterisk-1-4 worked well for me on my Hardy Heron Server build.
  • The Asterisk code needs to be patched to send a different content type for NOTIFY then is asked for.
    • Find the string else if (strstr(accept, "application/pidf+xml") in chan.sip.c and add || strstr(p->useragent, "Cisco-CP7961G/8.0")) following it but before the {. Use the correct user agent for your phones, this is for the 7961. You can add this multiple times for different phones.
8/12 Note, Mine looked like this:
  } else if ( (strstr(accept, "application/pidf+xml")) || (strstr(p->useragent, "Cisco-CP7961G/8.0")) ) { 

    • If you've patched in support for SIP TCP it should be around line 11623.
  • The Asterisk code needs to be patched to send the NOTIFY in the correct format. This may have an adverse effect on other phones, if you run a mix of phones you'll need to test these changes.
    • The pdfstate variables in the transmit_state_notify function need to return on-the-phone when the device is in use (On The Phone) or the Cisco phones won't turn on the light. In the switch for state set the pdfstate variable to on-the-phone in both the AST_EXTENSION_INUSE and AST_EXTENSION_BUSY cases. In a SIP TCP patched chan_sip.c file this will be around line 5581.
8/12 Note, Mine looked like this:
 case AST_EXTENSION_INUSE:
                statestring = "confirmed";
                local_state = NOTIFY_INUSE;
                pidfstate = "on-the-phone"; //"busy";
                pidfnote = "On the phone";
                break;
        case AST_EXTENSION_BUSY:
                statestring = "confirmed";
                local_state = NOTIFY_CLOSED;
                pidfstate = "on-the-phone"; //"busy";
                pidfnote = "On the phone";
                break;

    • When the XML is built it's format is not one the Cisco phone seems to parse correctly. In the switch block for p->subscribed the PIDF_XML case needs to be replaced. In a SIP TCP patched chan_sip.c this is around line 5667. Use this chunk of code in it's place:

       case PIDF_XML:
               ast_build_string(&t, &maxbytes, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
               ast_build_string(&t, &maxbytes, "\n", mfrom); ast_build_string(&t, &maxbytes, "<dm:person>\n"); if (pidfstate[0] == '-') /* Busy? Still open ... */ ast_build_string(&t, &maxbytes, "<status><basic>open</basic></status>\n"); else ast_build_string(&t, &maxbytes, "<status><basic>%s</basic></status>\n", (local_state != NOTIFY_CLOSED) ? "open" : "closed"); ast_build_string(&t, &maxbytes, "<e:activities>"); if (pidfstate[0] != '-') ast_build_string(&t, &maxbytes, "<e:%s/>", pidfstate); ast_build_string(&t, &maxbytes, "</e:activities>\n"); ast_build_string(&t, &maxbytes, "</dm:person>\n"); //ast_build_string(&t, &maxbytes, "<tuple id=\"%s\">\n", p->exten); /* Tuple start */ ast_build_string(&t, &maxbytes, "<tuple id=\"cisco-cme\">\n"); if (pidfstate[0] == '-') /* Busy? Still open ... */ ast_build_string(&t, &maxbytes, "<status><basic>open</basic>\n"); else ast_build_string(&t, &maxbytes, "<status><basic>%s</basic>\n", (local_state != NOTIFY_CLOSED) ? "open" : "closed"); ast_build_string(&t, &maxbytes, "<e:activities>"); if (pidfstate[0] != '-') ast_build_string(&t, &maxbytes, "<e:%s/>", pidfstate); ast_build_string(&t, &maxbytes, "</e:activities>\n"); ast_build_string(&t, &maxbytes, "</status>\n"); ast_build_string(&t, &maxbytes, "</tuple>\n"); ast_build_string(&t, &maxbytes, "\n");
               break;

See also


Comments

Comments Filter
222

333Re: SIP/TCP

by brighton36, Tuesday 12 of August, 2008 [06:27:29 UTC]
I'm in the same boat - it was difficult, but I got everything else seemingly to work. I can see asterisk listening on 5060/tcp . I tried iptables REJECT'ing inbound 5060/udp from the phone as an attempt to get it to work and that wasn't fruitful...
222

333SIP/TCP

by Helix26404, Tuesday 18 of December, 2007 [06:25:00 UTC]
I am using this info as a guide for getting the BLF to work on my 7970s, and I cannot figure out how to force the 7970 to connect with SIP/TCP. I have successfully patched chan_sip and have set up each extension for TCP transport, but it will not use TCP. Is there a change that needs to be made in the config files? Or a way to force Asterisk to use TCP instead of UDP?
222

333BLF doesn't work......

by fantub, Monday 17 of September, 2007 [09:26:04 UTC]
HEllo,
I have a Cisco 7970 with SIP70.8-0-2SR1S firmware.
How can I do for making its BLF Lamp work ?
Anybody can send me a configuration example for SEP<macaddress>.cnf.xml file?