Running LUA script asynchronously?
Hi, I would like to add a small functionality to our PBX: when someone calls an emergency number, in parallel to the call, an Email will be sent to our security personel, and a call will be initiated to the security center telling them that extension XXX called an emergency number. I would like this process to run in parallel to the original call. How can I do it? - I prefer calling a LUA script from the dialplan, but it will stall the user's call; can it be run in parallel? - If not, I'll probably use ESL. What is the best event filter string to get informed only about call initiation? Thanks! __Yehavi:
If your use case involves re-invite you can look into https://wiki.freeswitch.org/wiki/Variable_execute_on_sip_reinvite On Tue, Jun 30, 2015 at 10:41 AM, Yehavi Bourvine <yehavi.bourvine@gmail.com
wrote:
Hi,
I would like to add a small functionality to our PBX: when someone calls an emergency number, in parallel to the call, an Email will be sent to our security personel, and a call will be initiated to the security center telling them that extension XXX called an emergency number.
I would like this process to run in parallel to the original call. How can I do it?
- I prefer calling a LUA script from the dialplan, but it will stall the user's call; can it be run in parallel? - If not, I'll probably use ESL. What is the best event filter string to get informed only about call initiation?
Thanks! __Yehavi:
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
you can have an ESL listener, subscribing to the channel initiation event (CHANNEL_CALLSTATE or CHANNEL_ANSWER), or you can use the "system" application which would run a small shell script, and that script would start a process in background. The first option is much safer. In the second option, you need to watch out that the process UID and priority are not destroying the system. On Tue, Jun 30, 2015 at 7:11 AM, Yehavi Bourvine <yehavi.bourvine@gmail.com> wrote:
Hi,
I would like to add a small functionality to our PBX: when someone calls an emergency number, in parallel to the call, an Email will be sent to our security personel, and a call will be initiated to the security center telling them that extension XXX called an emergency number.
I would like this process to run in parallel to the original call. How can I do it?
- I prefer calling a LUA script from the dialplan, but it will stall the user's call; can it be run in parallel? - If not, I'll probably use ESL. What is the best event filter string to get informed only about call initiation?
Thanks! __Yehavi:
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
You execute "luarun script.lua argument1 argument2", and the script will be executed in its own thread. You can execute luarun from a lua script too. -giovanni On Tue, Jun 30, 2015 at 8:00 AM, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
you can have an ESL listener, subscribing to the channel initiation event (CHANNEL_CALLSTATE or CHANNEL_ANSWER), or you can use the "system" application which would run a small shell script, and that script would start a process in background.
The first option is much safer. In the second option, you need to watch out that the process UID and priority are not destroying the system.
On Tue, Jun 30, 2015 at 7:11 AM, Yehavi Bourvine <yehavi.bourvine@gmail.com> wrote:
Hi,
I would like to add a small functionality to our PBX: when someone calls an emergency number, in parallel to the call, an Email will be sent to our security personel, and a call will be initiated to the security center telling them that extension XXX called an emergency number.
I would like this process to run in parallel to the original call. How can I do it?
- I prefer calling a LUA script from the dialplan, but it will stall the user's call; can it be run in parallel? - If not, I'll probably use ESL. What is the best event filter string to get informed only about call initiation?
Thanks! __Yehavi:
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@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@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@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
participants (4)
-
Giovanni Maruzzelli
-
John Nash
-
Stanislav Sinyagin
-
Yehavi Bourvine