View Full Version : alert info synthax for grandstream

04-07-11, 03:57 AM

I would like use the info_alert option available in different menus for Grandstream phones.

Currently, the pika sending this line during a call:
Executing [123456789 @ from-pstn: 5] Set ("PIKA/digital/3", "__ALERT_INFO = external")

found in the configuration extensions_additional.conf:
exten => _123456789, n, Set (__ALERT_INFO = external)

if I change manually for Grandstream :
exten => _123456789, n, SIPAddHeader (Alert-Info: <> \; info = external)

it works.

Of course, the change is lost when I reload asterisk by the interface Pika.

What should I change for good in the syntax file for all the different options alert_info menu ?

thank you.

04-07-11, 08:06 AM
Yes, extension_additional.conf is re-generated each time FreePBX is changed. Your modification needs to be placed in extension_custom.conf to become protected.
Look for an included 'xxxxxxx-custom' context inside the context you are interested in (usually at the top) and use this in the extension_custom.conf file to insert your changes. The file extension_custom.conf will not be over-written.
In general, all dialplan modifications you make should be in 'custom' contexts in a FreePBX environment on Warp.

04-13-11, 10:19 AM
hi, sorry for the delay.
I saw your answer, but I do not have time right now to look.

I am testing as soon as I can.
thank you

04-14-11, 02:55 AM
i think i had understand what you mean. here context i'm interested in extensions_additional.conf :

so, i write extension_custom.conf :
exten => _123456789, n, SIPAddHeader (Alert-Info: <> \; info = external)

whitout restart pika or asterisk.
i had make a extensions reload in asterisk CLI.

but it don't work :-(

it don't work with [ext-did-0002-custom] too.

what i forgot ? thank you.

04-15-11, 05:44 AM
In 'extensions_additional.conf' you will notice this line.
include => ext-did-0002-custom

This is a hook for any customizations. To use it simply add the something like the following lines to 'extension_custom.conf':

exten => my custom dialplan ...
exten => _123456789, n, SIPAddHeader (Alert-Info: <> \; info = external)

05-02-11, 11:42 AM
Hi, sorry again for my delay.

here another tests :

exten => _123456789,n,Set (__ALERT_INFO = external)
exten => _123456789,n,SIPAddHeader (Alert-Info: <> \; info = external)
exten => _123456789,n(dest-ext),Goto(from-did-direct,157,1)==> it's ok


exten => _123456789,n,SIPAddHeader (Alert-Info: <> \; info = external)==> it's don't work.

exten => _123456789,n,Set (__ALERT_INFO = external)
exten => _123456789,n(dest-ext),Goto(from-did-direct,157,1)
exten => _123456789,n,SIPAddHeader (Alert-Info: <> \; info = external)==> it's don't work.

so, here what i try :
extensions_additional.conf, generated by freepbx gui have those line :

exten => _123456789, n, Set (__ALERT_INFO = external)extension_custom.conf :

exten => _123456789,n,SIPAddHeader (Alert-Info: <> \; info = external)==> it's don't work.

exten => _123456789,1,Set(__FROM_DID=${EXTEN})
exten => _123456789,n,SIPAddHeader (Alert-Info: <> \; info = external)==> it's don't work.

i would like to find by myself but... i don't know what is correct synthax.

what's wrong ?
or,it would be possible to modify the script that generates the extensions.conf file so have the correct syntax in extensions_additional.conf ?

thank you

05-06-11, 03:28 AM
hum... someone should give me correct synthax ?
thank you

05-09-11, 03:35 PM

I believe the reason this is not working is because you are dabbling with the wrong context. Because this is a call from an external trunk the first context it enters is [from-trunk]. We will need to add 'from-pstn-custom' handling in order to achieve the intended behavior.

Simply add the following contexts to /etc/asterisk/extensions_custom.conf

include => ext-did
include => ext-did-post-custom
include => from-did-direct
include => ext-did-catchall

exten => _.,n,SIPAddHeader(Alert-Info: <> \; info = external)
exten => _.,n,Goto(from-external,${EXTEN},1)

This will add an Alert Info header to the Invite sent to the called SIP phone as follows:

Alert-Info: <> ; info = external

05-19-11, 07:52 AM
greats, thank you very much, it's work :-)

thank you for this synthax. i notice the correct is :

exten => _.,n,SIPAddHeader(Alert-Info: <>\;info=external)without space. otherwise, it dosen't work.

I had a little problem with this modification. I have not managed to reproduce it several times.

* calling from the outside : the person hang up before I pick up the phone.
the phone keeps ringing. if I pick up, I have nothing.

* calling from the outside: I pick up, waiting for discussion, I hangs up.

* calling from the outside: I pick up the phone, chat, the person hangs up :

I remade an extensions reload, I have not had the problem.

quick question:
if I add a SIP or IAX trunk, what should I add to use the alert information in the same way?
thank you again.