<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Awesome glad to hear it helped!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org]
<b>On Behalf Of </b>Caio Assis<br>
<b>Sent:</b> Tuesday, September 27, 2016 6:30 AM<br>
<b>To:</b> FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org><br>
<b>Subject:</b> Re: [Freeswitch-users] Playback within condition<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p><span style="font-family:"Calibri",sans-serif;color:black">Thank you for your help. The example you gave helped me a lot. I was able to do what I intended. Thanks a lot.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Calibri",sans-serif;color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
<</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">>
on behalf of Branden Jordan <</span><a href="mailto:BJordan@E-Teleco.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">BJordan@E-Teleco.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">><br>
<b>Sent:</b> Friday, September 23, 2016 6:28 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] Playback within condition</span><span style="font-family:"Calibri",sans-serif;color:black">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">Yeah without the console logs we are not going to be able to really help you.
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">If you are trying to do your conditionals right after your play and get digits or read that is not going to work without transferring. Remember the dialplan has two steps, the evaluation
period to figure out what to run, and then the execute phase where it executes the steps. If you create the variable during the execute phase you cannot use the variable further down in a conditional in the same execution because during the evaluation period
it was null. </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">This works when I test it. Maybe this will help you get on the right path to solving your issue.</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <extension name=”playthisfile”></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <condition field="destination_number" expression="^playfilefortestcondition$"></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="play_and_get_digits" data="1 1 1 4000 # abc.wav invalid.wav testvar [1|2|0] 100 testcond XML public" /></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="transfer" data="testcond XML public" /></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </condition></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </extension></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <extension name="testconditions"></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <condition field="destination_number" expression="^testcond$"/></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <condition field="${testvar}" expression="[0]" break="on-true"></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="log" data="CRIT Value was 0"/></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="playback" data="test.wav"/>
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="hangup" data="NORMAL_CLEARING"/>
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </condition></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <condition field="${testvar}" expression="[1]" break="on-true"></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="log" data="CRIT Value was NOT 0"/>
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="playback" data="test.wav"/>
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <action application="hangup" data="NORMAL_CLEARING"/>
</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </condition></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </extension></span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">Thanks,</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">Branden Jordan</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
[</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">]
<b>On Behalf Of </b>Aqs Younas<br>
<b>Sent:</b> Friday, September 23, 2016 1:52 PM<br>
<b>To:</b> FreeSWITCH Users Help <</span><a href="mailto:freeswitch-users@lists.freeswitch.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">><br>
<b>Subject:</b> Re: [Freeswitch-users] Playback within condition</span><span style="color:black"><o:p></o:p></span></p>
<p><span style="color:black"> <o:p></o:p></span></p>
<div>
<p><span style="color:black">Like said before you need to look into logs to figure it out or paste the console logs here. <o:p></o:p></span></p>
</div>
<div>
<p><span style="color:black"> <o:p></o:p></span></p>
<div>
<p><span style="color:black">On 23 September 2016 at 22:18, Caio Assis <</span><a href="mailto:caioebassis@hotmail.com" target="_blank">caioebassis@hotmail.com</a><span style="color:black">> wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">Actually, i might have figured it out. What I intend to do is an IVR-like application. Which means I want this to happen<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">Call 1212<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">Application="read" gets my input<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">if digit == 1 do this<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">if digit == 2 do that<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">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.<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <o:p></o:p></span></p>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"><condition field="${dg}" expression="^0$"></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="playback" data="/home/beep.gsm"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <anti-action application="playback" data="/home/audio.gsm"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="hangup"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"></condition></span><span style="color:black"><o:p></o:p></span></p>
</div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">${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.<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Calibri",sans-serif;color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div>
<p><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
<</span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">freeswitch-users-bounces@lists.freeswitch.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">>
on behalf of Michael Jerris <</span><a href="mailto:mike@jerris.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mike@jerris.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">><br>
<b>Sent:</b> Thursday, September 22, 2016 6:57 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Cc:</b> </span><a href="mailto:comercial@ypytecnologia.com.br" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">comercial@ypytecnologia.com.br</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"><br>
<b>Subject:</b> Re: [Freeswitch-users] Playback within condition</span><span style="font-family:"Calibri",sans-serif;color:black">
</span><span style="color:black"><o:p></o:p></span></p>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">look at the log generated by calling this. What order do the dial plan apps show up? Does the playback show up? what do the logs show it doing when it executes that playback?
</span><span style="color:black"><o:p></o:p></span></p>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">On Sep 22, 2016, at 1:06 PM, Caio Assis <</span><a href="mailto:caioebassis@hotmail.com" target="_blank"><span style="font-family:"Calibri",sans-serif">caioebassis@hotmail.com</span></a><span style="font-family:"Calibri",sans-serif;color:black">>
wrote:</span><span style="color:black"><o:p></o:p></span></p>
</div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">Hi.</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">Here's what I'm trying to do. I want to play a sound if a certain condition is true.</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"><extension name="test"></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <condition field="destination_number" expression="^1212$"></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <condition field="${cond(${destination_number} == 1212 ? 1212 : 0000)}" expression="^1212$"></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <!-- this second condition is just to ilustrate the nested condition--></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="log" data="INFO LOG"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="playback" data="sound1.gsm"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </condition></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="playback" data="sound2.gsm"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> <action application="hangup"/></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </condition></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black"></extension></span><span style="color:black"><o:p></o:p></span></p>
</div>
<p><span style="font-family:"Calibri",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p><span style="font-family:"Calibri",sans-serif;color:black">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?</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
<p><span style="color:black"><br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
</span><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><span style="color:black"><br>
</span><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><span style="color:black"><br>
<br>
Official FreeSWITCH Sites<br>
</span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><span style="color:black"><br>
</span><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><span style="color:black"><br>
</span><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><span style="color:black"><br>
<br>
FreeSWITCH-users mailing list<br>
</span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><span style="color:black"><br>
</span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><span style="color:black"><br>
UNSUBSCRIBE:</span><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><span style="color:black"><br>
</span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><span style="color:black"><o:p></o:p></span></p>
</blockquote>
</div>
<p><span style="color:black"> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>