[Freeswitch-users] Syntax of cndition to compare two variable values?

Avi Marcus avi at avimarcus.net
Tue Oct 9 21:04:59 MSD 2012


Another way without using the COND api would be like so:

<condition field="${var1}" expression="^${var2}$"> (the ^$ are necessary to
mean "exact" rather than "contains")

-Avi



On Tue, Oct 9, 2012 at 6:39 PM, Michael Collins <msc at freeswitch.org> wrote:

> Assuming that your variables are set at the time you perform the condition
> (hint: see inline="true" for the set command) then you can try something
> like this:
>
> <condition field="${cond(${var1} == ${var2})}" expression="^true$">
>
> Standard disclaimer<http://wiki.freeswitch.org/wiki/Reporting_Bugs#Standard_Disclaimer>applies...
> -MC
>
> On Tue, Oct 9, 2012 at 8:52 AM, Yehavi Bourvine <yehavi.bourvine at gmail.com
> > wrote:
>
>> Hello,
>>
>>   Suppose I have to variables which I set some values to them at the
>> dialplan. What is the condition statement syntax to test whether their
>> values equal?
>>
>>                         Thanks, __Yehavi:
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
>
> --
> Michael S Collins
> Twitter: @mercutioviz
> http://www.FreeSWITCH.org
> http://www.ClueCon.com
> http://www.OSTAG.org
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121009/2d88a525/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list