[Freeswitch-users] lua script unable to stop moh

CT Radu ct.radu.001 at gmail.com
Fri Feb 13 10:54:32 MSK 2015


Anyone with mod_lua knowledge around here ?

Thanks,
Costin

2015-02-11 11:57 GMT+02:00 CT Radu <ct.radu.001 at gmail.com>:

> Hi all,
>
> I have the following problem:
> I have an dialplan rule in freeswitch that delegates the control for the
> incoming call on a specific number to an erlang application.
> This erlang application, at one point executes a lua script using the call:
> {api, luarun, "luascript.lua uuid"}
>
> In lua I do the following:
> api = freeswitch.API();
> session = freeswitch.session(argv[1]);
>
> uuid = session:get_uuid();
>
> if session:ready() then
>    uuid_break_cmd = "uuid_break ".. uuid .. " all";
>    uuid_hold_cmd  = "uuid_hold off" .. uuid;
>    freeswitch.consoleLog("notice","uuid break cmd: ".. uuid_break_cmd ..
> "\n");
>    session:execute("break","all");
>    api:executeString(uuid_break_cmd);
>    reply = api:executeString(uuid_break_cmd);
>
>    freeswitch.consoleLog("notice", "After uuid_break.\n");
> end
>
> The thing is that freeswitch ignores completly uuid_break and uuid_hold off
> The same command issued via fs_cli has effect.
>
> In fs_cli on debug I can see this:
> 2015-02-10 20:23:51.405153 [NOTICE] switch_cpp.cpp:1328 uuid break cmd:
> uuid_break f36d5e5c-b151-11e4-9674-8f19f7458942 all
> EXECUTE sofia/ctradu-dev.ezuce.ro/1002 at ctradu-dev.ezuce.ro break(all)
> 2015-02-10 20:23:51.405153 [DEBUG] mod_erlang_event.c:169 Ignoring event
> CHANNEL_EXECUTE for attached session f36d5e5c-b151-11e4-9674-8f19f7458942
> 2015-02-10 20:23:51.405153 [DEBUG] mod_erlang_event.c:169 Ignoring event
> CHANNEL_EXECUTE_COMPLETE for attached session
> f36d5e5c-b151-11e4-9674-8f19f7458942
> 2015-02-10 20:23:51.405153 [NOTICE] switch_cpp.cpp:1328 After uuid_break.
>
> Does anyone know why uuid_break has no effect executed from a script
> launched via api luarun ?
> (And the same command when issued via fs_cli has effect)
>
> The freeswitch version is 1.4.15~64bit
>
> Thank you,
> Costin
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150213/67cb2e01/attachment.html 


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