PDA

View Full Version : alert info synthax for grandstream



whitewater
04-07-11, 03:57 AM
Hello,

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: <http://127.0.0.1> \; info = external)

it works.

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

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

thank you.

mrecoskie
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.

whitewater
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

whitewater
04-14-11, 02:55 AM
hi,
i think i had understand what you mean. here context i'm interested in extensions_additional.conf :
[ext-did-0002]

so, i write extension_custom.conf :
[ext-did-0002]
exten => _123456789, n, SIPAddHeader (Alert-Info: <http://127.0.0.1> \; 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.

mrecoskie
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':

[ext-did-0002-custom]
exten => my custom dialplan ...
exten => _123456789, n, SIPAddHeader (Alert-Info: <http://127.0.0.1> \; info = external)
...

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

here another tests :


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

only

exten => _123456789,n,SIPAddHeader (Alert-Info: <http://127.0.0.1> \; 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: <http://127.0.0.1> \; 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 :


[ext-did-0002-custom]
exten => _123456789,n,SIPAddHeader (Alert-Info: <http://127.0.0.1> \; info = external)==> it's don't work.


[ext-did-0002-custom]
exten => _123456789,1,Set(__FROM_DID=${EXTEN})
exten => _123456789,n,SIPAddHeader (Alert-Info: <http://127.0.0.1> \; 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

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

awayte
05-09-11, 03:35 PM
Hi,

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

[from-external]
include => ext-did
include => ext-did-post-custom
include => from-did-direct
include => ext-did-catchall

[from-pstn-custom]
exten => _.,n,SIPAddHeader(Alert-Info: <http://127.0.0.1> \; 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: <http://127.0.0.1> ; info = external

whitewater
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: <http://127.0.0.1>\;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.
ok.

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

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.