How to manipulate a call after bridge
Hi, I have quite simple task: I need to call from ext 1000 to ext 1001, after ext 1001 pick-up phone, I need to be able to listen for DTMF and based on DTMF I need to fire some commands in LUA. I tried following code in LUA: api = freeswitch.API() did = session:getVariable("destination_number") domain = session:getVariable("domain_name") session:execute("bridge", "user/".. did .. "@" .. domain) freeswitch.consoleLog("INFO","Called Number " .. did .. "\n") But I can do anything with a call only when destination hang-up. For example Called number will be displayed only after destination ext will hang-up. Is there any possibility to achieve this with LUA script? With kind regards, Jurijs
session:execute("bridge", "user/".. did .. "@" .. domain) will block, if you need to execute actions upon DTMF pressing you can use https://freeswitch.org/confluence/display/FREESWITCH/bind_meta_app and execute an application or call another lua script that does what you want. If you don't want to block you can create a new session, like: new_session = freeswitch.Session("sofia/user" .. did .. "@" .. domain) execute more commands and then: freeswitch.bridge(session, new_session) instead of using session:execute("bridge" ... On Tue, Aug 18, 2015 at 6:21 AM, Jurijs Ivolga <jurij.ivo@gmail.com> wrote:
Hi,
I have quite simple task:
I need to call from ext 1000 to ext 1001, after ext 1001 pick-up phone, I need to be able to listen for DTMF and based on DTMF I need to fire some commands in LUA.
I tried following code in LUA:
api = freeswitch.API()
did = session:getVariable("destination_number") domain = session:getVariable("domain_name")
session:execute("bridge", "user/".. did .. "@" .. domain)
freeswitch.consoleLog("INFO","Called Number " .. did .. "\n")
But I can do anything with a call only when destination hang-up. For example Called number will be displayed only after destination ext will hang-up.
Is there any possibility to achieve this with LUA script?
With kind regards,
Jurijs
_________________________________________________________________________ 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
-- Ítalo Rossi
Hi, Thank you for an idea, but with your proposal I can run some additional commands only before bridge. In my case I need to execute some additional commands after bridge, after both call legs are connected and call is happening. Do you know how I can achieve this? With kind regards, Jurijs 2015-08-18 15:28 GMT+03:00 Ítalo Rossi <italorossib@gmail.com>:
session:execute("bridge", "user/".. did .. "@" .. domain)
will block, if you need to execute actions upon DTMF pressing you can use https://freeswitch.org/confluence/display/FREESWITCH/bind_meta_app and execute an application or call another lua script that does what you want.
If you don't want to block you can create a new session, like:
new_session = freeswitch.Session("sofia/user" .. did .. "@" .. domain)
execute more commands and then:
freeswitch.bridge(session, new_session)
instead of using session:execute("bridge" ...
On Tue, Aug 18, 2015 at 6:21 AM, Jurijs Ivolga <jurij.ivo@gmail.com> wrote:
Hi,
I have quite simple task:
I need to call from ext 1000 to ext 1001, after ext 1001 pick-up phone, I need to be able to listen for DTMF and based on DTMF I need to fire some commands in LUA.
I tried following code in LUA:
api = freeswitch.API()
did = session:getVariable("destination_number") domain = session:getVariable("domain_name")
session:execute("bridge", "user/".. did .. "@" .. domain)
freeswitch.consoleLog("INFO","Called Number " .. did .. "\n")
But I can do anything with a call only when destination hang-up. For example Called number will be displayed only after destination ext will hang-up.
Is there any possibility to achieve this with LUA script?
With kind regards,
Jurijs
_________________________________________________________________________ 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
-- Ítalo Rossi
_________________________________________________________________________ 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
Have you tried using execute_on_answer variable? Mike From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Jurijs Ivolga Sent: Tuesday, August 18, 2015 9:15 AM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] How to manipulate a call after bridge Hi, Thank you for an idea, but with your proposal I can run some additional commands only before bridge. In my case I need to execute some additional commands after bridge, after both call legs are connected and call is happening. Do you know how I can achieve this? With kind regards, Jurijs 2015-08-18 15:28 GMT+03:00 Ítalo Rossi <italorossib@gmail.com<mailto:italorossib@gmail.com>>: session:execute("bridge", "user/".. did .. "@" .. domain) will block, if you need to execute actions upon DTMF pressing you can use https://freeswitch.org/confluence/display/FREESWITCH/bind_meta_app and execute an application or call another lua script that does what you want. If you don't want to block you can create a new session, like: new_session = freeswitch.Session("sofia/user" .. did .. "@" .. domain) execute more commands and then: freeswitch.bridge(session, new_session) instead of using session:execute("bridge" ... On Tue, Aug 18, 2015 at 6:21 AM, Jurijs Ivolga <jurij.ivo@gmail.com<mailto:jurij.ivo@gmail.com>> wrote: Hi, I have quite simple task: I need to call from ext 1000 to ext 1001, after ext 1001 pick-up phone, I need to be able to listen for DTMF and based on DTMF I need to fire some commands in LUA. I tried following code in LUA: api = freeswitch.API() did = session:getVariable("destination_number") domain = session:getVariable("domain_name") session:execute("bridge", "user/".. did .. "@" .. domain) freeswitch.consoleLog("INFO","Called Number " .. did .. "\n") But I can do anything with a call only when destination hang-up. For example Called number will be displayed only after destination ext will hang-up. Is there any possibility to achieve this with LUA script? With kind regards, Jurijs _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto: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<mailto: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 -- Ítalo Rossi _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto: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<mailto: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
Hi, Actually it made a trick for me, my code: api = freeswitch.API() did = session:getVariable("destination_number") domain = session:getVariable("domain_name") masteruuid = session:getVariable("uuid") caller_id_number = session:getVariable("caller_id_number") freeswitch.consoleLog("INFO","UUID " .. masteruuid .. "\n") new_session = freeswitch.Session("{origination_caller_id_number=" .. caller_id_number .. "}sofia/internal/" .. did .. "%" .. domain) masteruuid_bleg = new_session:getVariable("uuid") freeswitch.consoleLog("INFO","UUID " .. masteruuid_bleg .. "\n") -- some additional stuff -- some additional stuff freeswitch.bridge(session, new_session) But now I do not hear ring-tone and when I cancel a call, it still rings on remote ext. Any hints? With kind regards, Jurijs 2015-08-18 16:29 GMT+03:00 Michael T Mowatt <mmowatt@nexxphase.com>:
Have you tried using execute_on_answer variable?
Mike
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Jurijs Ivolga *Sent:* Tuesday, August 18, 2015 9:15 AM *To:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Subject:* Re: [Freeswitch-users] How to manipulate a call after bridge
Hi,
Thank you for an idea, but with your proposal I can run some additional commands only before bridge.
In my case I need to execute some additional commands after bridge, after both call legs are connected and call is happening.
Do you know how I can achieve this?
With kind regards,
Jurijs
2015-08-18 15:28 GMT+03:00 Ítalo Rossi <italorossib@gmail.com>:
session:execute("bridge", "user/".. did .. "@" .. domain)
will block, if you need to execute actions upon DTMF pressing you can use https://freeswitch.org/confluence/display/FREESWITCH/bind_meta_app and execute an application or call another lua script that does what you want.
If you don't want to block you can create a new session, like:
new_session = freeswitch.Session("sofia/user" .. did .. "@" .. domain)
execute more commands and then:
freeswitch.bridge(session, new_session)
instead of using session:execute("bridge" ...
On Tue, Aug 18, 2015 at 6:21 AM, Jurijs Ivolga <jurij.ivo@gmail.com> wrote:
Hi,
I have quite simple task:
I need to call from ext 1000 to ext 1001, after ext 1001 pick-up phone, I need to be able to listen for DTMF and based on DTMF I need to fire some commands in LUA.
I tried following code in LUA:
api = freeswitch.API()
did = session:getVariable("destination_number") domain = session:getVariable("domain_name")
session:execute("bridge", "user/".. did .. "@" .. domain)
freeswitch.consoleLog("INFO","Called Number " .. did .. "\n")
But I can do anything with a call only when destination hang-up. For example Called number will be displayed only after destination ext will hang-up.
Is there any possibility to achieve this with LUA script?
With kind regards,
Jurijs
_________________________________________________________________________ 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
--
Ítalo Rossi
_________________________________________________________________________ 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
participants (3)
-
Jurijs Ivolga
-
Michael T Mowatt
-
Ítalo Rossi