<p>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">sofia/external/2031701665@194.0.147.16:5060</a> EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060">sofia/external/2031701665@194.0.147.16:5060</a> playback(/usr/local/freeswitch/sounds/svc_sound_files/default_autoattendant.wav)</p>

<p>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.</p>
<p> <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;); </p>

<p>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">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">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">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">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">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">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">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">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">sofia/external/2031701665@194.0.147.16</a>:                          5060<br>
EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060">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">194.0.147.16:5060</a> destroy/unlink session from object<br>Dialplan: <a href="mailto:sofia/external/2031701665@194.0.147.16:5060">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">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">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">external/2031701665@194.0.147.16:5060</a> [BREAK]</p>