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#XMLDialpla... 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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org