Polycom auto-answer config
Polycom auto-answer config
This page details the necessary settings needed to make your Polycom Soundpoint IP500/600 automatically pick up a phone call placed to it with no user interaction.
You need the latest version of both the SIP software and bootrom to do it (see Polycom Phones for a link).
The latest version of software provides for distinctive ring tones just like the Cisco 7960's have. It also provides for auto answer. It's kind of tricky to do, but you can make your phones auto answer by setting the Alert-Info variable in Asterisk and messing with the XML configuration files, sip.cfg and ipmid.cfg.
In the sip.cfg file, look for the line with these variables:
<alertInfo voIpProt.SIP.alertinfo.1.value="Sales"
voIpProt.SIP.alertInfo.1.class="8"...>
In this real-world example, whenever I set ALERT_INFO to "Sales" in Asterisk, the Polycom matches on that word and calls up class 8 in ipmid.cfg.
In ipmid.cfg, my class 8 line looks like this:
<SALES se.rt.8.name="Sales" se.rt.8.type="ring" se.rt.8.ringer="11"
se.rt.8.callWait="6" se.rt.8.mod="0">
se.rt.8.type="ring" tells the Polycom phone which type of ring to use - which in this case is a regular ring and se.rt.8.ringer="11" tells the phone to ring with ringtone 11 with is the Triplet. I use this one for signaling a new incoming sales call to one of my three sales guys. The secretary transfers it to the sales department and their lines ring with the Triplet. I feel like Pavlov whenever I hear it.
The other ring types are visual, answer and ring-answer. The one you want is ring-answer. Here's how I do it: again in sip.cfg (actually part of the same line listed above)
...voIpProt.SIP.alertinfo.2.value="Ring Answer"
voIpProt.SIP.alertInfo.2.class="4"...>
and in ipmid.cfg (I just modified one of the existing ones to give me a High Double Trill ringtone):
<RING_ANSWER se.rt.4.name="Ring Answer" se.rt.4.type="ring-answer"
se.rt.4.timeout="1000"... se.rt.4.ringer="7"...>
The se.rt.4.timeout="1000" tells the Polycom to ring for 1000 milliseconds (one second) and then answer.
I call it in Asterisk by setting the ALERT_INFO variable to "Ring Answer" whenever anybody pushes 8 plus the extension. It rings in to the extension and voila, I'm on speaker!
By the way, for all you BOFH out there, you could actually use this feature as a somewhat surreptitious eavesdropping device by using a silent ring and a visual type. The phone would answer without any indication except on the console. I haven't tried this myself and if you do this, I don't want to know about it... unless I'm in your office at the time.
These tips have been implemented in my Polycom configuration files:
http://www.krisk.org/asterisk/pcom/
I found that using SetVar(RING_ANSWER="Auto Answer") did not send anything in the sip headers.
Instead I got the above to work by using this in my dial plan:
SIPAddHeader(Alert-Info: Ring Answer)
I changed allcall.agi to work with 1.2.0 and hopefully to be a little more flexible. In addition I added a hangup-page.agi that will hangup extensions in the meetme when the originating caller hangs up.
allcall.agi
hangup-page.agi
My relavent extensions.conf:
[app-system-page]
exten => *74,1,Goto(app-system-page-impl,s,1)
[app-system-page-impl]
; The first variable is the originating caller, the others are phones I
; wish to exclude from the system-wide paging. (Not everybody likes to
; be bothered, don't you know?) The form of the variable
; is SIP/EXT - For example, ${EX-DESIGN} = SIP/7013
exten => s,1,NoOp,${CALLERIDNUM}
exten => s,n,AGI,allcall.agi|SIP/${CALLERIDNUM} ${PAGE_EXCLUDE}
exten => s,n,Wait(1)
exten => s,n,Playback(beep)
exten => s,n,MeetMe(9999,dq)
exten => s,n,Playback(beep)
exten => s,n,Hangup
exten => t,1,Hangup
exten => T,1,Hangup
exten => h,1,NoOp(Hungup from page ${UNIQUEID})
exten => h,n,DeadAGI(hangup-page.agi)
[app-page]
exten => start,1,SetVar(ALERT_INFO="Ring Answer")
exten => start,n,MeetMe(9999,dmq)
exten => start,n,Hangup
exten => t,1,Hangup
exten => T,1,Hangup
The DeadAgi(hangup-page.agi) will hangup the listening phones when the paging phone is hungup. If you change the MeetMe room number (9999) in extensions be sure to change it in hangup-page.agi as well.
Integrating Polycom phones with SugarCRM
SugarCRM has a nifty add-in from VoiceRD http://www.sugarforge.org/projects/asterisk-int which integrates Asterisk with SugarCRM. The add-in allows the user to click the phone number of a contact and have a call placed to that contact. However, the Polycom requires you answer the call first, then the second leg is placed. This becomes somewhat tedious after the first few calls.
Since the polycom does not allow you to turn on auto-answer, there is no simple way to achieve this. The config example below gets it done.
Polycom
The config file macaddress-phone.cfg should contain the following
<alertInfo
voIpProt.SIP.alertInfo.1.class="3"
voIpProt.SIP.alertInfo.1.value="RANR"
/>
to enable the auto-answer. This is a global parameter so it cannot be enabled for one extension only.
SugarCRM
The open source add-in from VoiceRD http://www.sugarforge.org/projects/asterisk-int
will add an icon next to the number of the contact. Clicking that icon will place a call, first to your extension, then to the number.
The admin configures asterisk with the Asterisk Context: "sugar"
Each user is configured like this:
For a user on a sip extension 500
Asterisk Phone Extension: Local/500
On the pbx, the context sugar is added
[sugar]
exten => s,1,Answer
exten => s,n,NoOp(Context: Sugar)
exten => s,n,SIPAddHeader(Alert-Info: RANR)
include => default
default should give access to the extensions. Adapt to your own setup.


Comments
333MULTIPLE INBOUND CALLS
but if 2 lines are ringing this works fine!
This really messes thnigs up if your attempting to force call for say an ACD system. Considering Polycom 650's are meant to support up to what 32 lines or so I'd like to have thought they'd have considered allowing the ability to priorities these lines to allow this functionality to work.
That is unless I'm completely wrong and there is a setting that allows line or call priority? If anyone knows they'd save my life :-)
333
333enable auto answer in ipphone and ata
333
Here is how I did my intercom setup for my polycom 501 phones:
First, in your bootserver config, you should have a common config file that all of your phones load from their corresponding 0000000000.cfg (MAC Address) file, see <a href="http://www.voip-info.org/wiki/view/Asterisk@Home+Handbook+Wiki+Chapter+7#722Polycom">Asterisk@Home Chapter 7</a>. They call theirs aaps-settings.cfg, I call mine site.cfg. Here is what my site.cfg looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<localcfg>
<server voIpProt.server.1.address="192.168.0.5"/>
<SIP>
<outboundProxy voIpProt.SIP.outboundProxy.address="192.168.0.5"/>
<sound_effects>
<ringType>
<RING_ANSWER se.rt.4.name="Ring Answer" se.rt.4.type="ring-answer"
se.rt.4.timeout="500" se.rt.4.ringer="2" se.rt.4.callWait="6" se.rt.4.mod="1"/>
</ringType>
</sound_effects>
<alertInfo voIpProt.SIP.alertInfo.2.value="Ring Answer" voIpProt.SIP.alertInfo.2.class="4"/>
</SIP>
<voice>
<volume voice.volume.persist.handset="1" voice.volume.persist.headset="1"/>
</voice>
<PHONE_CONFIG>
<OVERRIDES dialplan.digitmap=""/>
</PHONE_CONFIG>
</localcfg>
Last, add this block into /etc/asterisk/extensions.conf:
; ########################################
; # karl's polycom auto-answer intercom
; ########################################
polycom-aa-intercom
exten => _01-3XX,1,SIPAddHeader(Alert-Info: Ring Answer)
exten => _01-3XX,2,Dial(sip/${EXTEN:1:3})
exten => _01-3XX,3,Hangup
exten => _01-3XX,102,Hangup
Add this into the from-internal block of extensions.conf:
include => polycom-aa-intercom
Hope this helps!
333Auto-Answer page calls
Did anyone get the auto-answer to work with Broadworks??
I have tried this fix on both SP501 and SP301. I set:
voIpProt.SIP.alertInfo.5.value="auto-answer" voIpProt.SIP.alertInfo.5.class="3",
When you call, *50ext#, the call is automatically picked up, but no sound comes out the speaker. After such call is done - All phones in the group disassociate with the server for 1-2 minutes.
Any help would be greatly appriciated. thank you in advance.
Alex.
333Re: Update for SIP 1.6???
just search se.rt in sip.cfg
althoug i would use se.rt.4.timeout=100 instead of 1000.
but thanks to Brian's comment mine works great.
333Update for SIP 1.6???
333My Recipe
We've got 3 things going on with setting up Auto Answer and Ring Answer. Let's detail this process from beginning to end using Ring Answer as our example. (Auto Answer isn't much different except you want to make sure step #2 below goes to class 3 rather than 4, and that class 3 is set up as described elsewhere which is the same as the one in the ipmid.cfg file from krisk.org.)
1. First, use the SIPAddHeader() directive in Asterisk to properly alert the phone. In my situation, I have 10 phones with 2-digit extensions. I want to call each phone by prefixing the extension with a "1" in order to activate the intercom. For example, if I dial 126 I want it to put extension 26 on speakerphone. So go into extensions.conf and make sure you create a new section like this:
icm-auto-answer
;intercom
exten => _12x,1,SIPAddHeader(Alert-Info: Ring Answer)
exten => _12x,2,Dial(sip/${EXTEN:1:3})
exten => _12x,3,Hangup
exten => _12x,102,Hangup
Then make sure in your from-internal section of extensions.conf you have a include => icm-auto-answer
2. Okay, see how the SIPAddHeader includes "Ring Answer"? That word or words will be matched by alertInfo in sip.cfg in order to figure out what to do. You are using the config files from krisk.org listed above, right? If not, go get them now. I'll wait. So in sip.cfg in the <voIpProt><SIP> section you need a line like:
<alertInfo voIpProt.SIP.alertInfo.2.value="Ring Answer" voIpProt.SIP.alertInfo.2.class="4"/>
The value parameter must match whatever you use in the SIPAddHeader string. In this case they're both "Ring Answer". You could just as easily replace both with the word "Foo" or "RA".
3. Now, the alertInfo tag will match that value and then go to the "class" value to figure out what to do. Se we need to make sure class="4" is set up properly. You could probably set up class 4 in sip.cfg, but mine lives in ipmid.cfg. So go into ipmid.cfg and locate the <ringtypes> section. Below that tag (and before it's corresponding </ringtype> closing tag) you need to make sure class 4 is set up right. You should have this line:
<RING_ANSWER se.rt.4.name="Ring Answer" se.rt.4.type="ring-answer" se.rt.4.timeout="1000" se.rt.4.ringer="2" se.rt.4.callWait="6" se.rt.4.mod="1"/>
The notes above describe that line. The key is that this is class 4 as noted by the 3rd part of the value names - se.rt.4.name. I'd like to add that the keyword "RING_ANSWER" is meaningless, it's just a human-readable tag.
Got all that? The SIPAddHeader of "Ring Answer" hits the <alertInfo> tag to figure out which class to go to. Then the class in ipmid.cfg says, "Oh, I'm a "ring-answer" type and my firmware knows what to do with that type."
One test you can do is to connect to asterisk ($ asterisk -r), bump your verbosity up (<tt>set verbose 6</tt>), and try to place a call using that context from step #1. You'll see one phone calling another and within the Asterisk CLI you should see the following message appear:
— Executing SIPAddHeader("SIP/20-86bc", "Alert-Info: Ring Answer") in new stack<br />
Extension Changed 20 new state InUse for Notify User 26<br />
— Executing Dial("SIP/20-86bc", "sip/26") in new stack<br />
— Called 26<br />
— SIP/26-0448 is ringing<br />
— SIP/26-0448 answered SIP/20-86bc<br />
— Attempting native bridge of SIP/20-86bc and SIP/26-0448
If you don't see that Alert-Info: Ring Answer being sent, then you know you haven't gotten the first step right.
Also, I made the mistake of putting some comments into the .cfg files and the comments seemed to screw up the parser. It ignored seemingly random lines (i.e. non-comment ones). I'm not a complete moron since I've been writing XML for 6 years (and HTML for 11) but it goes to show how careful you should be. Anyway, I use "xmllint" on config files now before rebooting the phones to make sure I didn't make a dumb typo.
333Auto-Answer ALL incoming calls
-Tom
333
Has anyone worked with Broadsoft?
How can I use the PolyCom auto-answer configuration to work with Broadsoft?
PLEASE HELP, Tom