[Freeswitch-users] Condition and custom variables

Michael Jerris mike at jerris.com
Wed Apr 29 07:59:22 PDT 2009


There should be several archive threads on this including:

http://n2.nabble.com/Using-Variables-in-Dialplans-tt2678222.html#a2678222

Mike

On Apr 29, 2009, at 10:30 AM, Alex Gusak wrote:

> Hello.
>
> Can I use custom variables in the condition field?
> For example if i set my custom var ${forward_all} and continue  
> search extensions
> <condition field="${forward_all}" .../> not work even if the  
> condition is met
> and call does not go in the uplink.
>
> Or, in the condition I can use only variables freeswitch like $ 
> {sip_from_user}?
> Is it possible to use custom variables?
>
> <extension name="set-vars" continue="true">
> <condition>
> <action application="set" data="forward_all=123456789"/>
> </condition>
> </extension>
>
> <extension name="call">
> <condition field="${forward_all}" expression="^(\d{8,9,10})$"  
> break="on-true">
> ...
> <action application="bridge" data="sofia/gateway/uplink/$ 
> {forward_all}"/>
> <action application="hangup"/>
> </condition>
>
> <condition field="destination_number" expression="^(.*)$">
> ...
> <action application="bridge" data="user/${dialed_extension}@$ 
> {domain_name}"/>
> <action application="hangup"/>
> </condition>
> </extension>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090429/8364ef48/attachment-0002.html 


More information about the FreeSWITCH-users mailing list