<div dir="ltr">But "inline" directive force FS to run script on hunting phase<div><br></div><div>My yesturday`s sunday have died with this issue... :(</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-08 10:14 GMT+03:00 Борисов, Дмитрий <span dir="ltr"><<a href="mailto:bordmi@rarus.ru" target="_blank">bordmi@rarus.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In the hunting state of dialplan treatment FS doesn`t permit to work with media, only in execution state.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2014-12-08 9:12 GMT+03:00 Andrew Keil <span dir="ltr"><<a href="mailto:andrew.keil@visytel.com" target="_blank">andrew.keil@visytel.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div lang="EN-AU" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span style="color:#1f497d">To all,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Found the issue below:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Removed the inline=”true” from the xml dialplan and everything works as expected.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><action inline="true" application="lua" data="ASKTestLua.lua $2"/><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><action application="lua" data="ASKTestLua.lua $2"/><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Not sure why I put it there in the first place.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Sorry about that.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Andrew<u></u><u></u></span></p>
<p class="MsoNormal"><a name="14a28c03a253c3a9_14a28b77b490abba__MailEndCompose"><span style="color:#1f497d"><u></u> <u></u></span></a></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Andrew Keil
<br>
<b>Sent:</b> Monday, 8 December 2014 1:18 PM<br>
<b>To:</b> '<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>'<br>
<b>Subject:</b> Re- LUA audio playback on Windows 64bit not working?<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">To FreeSWITCH users,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am just starting to use Lua inside FreeSWITCH and I am having difficulty with playing back audio to the caller. It seems the Media is not ready or available even though I have answered the caller using session:answer().<u></u><u></u></p>
<p class="MsoNormal">It also seems that session:ready() always returns false after session:answer(). Very strange.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Version: FreeSWITCH 1.5.12b(64bit) on Windows 8.1 Pro (installed from freeswitch.msi) – default installation except for conf\vars.xml (default_password changed)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u>conf\dialplan\default\00_ASKTestLua.xml:<u></u><u></u></u></p>
<p class="MsoNormal"><include><u></u><u></u></p>
<p class="MsoNormal"> <!-- To test Lua script --><u></u><u></u></p>
<p class="MsoNormal"> <extension name="ivr_demo"><u></u><u></u></p>
<p class="MsoNormal"> <condition field="destination_number" expression="^(9101)$"><u></u><u></u></p>
<p class="MsoNormal"> <!-- <action application="answer"/> --><u></u><u></u></p>
<p class="MsoNormal"> <!-- <action application="sleep" data="1000"/> -->
<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:36.0pt"><!-- <action application="playback" data="ivr/ivr-welcome_to_freeswitch.wav"/> --><u></u><u></u></p>
<p class="MsoNormal"> <action inline="true" application="lua" data="ASKTestLua.lua $2"/><u></u><u></u></p>
<p class="MsoNormal"> </condition><u></u><u></u></p>
<p class="MsoNormal"> </extension><u></u><u></u></p>
<p class="MsoNormal"></include><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u>scripts\ASKTestLua.lua:<u></u><u></u></u></p>
<p class="MsoNormal">-- Test Lua application<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-- answer the call<u></u><u></u></p>
<p class="MsoNormal">session:answer();<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">session:sleep(1000);<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">prompt = "ivr/ivr-welcome_to_freeswitch.wav";<u></u><u></u></p>
<p class="MsoNormal">freeswitch.consoleLog("INFO", string.format("prompt: %s\n", prompt));<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">session:execute("playback",prompt);<u></u><u></u></p>
<p class="MsoNormal">--session:streamFile(prompt);<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">freeswitch.consoleLog("INFO", "Prompt played\n")<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-- hangup<u></u><u></u></p>
<p class="MsoNormal">session:hangup();<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Logs inside FS_CLI: 2014-12-08 12:44:15.002800 [DEBUG] switch_core_session.c:2725 Application playback Requires media! pre_answering channel
<a href="mailto:sofia/internal/1000@192.168.15.74" target="_blank">sofia/internal/1000@192.168.15.74</a><u></u><u></u></p>
<p class="MsoNormal">EXECUTE <a href="mailto:sofia/internal/1000@192.168.15.74" target="_blank">sofia/internal/1000@192.168.15.74</a> playback(ivr/ivr-welcome_to_freeswitch.wav)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">vs.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">conf\dialplan\default\00_ASKTestLua.xml:<u></u><u></u></p>
<p class="MsoNormal"><include><u></u><u></u></p>
<p class="MsoNormal"> <!-- To test Lua script --><u></u><u></u></p>
<p class="MsoNormal"> <extension name="ivr_demo"><u></u><u></u></p>
<p class="MsoNormal"> <condition field="destination_number" expression="^(9101)$"><u></u><u></u></p>
<p class="MsoNormal"> <action application="answer"/><u></u><u></u></p>
<p class="MsoNormal"> <action application="sleep" data="1000"/> <u></u>
<u></u></p>
<p class="MsoNormal" style="text-indent:36.0pt"><action application="playback" data="ivr/ivr-welcome_to_freeswitch.wav"/><u></u><u></u></p>
<p class="MsoNormal"> <!-- <action inline="true" application="lua" data="ASKTestLua.lua $2"/> --><u></u><u></u></p>
<p class="MsoNormal"> </condition><u></u><u></u></p>
<p class="MsoNormal"> </extension><u></u><u></u></p>
<p class="MsoNormal"></include><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Which works!! However this is not using Lua.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have tried using “session:streamFile(prompt);” instead of “session:execute("playback",prompt);” and this also does not work.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would appreciate any insight into why this is happening. <u></u>
<u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span>Kind Regards,<span><font color="#888888"><u></u><u></u></font></span></span></p><span><font color="#888888">
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Andrew Keil<u></u><u></u></span></p>
</font></span></div>
</div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>with best regrds,</div><div>Dmitriy Borisov</div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>with best regrds,</div><div>Dmitriy Borisov</div></div></div></div></div>
</div>