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)
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"
- The phone must connect to the phone server using SIP/TCP
- The server must respond to the SUBSCRIBE request with a content type of application/pidf+xml even though the SUBSCRIBE request lists application/cpim-pidf+xml.
- The body of the NOTIFY should be in this format: http://www.cisco.com/en/US/products/sw/voicesw/ps4625/products_feature_guide09186a0080663f65.html#wp1393393 (Look at the trace output)
To accomplish this with Asterisk:
- You need to implement a TCP2UDP SIP proxy or use the SIP TCP patch
- 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.
} 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.
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, "
break;
Comments
333Re: SIP/TCP
333SIP/TCP
333BLF doesn't work......
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?