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

Frank Myhr fmyhr at fhmtech.com
Wed Nov 12 00:08:21 MSK 2014


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>



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