Hi Guys, Simple question, tried asking on IRC but no joy, they're too busy slating other systems. I'm trying to dial out via a remote sip gateway via the dial plan <extension name="dial_my_mobile"> <condition field="destination_number" expression="^0773400000$"> <action application="bridge" data="sofia/${use_profile}/0773400000@21X.XXX.XXX/XXX"/> </condition> </extension> This works fine, but I'd like to wild card the extension so it matches on anything starting with a 0 the a number > 0 How do I pass the number dialed using a variable? In asterisk I would put ${EXTEN} Finally I also have the sip gateway registered Mag gateway sip:xxx@hostname.net REGED Is it possible to use the name of this gateway instead of the IP address as in 21X.XXX.XXX/XXX ? Regards
Nik, We did answer you twice. ${destination_number}, But you need to not approach this with an Asterisk mindset. Example: <extension name="dial_my_mobile"> <condition field="destination_number" expression="^(0\d+)$"> <action application="bridge" data="sofia/default/$1@21X.XXX.XXX /XXX"/> </condition> </extension> In this example the regular expression would match everything start with a 0 and capture the zero plus all digits and put it into $1, Then in the next line you use $1 to pass what the regular expression matched. This concept is a bit different vs Asterisk. /b On Feb 5, 2009, at 2:36 PM, Nik Middleton wrote:
Hi Guys,
Simple question, tried asking on IRC but no joy, they’re too busy slating other systems.
I’m trying to dial out via a remote sip gateway via the dial plan
<extension name="dial_my_mobile"> <condition field="destination_number" expression="^0773400000$"> <action application="bridge" data="sofia/${use_profile}/0773400000@21X.XXX.XXX /XXX"/> </condition> </extension>
This works fine, but I’d like to wild card the extension so it matches on anything starting with a 0 the a number > 0
How do I pass the number dialed using a variable? In asterisk I would put ${EXTEN}
Finally I also have the sip gateway registered
Mag gateway sip:xxx@hostname.net REGED
Is it possible to use the name of this gateway instead of the IP address as in 21X.XXX.XXX/XXX ?
Regards
That didn't work, until I removed the $ in front of the gateway name as in sofia/gateway/gatewayname_here/$1 Why is that, surely it's a variable? Regards, ________________________________ From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian West Sent: 05 February 2009 20:48 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Dialplan variables Btw I just noticed you're using a gateway... in that case you use sofia/gateway/$gatewayname_here/$1 /b On Feb 5, 2009, at 2:36 PM, Nik Middleton wrote: <action application="bridge" data="sofia/${use_profile}/0773400000@21X.XXX.XXX <mailto:sofia/$%7buse_profile%7d/0773400000@21X.XXX.XXX> /XXX"/>
participants (2)
-
Brian West
-
Nik Middleton