<div>Hi Chris</div>
<div> </div>
<div>That seemed to work I got audio in both scnearios, in the XML and LUA script.</div>
<div> </div>
<div>so the only difference between my originial issue and the successful moh test. is that I was trying to playback a file and here we are playing a local stream://moh.</div>
<div> </div>
<div>I have changed all the files too chmod 777, is there any thing else on the rights point of view that I need to know in order to get it to work? </div>
<div> </div>
<div>I am grateful for any ideas or anything else that could help me understand what the issue is</div>
<div> </div>
<div>thanks</div>
<div>Marc</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Sat, Dec 18, 2010 at 8:42 AM, Chris Burns <span dir="ltr">&lt;<a href="mailto:chris@cloudtel.com">chris@cloudtel.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hmmm no help for you yet huh ... you may have solved it on your own already, but ...<br><br>You want to answer the call there, and not pre-answer. Pre-answer is for early media, which is for exchanging media before committing to answer the call. Admittedly you should hear something either way, but you definitely want to answer the call in your case. If your XML dialplan works as you said, you should compare the log output between these 2 extensions:<br>
<br>&lt;extension name=&quot;testXML&quot;&gt;<br>  &lt;condition field=&quot;destination_number&quot; expression=&quot;^9001$&quot;&gt;<br>    &lt;action application=&quot;answer&quot;/&gt;<br>    &lt;action application=&quot;playback&quot; data=&quot;local_stream://moh&quot;/&gt;<br>
  &lt;/condition&gt;<br>&lt;/extension&gt;<br><br>&lt;extension name=&quot;testLUA&quot;&gt;<br>  &lt;condition field=&quot;destination_number&quot; expression=&quot;^9002$&quot;&gt;<br>    &lt;action application=&quot;lua&quot; data=&quot;test.lua&quot;/&gt;<br>
  &lt;/condition&gt;<br>&lt;/extension&gt;<br><br>Contents of test.lua:<br>session:answer();<br>session:execute(&quot;playback&quot;,&quot;local_stream://moh&quot;);<br><br><br>
<div class="gmail_quote">
<div>
<div></div>
<div class="h5">On Wed, Dec 15, 2010 at 1:59 AM, Marc de Corny <span dir="ltr">&lt;<a href="mailto:marcdecorny@gmail.com" target="_blank">marcdecorny@gmail.com</a>&gt;</span> wrote:<br></div></div>
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">Hi all,<br> <br>I have run into an issue on something so basic that I must be as simple as enabling a feature somewhere.<br> <br>I have been trying to get lua to play a message from a WAV file. I have tried session:execute(&quot;playback&quot;, main_msg) and session:streamFile(ivr_invalid_msg) but neither of them play any music to the caller. I tried both to answer and preAnswer the call first but it made no difference. However if I put the same file into the XML dialplan and play it with the commands below I hear the music fine. <br>
&lt;action application=&quot;set&quot; data=&quot;playback_terminators=#&quot;/&gt;<br>&lt;action application=&quot;playback&quot; data=&quot;${401_sound_file_path}&quot;/&gt;<br> <br>The issue only seems to be from lua when playing any type of wav file and those files are definitelly there as can be read by the XML<br>
 <br>The error message is below for the execute(playback) command, but nothing can be seen for the <br>2010-12-01 11:56:01.534727 [DEBUG] switch_core_session.c:1827 Application playback Requires media! pre_answering channel <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> playback(/usr/local/freeswitch/sounds/svc_sound_files/default_autoattendant.wav)<br>
But there is no mention of the streamFile command. I have had similar issue with the PlayAndGetDigits command.<br>Is there something that I need to enable in lua so that is can playback messages to the caller.<br> <br>Many thanks to anyone who can help.<br>
Marc<br> <br> <br>below is the XML dialplan and lua script as well as the log at the very end.<br> <br>XML DIALPLAN:<br>&lt;include&gt;<br>&lt;extension name=&quot;IVR_FROM_MYSQL&quot;&gt;<br>&lt;condition field=&quot;caller_id_number&quot; expression=&quot;Anonymous&quot; break=&quot;never&quot;&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=0000000000&quot;/&gt;<br>&lt;/condition&gt;<br>&lt;condition field=&quot;destination_number&quot; expression=&quot;^(404)&quot;&gt;<br>&lt;action inline=&quot;true&quot; application=&quot;lua&quot; data=&quot;ivr_mysql.lua ${destination_number:3}&quot;/&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${404_tag}&quot;/&gt;<br>&lt;action application=&quot;bridge&quot; data=&quot;${404_dial}&quot;/&gt;<br>&lt;/condition&gt;<br>&lt;/extension&gt;<br>
&lt;/include&gt;<br> <br>The LUA script ivr_mysql.lua is callsed and this is it.<br>-- IVR : PLAY IVR WAV FILES <br>-- Global Variables:<br>local dialstr_prefix = &quot;sofia/gateway/CS2k/&quot;<br>local dialstr_main = &quot;&quot;<br>
local breakoutcode = &quot;184&quot;<br>local sound_file_folder = &quot;/usr/local/freeswitch/sounds/svc_sound_files/&quot;<br>local ddi = argv[1]<br>-- answer the call<br>session:preAnswer();<br>freeswitch.consoleLog(&quot;info&quot;, &quot;All Answered\n&quot;); <br>
ivr_invalid_msg = sound_file_folder .. &quot;invalid_msg.wav&quot;<br>main_msg = sound_file_folder .. &quot;default_autoattendant.wav&quot;<br>-- Play with Execute<br>session:execute(&quot;playback&quot;, main_msg)<br>-- Play with StreamFile<br>
session:streamFile(ivr_invalid_msg);<br>dialstr_main  = dialstr_main .. dialstr_prefix .. breakoutcode .. &quot;02031701665&quot;<br>session:setVariable(&quot;404_dial&quot;,dialstr_main)<br>session:setVariable(&quot;404_tag&quot;,&quot;IVR&quot;)<br>
 <br> <br>RELEVANT LOGS :<br>Dialplan: <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> Regex (PASS) [IVR_FROM_MYS                          QL] destination_number(4042031956241) =~ /^(404)/ break=on-false<br>
Dialplan: <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> Action lua(ivr_mysql.lua $                          {destination_number:3}) INLINE<br>
EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> lua(ivr_mysql.lua 2031956241                          )<br>2010-12-01 11:56:01.525426 [INFO] switch_cpp.cpp:584 Sending early media<br>
2010-12-01 11:56:01.525426 [DEBUG] sofia_glue.c:2972 AUDIO RTP [sofia/external/2                          <a href="mailto:031701665@194.0.147.16:5060" target="_blank">031701665@194.0.147.16:5060</a>] 10.5.2.105 port 29900 -&gt; 194.0.147.164 port 50202 c                          odec: 8 ms: 20<br>
2010-12-01 11:56:01.525426 [DEBUG] switch_rtp.c:1418 Starting timer [soft] 160 b                          ytes per 20ms<br>2010-12-01 11:56:01.532280 [DEBUG] sofia_glue.c:3190 Set 2833 dtmf send payload                           to 101<br>
2010-12-01 11:56:01.532280 [DEBUG] sofia_glue.c:3195 Set 2833 dtmf receive paylo                          ad to 101<br>2010-12-01 11:56:01.532280 [DEBUG] mod_sofia.c:2172 Ring SDP:<br>v=0<br>o=FreeSWITCH 1291174661 1291174662 IN IP4 10.5.2.105<br>
s=FreeSWITCH<br>c=IN IP4 10.5.2.105<br>t=0 0<br>m=audio 29900 RTP/AVP 8 101<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-16<br>a=silenceSupp:off - - - -<br>a=ptime:20<br>a=sendrecv<br>2010-12-01 11:56:01.532280 [NOTICE] mod_sofia.c:2175 Pre-Answer sofia/external/2                          <a href="mailto:031701665@194.0.147.16:5060" target="_blank">031701665@194.0.147.16:5060</a>!<br>
2010-12-01 11:56:01.532280 [DEBUG] switch_channel.c:2544 (sofia/external/2031701                          <a href="mailto:665@194.0.147.16:5060" target="_blank">665@194.0.147.16:5060</a>) Callstate Change RINGING -&gt; EARLY<br>
2010-12-01 11:56:01.534727 [DEBUG] sofia.c:4576 Channel sofia/external/203170166                          <a href="mailto:5@194.0.147.16:5060" target="_blank">5@194.0.147.16:5060</a> skipping state [early][183]<br>2010-12-01 11:56:01.534727 [DEBUG] switch_core_session.c:676 Send signal sofia/e                          <a href="mailto:xternal/2031701665@194.0.147.16:5060" target="_blank">xternal/2031701665@194.0.147.16:5060</a> [BREAK]<br>
2010-12-01 11:56:01.534727 [INFO] switch_cpp.cpp:1181 All Answered<br>2010-12-01 11:56:01.534727 [DEBUG] switch_core_session.c:1827 Application playba                          ck Requires media! pre_answering channel <a href="mailto:sofia/external/2031701665@194.0.147.16" target="_blank">sofia/external/2031701665@194.0.147.16</a>:                          5060<br>
EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> playback(/usr/local/freeswit                          ch/sounds/svc_sound_files/default_autoattendant.wav)<br>
2010-12-01 11:56:01.537644 [DEBUG] switch_cpp.cpp:972 sofia/external/2031701665@                          <a href="http://194.0.147.16:5060/" target="_blank">194.0.147.16:5060</a> destroy/unlink session from object<br>Dialplan: <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> Action set(effective_calle                          r_id_name=${404_tag})<br>
Dialplan: <a href="mailto:sofia/external/2031701665@194.0.147.16:5060" target="_blank">sofia/external/2031701665@194.0.147.16:5060</a> Action bridge(${404_dial})                          <br>2010-12-01 11:56:01.537644 [DEBUG] switch_core_state_machine.c:119 (sofia/extern                          <a href="mailto:al/2031701665@194.0.147.16:5060" target="_blank">al/2031701665@194.0.147.16:5060</a>) State Change CS_ROUTING -&gt; CS_EXECUTE<br>
2010-12-01 11:56:01.537644 [DEBUG] switch_core_session.c:1057 Send signal sofia/                          <a href="mailto:external/2031701665@194.0.147.16:5060" target="_blank">external/2031701665@194.0.147.16:5060</a> [BREAK] <br>
</div></div>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>