Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Dialplan variables


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
nik.middleton at noble...
Guest





PostPosted: Thu Feb 05, 2009 3:47 pm    Post subject: [Freeswitch-users] Dialplan variables Reply with quote

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
Back to top
brian at freeswitch.org
Guest





PostPosted: Thu Feb 05, 2009 3:48 pm    Post subject: [Freeswitch-users] Dialplan variables Reply with quote

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 ([email]sofia//0773400000@21X.XXX.XXX[/email])/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:
Quote:
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 ([email]sofia//0773400000@21X.XXX.XXX[/email])/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 [url=sip:xxx@hostname.net]sip:xxx@hostname.net[/url] REGED

Is it possible to use the name of this gateway instead of the IP address as in 21X.XXX.XXX/XXX ?

Regards

Back to top
brian at freeswitch.org
Guest





PostPosted: Thu Feb 05, 2009 3:49 pm    Post subject: [Freeswitch-users] Dialplan variables Reply with quote

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:
Quote:
<action application="bridge" data="sofia/${use_profile}/0773400000@21X.XXX.XXX ([email]sofia//0773400000@21X.XXX.XXX[/email])/XXX"/>
Back to top
nik.middleton at noble...
Guest





PostPosted: Thu Feb 05, 2009 4:18 pm    Post subject: [Freeswitch-users] Dialplan variables Reply with quote

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 ([email]sofia/$%7buse_profile%7d/0773400000@21X.XXX.XXX[/email])/XXX"/>
Back to top
brian at freeswitch.org
Guest





PostPosted: Thu Feb 05, 2009 4:22 pm    Post subject: [Freeswitch-users] Dialplan variables Reply with quote

I mean for you to replace it with your gateway name. In your case its Mag I think?

/b

On Feb 5, 2009, at 3:14 PM, Nik Middleton wrote:
Quote:
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?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services