hbonath
Guru
- Joined
- Jan 24, 2012
- Messages
- 150
- Reaction score
- 40
Hey guys -
I recently started looking into Cisco SPA Phones as an alternative to Aastra, mostly due to the Pain in the Ass factor with the Aastra XML scripts, plus the fact that the Aastra Phones do not have a built-in jitterbuffer. This seems to be killing us as a hosted PBX provider, being at the mercy of the quality of the customers ISP.
These Cisco phones are very affordable, seem to work well even on less than ideal connections, and have a good overall feel, despite being made in China =) The handset on my SPA525G seems to be almost exactly the same as the one Cisco uses on the 7960G, minus the LED pipe. And it fits in the ear-to-shoulder position well!
These were relatively easy to set up, using OSS EPM, and with a few tweaks to the base template, I was up and running.
The one thing I missed, of course, was the XML Scripts.
Cisco provides a few of these that you can install and play with:
https://supportforums.cisco.com/document/67056/cisco-spa-xml-services-asterisk-environments
However the 2 I really wanted were Directory and Parking Lot.
So I figured I would give it a go - how hard could it be, right?
I first started with trying to adapt the Aastra scripts to simply output Cisco XML, however my lack of being a developer really put a wrench in my efforts.
So Ultimately, I ended up putting together a simple Directory script that pulls the username/extension from the asterisk database and outputs it in Cisco Directory XML format for the phone to interpret. Basic, but works.
Next for the Parking lot - using some of the ideas I gleaned from the Aastra scripts, I implemented this one using Bash of all things, called from cgi-bin. (Can you tell I'm a sysadmin and not a developer?)
This one performs a similar function, however uses bash to call Asterisk CLI commands and interprets the results, then outputs any currently parked calls with park slot number, and caller-id name in the same Cisco Directory XML format, since the phone has built-in softkeys for selecting and dialing to "pick-up" parked calls.
I'd love to have some community feedback on these, as well as to share my efforts with the greater community - so I have posted these scripts on GitHub: https://github.com/hbonath/ciscospaxml
I would also like to know if anyone has any input on the security of using the CGI method, I would think that this should be pretty secure since it doesn't really take any outside arguments. However I'm definitely not a security expert!
These scripts need to be mapped as programmable softkeys on the SPA Phones:
First you need to define some PSK's:
Then you would set your Idle key list to display your softkeys when the phone is idle: (note the psk entries that would match your definitions)
Finally, I also gleaned a couple other bits from the internets that help solve a couple other challenges I had with this phone:
DND - Like pretty much any IP phone, when you press the DND key it uses a built-in function of the phone to reject any SIP INVITEs with a BUSY reply. However I wanted to see a DND that would both set the screen, and also tell Asterisk that the phone is on DND so that hints get updated for anyone that would be monitoring BLF.
I found a PSK definition on the Cisco Forums that will dial the *78/*79 codes plus update the local DND which will display that the phone is on DND on the screen.
Park - Aside from retreiving calls which are parked via XML, I needed a way to park a call and I didn't want to tie up one of the Line keys on the right of the phone with a bunch of "Speed-Dial/Xfer" functions.
This one adds the PSK to the screen when in-call (Connected state) which is basically a Speed-Dial/Xfer, however it adds a setting that will allow for the end user to hear the park slot before the call disappears.
I hope that this is something of use to the community, and again - would love to get some feedback on some of the security-type stuff.
-Henry
I recently started looking into Cisco SPA Phones as an alternative to Aastra, mostly due to the Pain in the Ass factor with the Aastra XML scripts, plus the fact that the Aastra Phones do not have a built-in jitterbuffer. This seems to be killing us as a hosted PBX provider, being at the mercy of the quality of the customers ISP.
These Cisco phones are very affordable, seem to work well even on less than ideal connections, and have a good overall feel, despite being made in China =) The handset on my SPA525G seems to be almost exactly the same as the one Cisco uses on the 7960G, minus the LED pipe. And it fits in the ear-to-shoulder position well!
These were relatively easy to set up, using OSS EPM, and with a few tweaks to the base template, I was up and running.
The one thing I missed, of course, was the XML Scripts.
Cisco provides a few of these that you can install and play with:
https://supportforums.cisco.com/document/67056/cisco-spa-xml-services-asterisk-environments
However the 2 I really wanted were Directory and Parking Lot.
So I figured I would give it a go - how hard could it be, right?
I first started with trying to adapt the Aastra scripts to simply output Cisco XML, however my lack of being a developer really put a wrench in my efforts.
So Ultimately, I ended up putting together a simple Directory script that pulls the username/extension from the asterisk database and outputs it in Cisco Directory XML format for the phone to interpret. Basic, but works.
Next for the Parking lot - using some of the ideas I gleaned from the Aastra scripts, I implemented this one using Bash of all things, called from cgi-bin. (Can you tell I'm a sysadmin and not a developer?)
This one performs a similar function, however uses bash to call Asterisk CLI commands and interprets the results, then outputs any currently parked calls with park slot number, and caller-id name in the same Cisco Directory XML format, since the phone has built-in softkeys for selecting and dialing to "pick-up" parked calls.
I'd love to have some community feedback on these, as well as to share my efforts with the greater community - so I have posted these scripts on GitHub: https://github.com/hbonath/ciscospaxml
I would also like to know if anyone has any input on the security of using the CGI method, I would think that this should be pretty secure since it doesn't really take any outside arguments. However I'm definitely not a security expert!
These scripts need to be mapped as programmable softkeys on the SPA Phones:
First you need to define some PSK's:
Code:
<PSK_8>
fnc=xml;url=http://your-pbx.com/cisco/directory/spadir.php;nme=Directory
</PSK_8>
<PSK_10>
fnc=xml;url=http://your-pbx.com/cgi-bin/parkinglot;nme=Parking
</PSK_10>
Code:
<Idle_Key_List group="Phone/Programmable_Softkeys">
em_login|1;acd_login|1;acd_logout|1;astate|2;avail|3;unavail|3;redial|5;psk8|6;cfwd|7;psk1|8;psk7|9;psk9|10;psk10|11;lcr|12;pickup|13;gpickup|14;unpark|15;em_logout
</Idle_Key_List>
Finally, I also gleaned a couple other bits from the internets that help solve a couple other challenges I had with this phone:
DND - Like pretty much any IP phone, when you press the DND key it uses a built-in function of the phone to reject any SIP INVITEs with a BUSY reply. However I wanted to see a DND that would both set the screen, and also tell Asterisk that the phone is on DND so that hints get updated for anyone that would be monitoring BLF.
I found a PSK definition on the Cisco Forums that will dial the *78/*79 codes plus update the local DND which will display that the phone is on DND on the screen.
Code:
<!-- DND with Asterisk -->
<PSK_1 group="Phone/Programmable_Softkeys">fnc=sd;ext=*78;nme=DND;ext2=*79;nme2=ClearDND</PSK_1>
<DND_Act_Code group="Regional/Vertical_Service_Activation_Codes">*78</DND_Act_Code>
<DND_Deact_Code group="Regional/Vertical_Service_Activation_Codes">*79</DND_Deact_Code>
<Service_Annc_Base_Number group="Regional/Vertical_Service_Announcement_Codes">*7</Service_Annc_Base_Number>
<Service_Annc_Extension_Codes group="Regional/Vertical_Service_Announcement_Codes">DDT:8;DDF:9</Service_Annc_Extension_Codes>
<DND_Serv group="Phone/Supplementary_Services">Yes</DND_Serv>
<Service_Annc_Serv group="Phone/Supplementary_Services">Yes</Service_Annc_Serv>
<!-- /DND with Asterisk -->
Park - Aside from retreiving calls which are parked via XML, I needed a way to park a call and I didn't want to tie up one of the Line keys on the right of the phone with a bunch of "Speed-Dial/Xfer" functions.
This one adds the PSK to the screen when in-call (Connected state) which is basically a Speed-Dial/Xfer, however it adds a setting that will allow for the end user to hear the park slot before the call disappears.
Code:
<!-- PARK with Asterisk -->
<Connected_Key_List group="Phone/Programmable_Softkeys">
psk2|1;endcall|2;conf|3;xfer|4;crdstart;crdstop;bxfer;confLx;xferLx;park;phold;flash;
</Connected_Key_List>
<Keep_Referee_When_REFER_Failed group="SIP/SIP_Parameters">Yes</Keep_Referee_When_REFER_Failed>
<PSK_2 group="Phone/Programmable_Softkeys">fnc=sd;ext=70@$PROXY;vid=1;nme=Park</PSK_2>
<!-- /PARK with Asterisk -->
I hope that this is something of use to the community, and again - would love to get some feedback on some of the security-type stuff.
-Henry