[Freeswitch-users] Logical OR in conditions
Mariusz Kołodziejczyk
mariusz_kolo at wp.pl
Fri Jun 10 13:02:20 MSD 2011
Hi
maybe only one condition something like
^[\*7]21[\*7]([0-9]+)[#9]$ - this allows to use combination of *#79
or
^\*21\*([0-9]+)#$|^7217([0-9]+)9$ - this is more restrict, because u
can use *# or 79 but not 7# or *9
this is solution for OR in your code.
W dniu 2011-06-09 00:44, Matthew Ralston pisze:
> Hi,
>
> What is the correct condition->break value to use in order to create a logical OR with conditions?
>
> I have two extensions which I'd like to merge into one. I'd like the actions to be run if either of the conditions matches:
>
> <extension name="call_forward_enable">
> <condition field="destination_number" expression="^\*21\*([0-9]+)#$">
> <action application="javascript" data="callForwardEnable.js"/>
> <action application="hangup"/>
> </condition>
> </extension>
>
> <!-- For phones that won't dial *# numbers, *=7, #=9 -->
> <extension name="call_forward_enable">
> <condition field="destination_number" expression="^7217([0-9]+)9$">
> <action application="javascript" data="callForwardEnable.js"/>
> <action application="hangup"/>
> </condition>
> </extension>
>
> So the result would be something like:
>
> <extension name="call_forward_enable">
> <condition field="destination_number" expression="^\*21\*([0-9]+)#$" break="on-true" />
> <condition field="destination_number" expression="^7217([0-9]+)9$">
> <action application="javascript" data="callForwardEnable.js"/>
> <action application="hangup"/>
> </condition>
> </extension>
>
> I can't seem to get it to work and my brain is melting trying to wrap my head around the different break values.
>
> Cheers,
>
> Matt
>
>
> _______________________________________________
> 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
>
>
More information about the FreeSWITCH-users
mailing list