[Freeswitch-users] Calling more than 1 variable in condition

Michael Collins msc at freeswitch.org
Thu Nov 5 10:47:38 PST 2009


On Wed, Nov 4, 2009 at 10:22 PM, Ahmed Munir <ahmedmunir007 at gmail.com>wrote:

> Hi,
>
> In my dial plan I've created a variable named SIP_CALL, PSTN_CALL. If
> SIP_CALL = true, it dials out to sip call, when PSTN_CALL=true, it dials out
> to landline call, as I provide sample below;
>
> <condition field="${SIP_CALL}" expression="^true$">
>      <action application="log" data="INFO SIP CALL"/>
>      <action application="bridge" data="sofia/${domain}/$1"/>
> </condition>
>
> <condition field="${PSTN_CALL}" expression="^true$">
>      <action application="log" data="INFO PSTN CALL"/>
>      <action application="bridge" data="sofia/gateway/$1"/>
> </condition>
>
> The problem I'm facing is how can I apply condition when I've to call more
> than 1 variables? Like if there are no records in SIP numbering plan table
> and PSTN numbering plan table so it get the digits and  dial out the to
> carrier (how to apply AND operation in condition?) i.e.
>
> <condition field="*${SIP_CALL} and ${PSTN_CALL}*" expression="^false$">
>      <action application="log" data="INFO GET DTMF"/>
>      <action application="getdigits" data="values for getdigits"/>
>       <action application="bridge" data="sofia/gateway/$1"/>
> </condition>
>
> AND operations are very simple - just stack the conditions:
<condition field="${Field1}" expression="expr1"/>
<condition field="${Fiedl2}" expression="expr2">
  <-- actions here -->
</condition>

note that you must close the first condition's tag! BTW, this is covered in
the dialplan section of the wiki. :)
-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20091105/052f3f50/attachment-0002.html 


More information about the FreeSWITCH-users mailing list