[Freeswitch-users] Questions about bridge pattern and variables captured by conditions

Francis sms at icefire.qza.net.au
Wed May 21 21:05:09 MSD 2014


 

If my understanding is correct(TM), the first line is attempting to dial
1000 at sip.test.com via a profile called 'local', whereas the second line
is attempting to dial 1000 via a profile called sip.test.com. 

For the second question, you can swap the two statements like this: 

<condition field="${toll_allow}" expression="local"/> 

<condition field="${destination_number}" expression="^([0-9]{6})$"> 

<action application="set" data="hangup_after_bridge=true"/> 

<action application="bridge"
data="sofia/gateway/${default_gateway}/$1"/> 

<anti-action application="answer"/> 

<anti-action application="speak" data="Local calls are not allowed!"/> 

</condition> 

Which will preserve $1 for use in the condition statement without having
to explicitly set it as a variable. 

Francis 

On 2014-05-22 01:11, Iskren Hadzhinedev wrote: 

> Hello, 
> 
> I'm having some trouble understanding a couple of things. 
> 
> First is what's the difference between: 
> 
> <action application="bridge" data="sofia/local/1000 at sip.test.com"/> 
> 
> and 
> 
> <action application="bridge" data="sofia/sip.test.com/1000"/> ? 
> 
> The other question: 
> 
> With these dialplan rules: 
> 
> <condition field="${destination_number}" expression="^([0-9]{6})$"/> 
> 
> <condition field="${toll_allow}" expression="local"> 
> 
> <action application="set" data="hangup_after_bridge=true"/> 
> 
> <action application="bridge" data="sofia/gateway/${default_gateway}/$1"/> 
> 
> <anti-action application="answer"/> 
> 
> <anti-action application="speak" data="Local calls are not allowed!"/> 
> 
> </condition> 
> 
> The variable $1 doesn't get expanded to the captured expression. Is it possible to retain it somehow without setting a temporary variable? 
> 
> Thanks! 
> 
> Kind regards, 
> 
> -- 
> 
> Iskren Hadzhinedev 
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com [1]
> 
> 
>  [2]
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org [3]
> http://wiki.freeswitch.org [4]
> http://www.cluecon.com [5]
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users [6]
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users [7]
> http://www.freeswitch.org [3]
 

Links:
------
[1] http://www.freeswitchsolutions.com
[2] 
[3] http://www.freeswitch.org
[4] http://wiki.freeswitch.org
[5] http://www.cluecon.com
[6] http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
[7] http://lists.freeswitch.org/mailman/options/freeswitch-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140522/5662a6b6/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list