Actually, i might have figured it out. What I intend to do is an IVR-like application. Which means I want this to happen
Call 1212
Application="read" gets my input
if digit == 1 do this
if digit == 2 do that
Each option has it's own set of structions, so I think it should be within a condition. But I can't seem to validate the condition. Look at the following construction.
${dg} is the variable that stores the input digit. So, if ${dg} == 0, play beep.gsm, else play audio.gsm. The expression is never true, but i put 0 always. Instead of playing beep.gsm, it plays audio.gsm. I got the same example from Freeswitch 1.2 book, Nested Conditions section.
On Sep 22, 2016, at 1:06 PM, Caio Assis <caioebassis@hotmail.com> wrote:
Hi.
Here's what I'm trying to do. I want to play a sound if a certain condition is true.
<extension name="test"><condition field="destination_number" expression="^1212$"><condition field="${cond(${destination_number} == 1212 ? 1212 : 0000)}" expression="^1212$">
<!-- this second condition is just to ilustrate the nested condition--><action application="log" data="INFO LOG"/><action application="playback" data="sound1.gsm"/></condition><action application="playback" data="sound2.gsm"/><action application="hangup"/></condition></extension>
The sound 1 doesn't play, but I knew the condition was true because I can see the INFO LOG on the console. The sound 2, outside the condition, was played normally. Both PLAYBACK and READ applications don't work on nested conditions. Can anyone help me?