[Freeswitch-users] Action in nested condition gets executed even when outer condition is false

Steven Ayre steveayre at gmail.com
Wed Nov 12 16:57:01 MSK 2014


Worth noting you don't need nested conditions to do this - search
for Time-of-day-tod on
https://freeswitch.org/confluence/display/FREESWITCH/XML+Dialplan

On 12 November 2014 13:54, Steven Ayre <steveayre at gmail.com> wrote:

> require_nested defaults to true so shouldn't be required.
>
> Frank, collect a debug-level log of the call. It'll show the parsing of
> the dialplan, and might shed light on what's happening.
>
> On 12 November 2014 01:29, Michael Collins <msc at freeswitch.org> wrote:
>
>> I haven't used nested conditions since I was raised in an era when you
>> couldn't nest them. ;)
>>
>> This page mentions the "require-nested" attribute:
>>
>> https://freeswitch.org/confluence/display/FREESWITCH/XML+Dialplan#XMLDialplan-Conditions
>>
>> I didn't see that in your dialplan, so that might be a good place to
>> start.
>>
>> -MC
>>
>>
>> On Tue, Nov 11, 2014 at 1:08 PM, Frank Myhr <fmyhr at fhmtech.com> wrote:
>>
>>> Hi,
>>>
>>> I have the following extension in a context that gets parsed several
>>> times during a call due to transfers and execute_extension. I'm finding
>>> that one of the inner actions (the correct one, based on time of day)
>>> gets executed even when the outer condition is false. Might not have
>>> noticed, except my original version of this extension actually played
>>> the greeting files, rather than just exporting the correct one in a
>>> variable. Callers were getting greeted multiple times, which was not the
>>> intention.
>>>
>>> For now I've sidestepped the audible problem by playing ${greeting} in
>>> another extension that does execute_extension on this one. But the
>>> greeting is still getting set multiple times per call.
>>>
>>> Would appreciate any clues as to why an inner action gets executed even
>>> though the outer condition is false.
>>>
>>> Thanks!
>>> Frank
>>>
>>>
>>> <extension name="set_greeting_tod">
>>>         <condition field="destination_number"
>>> expression="^set_greeting_tod$">
>>>
>>>                 <condition minute-of-day="1-359" break="on-true"><!--
>>> 12am - 5:59am -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-hello.wav"/>
>>>                 </condition>
>>>
>>>                 <condition minute-of-day="360-690" break="on-true"><!--
>>> 6am - 11:30am -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-good_morning.wav"/>
>>>                 </condition>
>>>
>>>                 <condition minute-of-day="691-780" break="on-true"><!--
>>> 11:31am - 1pm -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-hello.wav"/>
>>>                 </condition>
>>>
>>>                 <condition minute-of-day="781-1020" break="on-true"><!--
>>> 1:01pm - 5pm -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-good_afternoon.wav"/>
>>>                 </condition>
>>>
>>>                 <condition minute-of-day="1021-1380"
>>> break="on-true"><!-- 5:01pm - 11pm -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-good_evening.wav"/>
>>>                 </condition>
>>>
>>>                 <condition minute-of-day="1381-1440"><!-- 11:01pm -
>>> 11:59pm -->
>>>                         <action application="export"
>>> data="greeting=ivr/ivr-hello.wav"/>
>>>                 </condition>
>>>         </condition>
>>> </extension>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.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
>>>
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.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/20141112/e2642986/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list