|
Question : Parsing of incoming extensions in Asterisk
|
|
Hi All
I am using the following as a catch all for my sip calls in extensions.conf
[testing] exten => _.,1,Dial(SIP/${EXTEN}@pstn.gateway)
This takes all incoming extensions and sends them to my pstn gateway. This is the intended behaviour.
I am trying to do the same with jingle in component mode, in this mode all calls come in as
[google-in] exten => _.,1,Dial(SIP/${EXTEN}@pstn.gw)
This is the output http://pastebin.com/m9ecdea8
the call would come in as [email protected]
Asterisk is then trying to send the call to
[email protected] instead of [email protected]
Any idea how to fix this wrong parsing pattern "In this scenario"
Thx
|
Answer : Parsing of incoming extensions in Asterisk
|
|
using the CUT function (http://www.voip-info.org/wiki/index.php?page=Asterisk+func+cut) I think the following might work :-
[google-in] exten => _.,1,Set(dst=${CUT(EXTEN,@,1)}) exten => _.,1,Dial(SIP/${dst}@pstn.gw)
Basically I am specifying the @ as a delimiter so field 1 is everything before the @ while field 2 is everything after.
|
|
|
|