[Freeswitch-users] Dynamic return call (callback)

Gabriel Bustos gabriel at pinaculo.com.br
Tue May 10 21:06:10 MSD 2016


Worked like a charm.

Thank you so much!

2016-05-10 13:21 GMT-03:00 Michael Jerris <mike at jerris.com>:

> then you'll need to schedule out making this fall until after this one is
> hung up?  it's a bit hack but you could use sched_api?
>
>
>
> https://freeswitch.org/confluence/display/FREESWITCH/mod_commands#mod_commands-sched_api
>
> On Tuesday, May 10, 2016, Gabriel Bustos <gabriel at pinaculo.com.br> wrote:
>
>> Hi,
>>
>> thanks for your reply.
>> Actually I already tried your suggestion. What I tested was:
>>
>> <action application="set" data="api_hangup_hook=originate
>> gsmopen/ANY/${number} &bridge(user/${redirect_to})"/>
>>
>> I'm not sure but I guess when the session is hanged up it also hangup the
>> one that I'm trying to originate on hangup hook. Also, as you can see I'm
>> using mod_gsmopen and I have only one interface available for
>> incoming/outgoing calls.
>>
>>
>>
>> 2016-05-10 3:26 GMT-03:00 Michael Jerris <mike at jerris.com>:
>>
>>> if the first one works but just calls the parties in reverse, just swap
>>> them
>>>
>>>
>>> On Monday, May 9, 2016, Gabriel Bustos <gabriel at pinaculo.com.br> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm trying to implement a callback (for specific numbers) in my project.
>>>>
>>>> What I need to do is hangup the incoming call and return to that
>>>> number. What I tried is this:
>>>>
>>>> <action application="set" data="api_hangup_hook=originate
>>>> user/${redirect_to} &bridge(gsmopen/ANY/${number})"/>
>>>>
>>>> Actually this works (sort of), it originates a call in softphone and
>>>> when I answer the softphone the call to destination number is made.
>>>>
>>>> BUT what I need is to call to destination number and bridge to
>>>> softphone when the call is answered. And here is where I'm having problems.
>>>>
>>>> My last attempt was calling a lua script who fires a custom event, like
>>>> this:
>>>>
>>>> <action application="set" data="api_hangup_hook=${lua(websip/teste.lua
>>>> ${caller_id_number})}"/>
>>>>
>>>> teste.lua:
>>>> function fireEvent()
>>>>     local event = freeswitch.Event("CUSTOM", "Gateway::Callback")
>>>>     event:addHeader("My-Header", "test")
>>>>     event:addBody("EventTest")
>>>>     session:sendEvent(event)
>>>>     --event:fire();
>>>> end
>>>> fireEvent()
>>>>
>>>> Ok, the event is fired as I can see in CLI but I think the event hook
>>>> doesn't work.
>>>>
>>>> This is the line from lua.conf:
>>>> <hook envent="CUSTOM" subclass="Gateway::Callback"
>>>> script="testecallback.lua"/>
>>>>
>>>> Can you help me telling me if I'm the right path or if there's a better
>>>> way to do that?
>>>>
>>>> Thanks in advance.
>>>>
>>>
>>> _________________________________________________________________________
>>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160510/78730027/attachment.html 


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