[Freeswitch-users] Understanding break="never" in condition-tag

[Redhosting] Egbert Groot egbert at redhosting.nl
Mon Mar 21 17:41:03 MSK 2011


Dmitry Bely schreef:
> On Mon, Mar 21, 2011 at 3:08 PM, Avi Marcus <avi at avimarcus.net> wrote:
>   
>> Hmm, looking at your log and mine from the past, you appear to be correct.
>> It looks like break=never means to ignore the condition. So then.. I'm left
>> with the original question - what's the point?
>>     
>
> I can only replicate my answer to the original poster:
>
> It makes sense if you use the form
>
> <condition wday="1" break="never">
>  (some actions)
> </condition>
>
>   
>> And another - how can you do groups of conditions, like I intended to show
>> in the example? I tried setting it to break on-false, or break on-true, but
>> I can never get to the second condition set. Am I supposed to create it as
>> separate extensions?
>>     
>
> Probably so.
>
>   
>> On Mon, Mar 21, 2011 at 12:44 PM, Dmitry Bely <dmitry.bely at gmail.com> wrote:
>>     
>>> On Mon, Mar 21, 2011 at 1:01 PM, Avi Marcus <avi at avimarcus.net> wrote:
>>>       
>>>>>> You need ALL the conditions to match for freeswitch to do the action,
>>>>>> and you can't
>>>>>> change that!
>>>>>>             
>>>>> I don't think so. If some condition evaluates to true, its nested
>>>>> actions are always executed no matter what preceded it. But of course
>>>>> the condition should be evaluated first, that's where various break
>>>>> values come into play.
>>>>>           
>>>> No way - the dialplan is always run on a "match all conditions" to do
>>>> the
>>>> actions! How else would multiple conditions EVER work?
>>>>         
>>> Completely wrong. And I don't see relevant logs in your message. Here
>>> is mine. A dialplan fragment:
>>>
>>>    <extension name="condition-test">
>>>        <condition wday="6" break="never"/>
>>>        <condition hour="9-18" break="on-true">
>>>            <action application="info"/>
>>>        </condition>
>>>    </extension>
>>>
>>> log:
>>>
>>> Dialplan: sofia/internal/1000 at 192.168.121.66 parsing
>>> [default->condition-test] continue=false
>>> Dialplan: sofia/internal/1000 at 192.168.121.66 Date/Time Match (FAIL)
>>> [condition-test] break=never
>>> Dialplan: sofia/internal/1000 at 192.168.121.66 Date/Time Match (PASS)
>>> [condition-test] break=on-true
>>> Dialplan: sofia/internal/1000 at 192.168.121.66 Action info()
>>>
>>> Guess what? The first condition fails but the action is still
>>> scheduled for execution (and indeed executed later)
>>>       
>
>   
I can't/didn't contribute much to this discussion, but I do follow it. 
My idea and (little) testing experience supports the explanation of Dimitry.
Either way, it 'proofs' there is confusion about the working of the 
'break' in condition tags.
If I can find the time, I will try to do some tests / build an example 
myself. Thank you both for the answers and insights so far.

regards,
Egbert.







-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5154 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110321/ccf680d4/attachment.bin 


More information about the FreeSWITCH-users mailing list