[Freeswitch-users] Kill lua script from CLI

Anthony Minessale anthony.minessale at gmail.com
Tue Jan 29 20:41:58 MSK 2013


Here is a trick you can do that kind of created itself through evolution.

Use the loopback channel to execute the script and name it a job name with
a variable

// Enter this from the cli (depending on where you call it from you may not
need to escape the commas but // from the cli you will for sure.

originate loopback/set:job=1234\,answer\,park/default/inline lua:loop.lua
inline

switch_ivr.c:1801 Transfer loopback/set:job=loop.lua,answer,park-a to
inline[lua:loop.lua at default]



// now your script is running in the dummy channel and you can hang it up
whenever you want by killing the uuid or calling "hupall manager_request
job loop.lua"


hupall manager_request job loop.lua
+OK hangup all channels matching [job]=[loop.lua] with cause:
MANAGER_REQUEST







On Tue, Jan 29, 2013 at 9:14 AM, Steven Ayre <steveayre at gmail.com> wrote:

> No. LUA doesn't have any job control right now.
>
> Any scripts you have running should be looping checking a condition. For
> scripts run on calls only loop while session:ready(), you can then hangup
> the call (eg from cli) and that would break the loop and end the script.
>
> For ones started at startup you need to have them check for a stop event,
> there are examples around.
>
> -Steve
>
>
>
> On 29 January 2013 10:18, Carlo Dimaggio <jaasmailing at gmail.com> wrote:
>
>>  Hi all,
>>
>> is there any way to kill a lua script from FS CLI?
>> I have some scripts that loop internally and I want to stop them.
>>
>>
>> Regards,
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.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://wiki.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
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
googletalk:conf+888 at conference.freeswitch.org
pstn:+19193869900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130129/6d47c73f/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list