[Freeswitch-users] How to manipulate a call after bridge

Jurijs Ivolga jurij.ivo at gmail.com
Tue Aug 18 17:15:10 MSD 2015


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 at 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 at 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 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
>>
>
>
>
> --
> Ítalo Rossi
>
> _________________________________________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150818/04d3bd68/attachment-0001.html 


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