[Freeswitch-users] Re- LUA audio playback on Windows 64bit not working? (FOUND & FIXED)

Andrew Keil andrew.keil at visytel.com
Mon Dec 8 09:12:59 MSK 2014


To all,

Found the issue below:

Removed the inline="true" from the xml dialplan and everything works as expected.

<action inline="true" application="lua" data="ASKTestLua.lua $2"/>

Now:

<action application="lua" data="ASKTestLua.lua $2"/>

Not sure why I put it there in the first place.

Sorry about that.

Andrew

From: Andrew Keil
Sent: Monday, 8 December 2014 1:18 PM
To: 'freeswitch-users at lists.freeswitch.org'
Subject: Re- LUA audio playback on Windows 64bit not working?

To FreeSWITCH users,

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().
It also seems that session:ready() always returns false after session:answer().  Very strange.

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)

conf\dialplan\default\00_ASKTestLua.xml:
<include>
    <!-- To test Lua script  -->
    <extension name="ivr_demo">
      <condition field="destination_number" expression="^(9101)$">
                <!-- <action application="answer"/> -->
                <!-- <action application="sleep" data="1000"/> -->
<!-- <action application="playback" data="ivr/ivr-welcome_to_freeswitch.wav"/> -->
                <action inline="true" application="lua" data="ASKTestLua.lua $2"/>
      </condition>
    </extension>
</include>

scripts\ASKTestLua.lua:
-- Test Lua application

-- answer the call
session:answer();

session:sleep(1000);

prompt = "ivr/ivr-welcome_to_freeswitch.wav";
freeswitch.consoleLog("INFO", string.format("prompt: %s\n", prompt));

session:execute("playback",prompt);
--session:streamFile(prompt);

freeswitch.consoleLog("INFO", "Prompt played\n")

-- hangup
session:hangup();


Logs inside FS_CLI: 2014-12-08 12:44:15.002800 [DEBUG] switch_core_session.c:2725 Application playback Requires media! pre_answering channel sofia/internal/1000 at 192.168.15.74<mailto:sofia/internal/1000 at 192.168.15.74>
EXECUTE sofia/internal/1000 at 192.168.15.74<mailto:sofia/internal/1000 at 192.168.15.74> playback(ivr/ivr-welcome_to_freeswitch.wav)

vs.

conf\dialplan\default\00_ASKTestLua.xml:
<include>
    <!-- To test Lua script  -->
    <extension name="ivr_demo">
      <condition field="destination_number" expression="^(9101)$">
                <action application="answer"/>
                <action application="sleep" data="1000"/>
<action application="playback" data="ivr/ivr-welcome_to_freeswitch.wav"/>
                <!-- <action inline="true" application="lua" data="ASKTestLua.lua $2"/> -->
      </condition>
    </extension>
</include>

Which works!!  However this is not using Lua.

I have tried using "session:streamFile(prompt);" instead of "session:execute("playback",prompt);" and this also does not work.

I would appreciate any insight into why this is happening.

Kind Regards,

Andrew Keil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141208/7e6b68d3/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list