[Freeswitch-users] Break&condition

Miha miha at softnet.si
Mon Mar 26 10:29:39 MSD 2012


Hi Michael,

here is my dialplan: http://pastebin.freeswitch.org/18732

It is not perfect as I was witting it for the first time.
I need to block certain destination numbers with toll_allow.

I am trying to add this part:


<condition field="${toll_allow}" expression="mobilne"  break="on-true" />
<condition field="destination_number" 
expression="^(051|041|031|030|040|070|071)(\d{6})|^(0038651|0038641|0038631|0038630|0038640|0038670|0038671)(\d{6})" 
break="on-true">
<action application="respond" data="403"/>
</condition>



<condition field="${toll_allow}" expression="tuje"/>
<condition field="destination_number" expression="^00\d+">
<action application="respond" data="403"/>
</condition>


<condition field="${toll_allow}" expression="vroce"/>
<condition field="destination_number" 
expression="^(090)(\d{4})|^(090)(\d{6})">
<action application="respond" data="403"/>
</condition>

before it hits the main part of dialplan. So that I can block this 
destiantion numbers if condition is true.

Thank you!

Regards,
Miha

Regards,
Miha
On 3/23/2012 4:33 PM, Michael Collins wrote:
> Miha,
>
> It might help if you show us a bit more of your dialplan. It may be 
> that you need to break some of these out into separate extensions. 
> Also, what is your "big picture" application? What is the problem that 
> you are attempting to solve?
>
> -MC
>
>
> On Fri, Mar 23, 2012 at 6:04 AM, Miha <miha at softnet.si 
> <mailto:miha at softnet.si>> wrote:
>
>     Hi,
>
>     In same extension a have multiple conditions. Problem is if the
>     first condition is false, dialplan will go further as I have set
>     on-true.
>     How can I prevent that dialplan will go after break="on-true" on
>     second condition and will not go looking condition inside condition.
>
>     So if the variable mobilne is not set, in this dialplan FS will go
>     looking to <condition field="destination_number"
>     expression="^(051|041|031|030|040|070|071)(\d{6})|^(0038651|0038641|0038631|0038630|0038640|0038670|0038671)(\d{6})"
>     break="on-true"> and reject call instead of goint to second
>     condtion which is <condition field="${toll_allow}"
>     expression="tuje"/>.
>
>     I hope I make it clear:D
>
>     <condition field="${toll_allow}" expression="mobilne" 
>     break="on-true" />
>     <condition field="destination_number"
>     expression="^(051|041|031|030|040|070|071)(\d{6})|^(0038651|0038641|0038631|0038630|0038640|0038670|0038671)(\d{6})"
>     break="on-true">
>     <action application="respond" data="403"/>
>     </condition>
>
>
>
>     <condition field="${toll_allow}" expression="tuje"/>
>     <condition field="destination_number" expression="^00\d+">
>     <action application="respond" data="403"/>
>     </condition>
>
>
>     <condition field="${toll_allow}" expression="vroce"/>
>     <condition field="destination_number"
>     expression="^(090)(\d{4})|^(090)(\d{6})">
>     <action application="respond" data="403"/>
>     </condition>
>
>
>     Regards and thank you for your help!
>
>     Miha
>
>     _________________________________________________________________________
>     Professional FreeSWITCH Consulting Services:
>     consulting at freeswitch.org <mailto: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
>     <mailto: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
>
>
>
>
> _________________________________________________________________________
> 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/20120326/028bc144/attachment-0001.html 


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