TUTORIAL Polycom scripts

ErikU

Guru
Joined
Mar 16, 2008
Messages
181
Reaction score
6
Location
Seattle, WA
I have been using Polycom phones for a while now and really like the build quality and sound quality. I personally think they are superior SIP phones (yes, I have used and programmed the competing phones too).

In the past, Polycom had been known for not supporting Asterisk very well, and for not documenting button scripting, XML scripts, etc. This has changed. It seems they have been making an effort to open up the documentation and it improves quite a bit on every rev.

At this point I have a production system with several different Polycom phones running in an office and have scripted them to allow for commonly requested office PBX features. I'm not a programmer, but I can hack my way through scripts. I'm posting some of what I have learned here. Feel free to modify or improve this info any way you can... just share.

- Polycom has pretty good documentation here:
http://www.polycom.com/support/voice/soundpoint_ip/soundpoint_ip560.html

- They have a tech note for common asterisk features here:
http://knowledgebase.polycom.com/kb/search.do?cmd=displayKC&docType=kc&externalId=EndUser-TechAlerts-Audio-UsingSPIPSSIPAsteriskTB43565pdf&sliceId=pdfPage_1&dialogID=3333079&stateId=0%200%203331133

Take a good look at this document and the others in the tech bulletin area.

Of note is the info about setting up presence info for other stations (BLF).

Paging and intercom work fine as described with minor modifications.

Call parking, paging, intercom, transfer and night ring etc. can all be setup as a soft keys that change based on call context.

My example extension.cfg file:
http://www.erikutter.com/misc/polycom/phone100.cfg

My example sip.cfg file:
http://www.erikutter.com/misc/polycom/sip.cfg

My example directory.cfg file:
http://www.erikutter.com/misc/polycom/directory.xml


extension.cfg: (for a polycom 560)

Basic stuff in here with server registration info.

In this example I have the reception desk phone. We force the ring type to 5 so that you always get a "double" ring to indicate a call from another internal extension. We set the line keys for the 1st registration to 4 so that we can use the other two line keys for something else. (for user desk phones I set it to 2 so that I have four keys available for something else). I have also setup the MWI 1 line to work with asterisk.

sip.cfg:
I have set the AlertInfo lines so that a call from an outside line will force a regular ring. (route Alert Info set to External). An orphaned parked call will force a high double ring, and an intercom or page will force a auto-answer. Now all internal calls will double ring (phone default) and outside calls will regular ring.

Set the dialplan for whatever you prefer. In my case, my client doesn't want to dial 9 to get an outside line. It's easy to change though and Polycom supports a second dialtone after dialing 9 (9,xxx in the dialplan).

I setup a nice display bacground with the company logo address etc. You could have a static or active XML web page on the background. In the future I will setup an active background that also shows parked calls and outdoor temp. Maybe someone wants to help with the programming here...

Various features need to be enabled or disabled to make everything work. You can look at what I did.

Down toward the bottom of the sip.cfg is the fun stuff.. the softkeys and feature keys. Esentially they are setup to do the following based on call context:

- When the phone is idle you get: PageAll, Intercom, NewCall, Callers, forward, buddies, and NightRing.
- When on a call you get Park, and BlindXfer

I think it's pretty obvious how the programming works here and can be tuned for your feature codes.

- Unprogrammed line keys have been mapped to "speed dials" The speed dials are set in the directory.xml file. If the BW (buddy-watch) field is active you get BLF's (the light and icon will indicate status) that look at the Asterisk hints for status. This is a great way to have buttons for other extensions that will light up when they are in use. What I have done with the reception desk is create Park buttons that can be used to quickly park a call and monitor if it has been picked up. With an extension panel you could have as many of these buttons as you like. I also programmed a night ring button on the receptionist phone so that you can tell at-a-glance if night ring is active.

- I have set the microbrowser to point to a machine that serves up the following basic apps:
- List all parked calls
- Display news
- Display weather
- Display the ferry schedule

Since I'm not too good with PHP these are mostly hacks from other applications I have found surfing around. I did have visual voicemail working fine, but the company doesn't use VM any more. They prefer all VM to be emailed.

You can download a zip of the apps here:
http://www.erikutter.com/misc/polycom/apps.zip
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,154
Reaction score
2,632
Eric's applications also are attached here in case you have trouble downloading from his site.
 

Attachments

th2112

New Member
Joined
May 7, 2009
Messages
20
Reaction score
0
I know this is a old post, but Does anyone know or have these scripts running on a polycom phone? The parked call script is what I am looking for. When I tried it it locks up my PBXF server and reported back errors in the script.
 

ErikU

Guru
Joined
Mar 16, 2008
Messages
181
Reaction score
6
Location
Seattle, WA
The apps linked in my original post are still working fine for me. The first app lists parked calls and shows status of peers. It would be easy to extract just the parked calls if that's all you needed.

-Erik
 

th2112

New Member
Joined
May 7, 2009
Messages
20
Reaction score
0
Erik, I was able to get this working after a few trys. The only problem I have is i am getting logs like below

[2011-10-02 18:51:57] ERROR[7370] utils.c: fwrite() returned error: Broken pipe
[2011-10-02 18:51:57] ERROR[7370] utils.c: fwrite() returned error: Broken pipe

over and over, they just fill up my logs. I am using ver 1.6. I know 1.6 changed the pipe | to a comma. I tried replacing the line in the script that used a pipe symble with a comma. My logs stop with the errors, but it kills the script. nothing shows up on the phone. Any ideas?
 

ErikU

Guru
Joined
Mar 16, 2008
Messages
181
Reaction score
6
Location
Seattle, WA
I afraid to say that I know more about Ploycom phone programming than scripting. I can tell you that I haven't had any issue with that kind of error.

