How can I get FreePBX to pass the original Alert-info field coming from a Polycom Phone?

I would Really to be able to use the build-in Polycom Intercom feature baked into Polycom phones.
The answer in this case is not to just use the *88 feature code.
Is there a way I can get the PBX to “pass” this field on from the originating phone to the destination phone?
I am seeing some older posts that do not completely anser this and mention “hooks” to do it.
But they do not explain how to do it.
Time has passed and I wonder if there might be an easy way.
Or an example of how I might do it otherwise.
Users would like to be able to press the Intercom Key and type in on the phone the extension number that they would like to “intercom” call.
Thanks!

 Message Header
        Via: SIP/2.0/UDP 192.168.1.101;branch=z9hG4bKe09e6c87596092C8
        From: "Extension 200" <sip:[email protected]>;tag=8044ECC6-AFF8CB8E
        To: <sip:[email protected];user=phone>
        CSeq: 1 INVITE
        Call-ID: 16fd1db4575d1db62a4940a2c037a9bf
        [Generated Call-ID: 16fd1db4575d1db62a4940a2c037a9bf]
        Contact: <sip:[email protected]>
        Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
        User-Agent: PolyEdge-Edge_E400-UA/8.3.0.15436
        Accept-Language: en
        Supported: timer
        Supported: replaces,100rel
        Allow-Events: conference,talk,hold
        Alert-Info: Intercom <----------------------------------------<<<
        Max-Forwards: 70
        Content-Type: application/sdp
        Content-Length: 463

In dialplan you can do something like:
Please note this is pseudo-code for a general idea. It has NOT been tested.

[sub-forwardheader]
exten =>  s,1,NoOp(Reading Alert-Info header in Gosub)
 same => n,Set(ALERT_INFO=${PJSIP_HEADER(read,Alert-Info)})
 same => n,NoOp(Alert-Info header value: ${ALERT_INFO})
 same => n,Set(PJSIP_HEADER(add,Alert-Info)=<new_value>)
 same => n,NoOp(Added new Alert-Info header)
 same => n,Return()

[forward-context]
exten => _X.,1,NoOp(Starting call processing)
 same => n,Gosub(sub-forwardheader,s,1)
 same => n,Dial(PJSIP/${EXTEN},30)
 same => n,Hangup()

Hi James,
Thanks for answering.
Sorry for being stupid, but where is this editable dialplan at?
I’m a bit fresh to FreePBX. While have been using and messing with plain Asterisk for a long time.
Am trying to accomplish a couple of simple Intercom config tests.
But am falling down a lot of rabbit holes trying to figure it out.
Most posts I have found are VERY old and pre PJSip.

Does it still use a config file for dialplan(s)?
I thought dialplans were built on the fly from data pulled from a database as used.
I’ll take a look.

Also a separate but related question:
When trying a built-in *80 style intercom call-
This sets Alert-Info to “Ring Answer”
Where can I change this to something else? ( I have been looking )
Polycom phones default to “Intercom”.

To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: dbea17b6-cba6-4a48-a20e-faf564e8af01
CSeq: 9787 INVITE
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Call-Info: <uri>;answer-after=0
Alert-Info: <http://127.0.0.1>;info=Ring Answer

You use custom files… the best crash course for this may be

Oops, I actually meant to post this one-
But I think you get the idea.
This one is the FreePbx *80 Intercom call of course.
And I’d like to be able to handle both situations in different ways.
1- be able to change the string that FreePbx uses for it’s style of Intercom call.
and 2-
Be able to get FreePbx to PASS or copy over the Alert-Info from one phone to another.
As that would make the built-in Polycom Intercom thing function beautifully if I could get that to work.

To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: dbea17b6-cba6-4a48-a20e-faf564e8af01
CSeq: 9787 INVITE
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Call-Info: <uri>;answer-after=0
Alert-Info: <http://127.0.0.1>;info=Ring Answer
P-Asserted-Identity: "Extension 210" <sip:[email protected]>
Max-Forwards: 70
User-Agent: FPBX-17.0.19.28(22.5.0)
Content-Type: application/sdp
Content-Length:   337

Also one really good thing I got out of today: sngrep LOL.
Never even heard of it before until now.
Quick & dirty, a bit faster/handier than wireshark and mirroring a switch port. :slight_smile:

I don’t think this will work, because the first Set needs to be run on the A leg and the second Set on the B leg channel.

There is a mechanism, in FreePBX to setup a driver agnostic request for a custom header, and I think that can be done on the A leg, but I forget the details. It is what FreePBX itself uses to add Alert-Info.

Any help would be greatly appreciated.
I still do not understand where this is located and where I can edit it.
all of the files in FreePBX state that you can’t edit them directly as they will be overwritten.
Also I do indeed need to know how to write/copy it back into the “b” leg.

exten =>  s,1,NoOp(Reading Alert-Info header in Gosub)
 same => n,Set(ALERT_INFO=${PJSIP_HEADER(read,Alert-Info)})
 same => n,NoOp(Alert-Info header value: ${ALERT_INFO})
 same => n,Set(PJSIP_HEADER(add,Alert-Info)=<new_value>)
 same => n,NoOp(Added new Alert-Info header)
 same => n,Return()

Is there a place where I can change the Alert-Info string that it is setting?

I am trying to figure out how to do two related tasks.
I do not need both at the same time but I would like to figure out how to do them.

Still looking for any pointers & clues.
There’s some clue here but I do not know how to get to these settings.
Thanks.

