[Freeswitch-users] Condition and custom variables

Brian West brian at freeswitch.org
Wed Apr 29 07:54:18 PDT 2009

OK let me explain this for the 100th time.  :)

The dialplan isn't executed line by line.  The dialplan is just a  
compiled list of instructions to execute but its execution doesn't  
take place until the session enters the execute state.  So your set  
forward_all=xxxx hasn't happened yet.  BUT you can use  
execute_extension or transfer to send the session back into the  
dialplan to re-evaluate the the list of things to do based on certain  
conditions you previously set.


On Apr 29, 2009, at 9: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>
> -- 
> Alex Gusak

Brian West
brian at freeswitch.org

-- Meet us at ClueCon!  http://www.cluecon.com

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

More information about the FreeSWITCH-users mailing list