Which script are you trying to use?
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
77
This error is not really related to the scripts. Yes they technically use utils.c (through PHP) but this is really a php corruption problem you are having. Broken pipe means that fwrite can't write to the resource. It doesn't refer to asterisk pipes at all.

What script are you trying to access when you get these errors.

The line you changed is line 67. Again you are changing php scripting, this is NOT asterisk scripting. You can't put commas in a compare string as a substitute for a OR statement

Erik, I was able to get this working after a few trys. The only problem I have is i am getting logs like below

[2011-10-02 18:51:57] ERROR[7370] utils.c: fwrite() returned error: Broken pipe
[2011-10-02 18:51:57] ERROR[7370] utils.c: fwrite() returned error: Broken pipe

over and over, they just fill up my logs. I am using ver 1.6. I know 1.6 changed the pipe | to a comma. I tried replacing the line in the script that used a pipe symble with a comma. My logs stop with the errors, but it kills the script. nothing shows up on the phone. Any ideas?
 

th2112

New Member
Joined
May 7, 2009
Messages
20
Reaction score
0
The script is Erik's Parked call script. This show what calls are parked on the polycom screen. Everything seems to be working fine with the exception on the errors taking my logs. the script I was editing was the PHP script of erik's I since have changed it back to the orig. script since it did not make a difference.
 

dudbug

New Member
Joined
Sep 25, 2013
Messages
11
Reaction score
1
I have been using Polycom phones for a while now and really like the build quality and sound quality. I personally think they are superior SIP phones (yes, I have used and programmed the competing phones too).

In the past, Polycom had been known for not supporting Asterisk very well, and for not documenting button scripting, XML scripts, etc. This has changed. It seems they have been making an effort to open up the documentation and it improves quite a bit on every rev.

At this point I have a production system with several different Polycom phones running in an office and have scripted them to allow for commonly requested office PBX features. I'm not a programmer, but I can hack my way through scripts. I'm posting some of what I have learned here. Feel free to modify or improve this info any way you can... just share.

- Polycom has pretty good documentation here:
http://www.polycom.com/support/voice/soundpoint_ip/soundpoint_ip560.html

- They have a tech note for common asterisk features here:
http://knowledgebase.polycom.com/kb/search.do?cmd=displayKC&docType=kc&externalId=EndUser-TechAlerts-Audio-UsingSPIPSSIPAsteriskTB43565pdf&sliceId=pdfPage_1&dialogID=3333079&stateId=0 0 3331133

Take a good look at this document and the others in the tech bulletin area.

Of note is the info about setting up presence info for other stations (BLF).

Paging and intercom work fine as described with minor modifications.

Call parking, paging, intercom, transfer and night ring etc. can all be setup as a soft keys that change based on call context.

My example extension.cfg file:
http://www.erikutter.com/misc/polycom/phone100.cfg

My example sip.cfg file:
http://www.erikutter.com/misc/polycom/sip.cfg

My example directory.cfg file:
http://www.erikutter.com/misc/polycom/directory.xml


extension.cfg: (for a polycom 560)

Basic stuff in here with server registration info.

In this example I have the reception desk phone. We force the ring type to 5 so that you always get a "double" ring to indicate a call from another internal extension. We set the line keys for the 1st registration to 4 so that we can use the other two line keys for something else. (for user desk phones I set it to 2 so that I have four keys available for something else). I have also setup the MWI 1 line to work with asterisk.

sip.cfg:
I have set the AlertInfo lines so that a call from an outside line will force a regular ring. (route Alert Info set to External). An orphaned parked call will force a high double ring, and an intercom or page will force a auto-answer. Now all internal calls will double ring (phone default) and outside calls will regular ring.

Set the dialplan for whatever you prefer. In my case, my client doesn't want to dial 9 to get an outside line. It's easy to change though and Polycom supports a second dialtone after dialing 9 (9,xxx in the dialplan).

I setup a nice display bacground with the company logo address etc. You could have a static or active XML web page on the background. In the future I will setup an active background that also shows parked calls and outdoor temp. Maybe someone wants to help with the programming here...

Various features need to be enabled or disabled to make everything work. You can look at what I did.

Down toward the bottom of the sip.cfg is the fun stuff.. the softkeys and feature keys. Esentially they are setup to do the following based on call context:

- When the phone is idle you get: PageAll, Intercom, NewCall, Callers, forward, buddies, and NightRing.
- When on a call you get Park, and BlindXfer

I think it's pretty obvious how the programming works here and can be tuned for your feature codes.

- Unprogrammed line keys have been mapped to "speed dials" The speed dials are set in the directory.xml file. If the BW (buddy-watch) field is active you get BLF's (the light and icon will indicate status) that look at the Asterisk hints for status. This is a great way to have buttons for other extensions that will light up when they are in use. What I have done with the reception desk is create Park buttons that can be used to quickly park a call and monitor if it has been picked up. With an extension panel you could have as many of these buttons as you like. I also programmed a night ring button on the receptionist phone so that you can tell at-a-glance if night ring is active.

- I have set the microbrowser to point to a machine that serves up the following basic apps:
- List all parked calls
- Display news
- Display weather
- Display the ferry schedule

Since I'm not too good with PHP these are mostly hacks from other applications I have found surfing around. I did have visual voicemail working fine, but the company doesn't use VM any more. They prefer all VM to be emailed.

You can download a zip of the apps here:
http://www.erikutter.com/misc/polycom/apps.zip
Thanks Erik, this is good stuff.
 

Members online

No members online now.

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,373
Messages
137,422
Members
14,576
Latest member
emmonks