<div>Hi Sam</div>
<div> </div>
<div>I tried your method with the sleep(100) in front, but it made no difference.</div>
<div> </div>
<div>I changed the lua script to :</div>
<div> </div>
<div>local ddi = argv[1]<br>-- answer the call<br>session:answer();<br>freeswitch.consoleLog("info", "All Answered\n");<br>-- sleep a second<br>session:sleep(100);</div>
<div>ivr_invalid_msg = sound_file_folder .. "invalid_msg.wav"<br>main_msg = sound_file_folder .. "default_autoattendant.wav"<br>-- Play with Execute<br><strong>session:execute("playback","/tmp/main.wav");</strong><br>
-- Play with StreamFile<br>session:streamFile(ivr_invalid_msg);<br>dialstr_main = dialstr_main .. dialstr_prefix .. breakoutcode .. "02031701665"</div>
<div> </div>
<div>In the logs I get </div>
<div> </div>
<div>2010-12-21 11:07:00.202821 [DEBUG] switch_core_session.c:1882 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><br>
EXECUTE <a href="mailto:sofia/external/2031701665@194.0.147.16:5060">sofia/external/2031701665@194.0.147.16:5060</a> playback(/tmp/main.wav)<br>2010-12-21 11:07:00.202821 [DEBUG] switch_cpp.cpp:972 <a href="mailto:sofia/external/2031701665@194.0.147.16:5060">sofia/external/2031701665@194.0.147.16:5060</a> destroy/unlink session from object<br>
</div>
<div>It is strange, because I can see that the command is being run, but as soon as it gets run, I get in the same millisecond a desctry/unlink which maybe exists the command.</div>
<div> </div>
<div>Are there any additional logs I can take to understand?</div>
<div> </div>
<div>thanks</div>
<div>Marc<br><br></div>
<div class="gmail_quote">On Sat, Dec 18, 2010 at 9:16 AM, Sam <span dir="ltr"><<a href="mailto:u2nsam@gmail.com">u2nsam@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">you can try this ...<br><br><br>session:answer();<br><br>-- sleep a second<br>session:sleep(100);<br><br>-- play a file<br>
session:streamFile("/usr/local/freeswitch/sounds/en/us/callie/conference/8000/conf-pin.wav");<br><br>Regards<br><font color="#888888">Sam</font>
<div>
<div></div>
<div class="h5"><br><br><br>
<div class="gmail_quote">On Sat, Dec 18, 2010 at 2:33 PM, Marc De Corny <span dir="ltr"><<a href="mailto:marcdecorny@gmail.com" target="_blank">marcdecorny@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div bgcolor="#FFFFFF">
<div>Thanks Chris, </div>
<div>Stil got issue unfortunately</div>
<div>i tried with both answer and preAnswer and got same results. I will post the logs of the two examples and see.</div>
<div>Thanks for following up on this.</div>
<div>Marc
<div>
<div></div>
<div><br><br>On 18 Dec 2010, at 08:42, Chris Burns <<a href="mailto:chris@cloudtel.com" target="_blank">chris@cloudtel.com</a>> wrote:<br><br></div></div></div>
<div>
<div></div>
<div>
<div></div>
<blockquote type="cite">
<div>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><extension name="testXML"><br> <condition field="destination_number" expression="^9001$"><br> <action application="answer"/><br> <action application="playback" data="local_stream://moh"/><br>
</condition><br></extension><br><br><extension name="testLUA"><br> <condition field="destination_number" expression="^9002$"><br> <action application="lua" data="test.lua"/><br>
</condition><br></extension><br><br>Contents of test.lua:<br>session:answer();<br>session:execute("playback","local_stream://moh");<br><br><br>
<div class="gmail_quote">On Wed, Dec 15, 2010 at 1:59 AM, Marc de Corny <span dir="ltr"><<a href="mailto:marcdecorny@gmail.com" target="_blank"></a><a href="mailto:marcdecorny@gmail.com" target="_blank">marcdecorny@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">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("playback", 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>
<action application="set" data="playback_terminators=#"/><br><action application="playback" data="${401_sound_file_path}"/><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><include><br><extension name="IVR_FROM_MYSQL"><br><condition field="caller_id_number" expression="Anonymous" break="never"><br>
<action application="set" data="effective_caller_id_number=0000000000"/><br></condition><br><condition field="destination_number" expression="^(404)"><br><action inline="true" application="lua" data="ivr_mysql.lua ${destination_number:3}"/><br>
<action application="set" data="effective_caller_id_name=${404_tag}"/><br><action application="bridge" data="${404_dial}"/><br></condition><br></extension><br>
</include><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 = "sofia/gateway/CS2k/"<br>local dialstr_main = ""<br>
local breakoutcode = "184"<br>local sound_file_folder = "/usr/local/freeswitch/sounds/svc_sound_files/"<br>local ddi = argv[1]<br>-- answer the call<br>session:preAnswer();<br>freeswitch.consoleLog("info", "All Answered\n"); <br>
ivr_invalid_msg = sound_file_folder .. "invalid_msg.wav"<br>main_msg = sound_file_folder .. "default_autoattendant.wav"<br>-- Play with Execute<br>session:execute("playback", main_msg)<br>-- Play with StreamFile<br>
session:streamFile(ivr_invalid_msg);<br>dialstr_main = dialstr_main .. dialstr_prefix .. breakoutcode .. "02031701665"<br>session:setVariable("404_dial",dialstr_main)<br>session:setVariable("404_tag","IVR")<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 -> 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 -> 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"></a><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 -> 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>
_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank"></a><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"></a><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"></a><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"></a><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br></blockquote></div><br></div></blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a></span><br>
<span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br>
<span><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a></span><br></div></blockquote></div></div></div><br>_______________________________________________<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></div></div><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>