[Freeswitch-users] lua script unable to stop moh

Brian West brian at freeswitch.org
Fri Feb 13 17:47:19 MSK 2015


Are you trying to use uuid_hold to just play hold music to your calling
party?

On Fri, Feb 13, 2015 at 7:24 AM, CT Radu <ct.radu.001 at gmail.com> wrote:

> Tried with executeString, tried with execute,  and still does not work.
> And even if I've set freeswitch on debug, I didn't get anything relevant.
>
> Thanks,
> Costin-Tiberiu
>
>
>
> 2015-02-13 11:39 GMT+02:00 Giovanni Maruzzelli <gmaruzz at gmail.com>:
>
>> (use executeString instead of execute when you give arguments in string,
>> my typo):
>>
>> api:execute("break","all");
>> api:executeString(uuid_break_cmd);
>> reply = api:executeString(uuid_break_cmd);
>>
>>
>> On Fri, Feb 13, 2015 at 10:31 AM, Giovanni Maruzzelli <gmaruzz at gmail.com>
>> wrote:
>>
>>> From lua, you better do (eg: no need for "session"):
>>>
>>> api = freeswitch.API();
>>> uuid = argv[1]
>>>
>>>
>>> uuid_break_cmd = "uuid_break ".. uuid .. " all";
>>> uuid_hold_cmd  = "uuid_hold off" .. uuid;
>>>
>>> freeswitch.consoleLog("notice","uuid break cmd: ".. uuid_break_cmd ..
>>> "\n");
>>>
>>> api:execute("break","all");
>>> api:execute(uuid_break_cmd);
>>>
>>> reply = api:execute(uuid_break_cmd);
>>>
>>> freeswitch.consoleLog("notice", "After uuid_break.\n");
>>>
>>>
>>> On Fri, Feb 13, 2015 at 10:05 AM, Борисов, Дмитрий / Dmitriy Borisov <
>>> bordmi at rarus.ru> wrote:
>>>
>>>>
>>>> https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-freeswitch.Session
>>>> :
>>>> freeswitch.Session
>>>>
>>>> Create a new session.
>>>> local session = freeswitch.Session("sofia/10.0.1.100/1001");
>>>> session:transfer("3000", "XML", "default");
>>>> What you want to do with lua script?
>>>>
>>>>
>>>> 2015-02-13 10:54 GMT+03:00 CT Radu <ct.radu.001 at gmail.com>:
>>>>
>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _________________________________________________________________________
>>>>> Professional FreeSWITCH Consulting Services:
>>>>> consulting at freeswitch.org
>>>>> http://www.freeswitchsolutions.com
>>>>>
>>>>> Official FreeSWITCH Sites
>>>>> http://www.freeswitch.org
>>>>> http://confluence.freeswitch.org
>>>>> http://www.cluecon.com
>>>>>
>>>>> FreeSWITCH-users mailing list
>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>> UNSUBSCRIBE:
>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>> http://www.freeswitch.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> with best regards,
>>>> Dmitriy Borisov
>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://confluence.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>
>>>
>>>
>>> --
>>> Sincerely,
>>>
>>> Giovanni Maruzzelli
>>> Cell : +39-347-2665618
>>>
>>
>>
>>
>> --
>> Sincerely,
>>
>> Giovanni Maruzzelli
>> Cell : +39-347-2665618
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 

*Brian West*
brian at freeswitch.org


*Twitter: @FreeSWITCH , @briankwest*
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

*T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378)
*iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150213/d63e0557/attachment.html 


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