[Freeswitch-users] Using Variables in Dialplans

Brian West brian at freeswitch.org
Wed Apr 22 12:30:19 PDT 2009


This again? ;) Lets see if this helps!

http://wiki.freeswitch.org/wiki/Dialplan_XML#Anatomy_of_the_XML_Dialplan

The dialplan is not processed and executed line by line... its  
compiled and installed into the session before it goes into execute  
state.
So you can't use set on one line then use that var in a condition on  
the next line because the SET hasn't happened yet.  Once the session
leaves the routing state it enters execute state.  This is when the  
compiled list of things to do gets ran.

If you wish to re-enter the dialplan and re-eval some condition you  
use execute_extension or "transfer" the session back to the dialplan.

/b


On Apr 22, 2009, at 2:19 PM, Chris Fowler wrote:

> I have the following defined:
>
>    <!-- Billing Open? -->
>    <extension name="billing_open" continue="true">
>      <!-- man strftime - M-F, 9AM to 5PM -->
>      <condition field="${strftime(%w)}" expression="^([1-5])$"/>
>      <condition field="${strftime(%H%M)}" expression="^((09|1[0-6]) 
> [0-5][0-9]|1700)$">
>        <action application="set" data="billingopen=true"/>
>      </condition>
>    </extension>
>
>
>    <!-- billing line -->
>    <extension name="billing">
>      <condition field="destination_number" expression="^billing$| 
> ^2001$"/>
>      <condition field="billingopen" expression="^true$">
>      <...>
>
>
> But despite the "Billing Open" ext firing correctly:
> 	Action set(billingopen=true)
>
> The Billing extenstion fails to get the data:
> 	Regex (FAIL) [billing] billingopen() =~ /^true$/ break=on-false

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/20090422/f435b3fb/attachment-0002.html 


More information about the FreeSWITCH-users mailing list