To me, this seems like basic functionality that should just work, or at least be easily configurable to be able to pass and repeat Alert-Info end-to-end.
This is totally stopping me from being able to use Polycom’s and other’s nice Intercom features.
As well as other features that should be able to keep the Alert-Info field and pass it to the other endpoint when calling it.

Whilst I know in general terms how to do this in Asterisk, and know that FreePBX has some of the code to support this, I would have to trawl through the code of FreePBX to work out the cleanest way of integrating it into FreePBX.

There is a parameter on Dial, that specifies a subroutine to be run on the B leg before anything is sent to the far end, and FreePBX defines that subroutined.

Typically FreePBX has places in its code were it calls subroutines, and defines default empty versions of those subroutines (a link to an article on which has already been given).

This the first time I recall anyone asking for this feature. Normally Alert-Info is an outbound only function.

It reads in specifically named files for user provided dialplan code, which can implement theses subroutines.

I don’t want to give more precise details here, as I’d probably get it wrong, without looking up quite a few details. But it is almost certain that you will need to understand those details to do what you want to do.

I very much appreciate your help.
I don’t understand at all why there would not be requests for this.
I simply want to use the Intercom features between Polycom phones.
These phones are popular and widespread and have been around for a long time.
And almost all phone systems (non-asterisk or FreePBX) do this in a very simple (and expected way).
The user expects to press the intercom key and type in the extension number they want or select it from a dropdown list on the phone itself and this calls the other extension in such a way that it makes a short alert tone and auto answers on speaker.
Most phone systems just do this right out of the box.
I am quite confused why this is so difficult to accomplish on FreePBX.
But am willing to work to “fix it”.
I’ve done this is the past with plain asterisk and chan_sip (2015)
But just like now, it took a LOT of effort, and to the end customer it was just an expected feature that they had on every other phone system that they had used and wanted it on this new system.
And I was replacing it with an Asterisk server and new IP phones.
I made it work back then. and was just as surprised back then that this did not work out of the box or nearly out of the box.

I’m even more surprised that this hasn’t been requested and made any easier since 2015.
And to hear it’s not been requested or expected just has me mind-boggled.
It is a very nice and commonly used feature on business phone systems.

I’m curious. What other features depend on maintaining Alert-Info end-to-end? I’ve also never heard of this being strictly necessary before. For example, I’ve implemented intercoms on Polycom devices simply with a bit of endpoint configuration, and do not depend on that.

Hi Drew,
I think there are some other features that could benefit from this but the Intercom one is the most
commonly needed/wanted.
And they (users) really would like to be able to do it from Polycom’s native built in interface.
Intercom button dial a number or select from drop down.
I also am really trying to learn better how it works.
Seems the newer phones are “hardcoded” to want to use the string “Intercom” while older phones
used different things “Auto answer” and “Ring-Answer” and a few others.
From the dropdown contact list I’d rather have extension numbers in the list because it would be the same list for a standard extension call OR an intercom call. like “210 220 and 230”
I do not want to have to have two entire sets of extensions like: *80210 *80220 and *80230
I also would like them not to have to dial *80 to make an intercom call but use the phone’s intercom function to send the intercom call field.
Much cleaner. And if it’s possible I’d like to figure out how to do it.
I’m sure I can configure the phone to look for FreePBX’s included default Intercom Alert-info string.
But then that limits me to having to dial *80+ext.
I’m not sure why the newer phones are sending “Intercom” now instead of the old string the older phones send.
But I’m working on figuring that out.
It might be a “different” way of doing Intercom functionality.
Oddly I have not been able to find this in the admin manual for the latest Polycom software.
I’ll look harder, Searching in the manual did not find it.
I’d sure like to get FreePBX to just send that string instead of the old one just to see how the phone behaves when it gets it.
So I was hoping there was a way to change that as mentioned above.
These new phones are expecting
Alert-Info: Intercom
Out of the box for some reason when Intercom is enabled.
But FreePBX sends
Alert-Info: http://127.0.0.1;info=Ring Answer

There’s an option to turn off the new RFC style but no option to change “Ring Answer”

Easy to change on the phone.
“Intercom” is just the new default for whatever reason.

Optional: Enter the string for the Alert-Info header.
You can use the following special characters: @, -, _, or . . The default is Intercom.
voIpProt.SIP.intercom.alertInfo="<alphanumeric string>"
5.
Optional: Encapsulate the Alert-Info header set by the voIpProt.SIP.intercom.alertInfo parameter with angular brackets (”<” and “>”).
voIpProt.SIP.intercom.alertInfo.encapsulateWithAngleBrackets="1"

It would be “cool” to change what FreePBX sends (with *80)
And I wanted to learn something there.
But it is not at all necessary.

I still really would like to know how to make the Alert-Info sent by a phone to reach another phone.
That would make the intercom functionality optimal in this case.
And the end user will love it.
Not going to mention that I would also like it quite a bit.
:slight_smile:

Any thoughts on what I can do to play with this?
I’m truly stuck here.
And I don’t understand WHERE to get in and play with the dialplan as mentioned.
I’d really like to learn how to make this simple thing work.

Drew, but you did not implement it using the ability to choose an extension on the phone from a contact list or speed dial and get to CHOOSE if it’s going to be an Intercom call or a regular call.
This is one way that it should be able to work.
And it’s much cleaner and inline with the phone’s interface if it does.
Otherwise you have to contact *80 + extension.
Which is clunky.
Can’t call the same destination two different ways.
It makes a big difference in presentation and ease of use.
And not having to setup two separate sets of speed dials for Intercom and extension to extension calling. I’m also looking for the opportunity to learn something here and go through the work it might take.
Other people in this situation likely just ‘settled for’ having to dial *80.