if the first one works but just calls the parties in reverse, just swap them<span></span><br><br>On Monday, May 9, 2016, Gabriel Bustos <<a href="mailto:gabriel@pinaculo.com.br">gabriel@pinaculo.com.br</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<br><br>I'm trying to implement a callback (for specific numbers) in my project.<br><br>What I need to do is hangup the incoming call and return to that number. What I tried is this:<br><br><action application="set" data="api_hangup_hook=originate user/${redirect_to} &bridge(gsmopen/ANY/${number})"/><br><br>Actually this works (sort of), it originates a call in softphone and when I answer the softphone the call to destination number is made. <br><br>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.<br><br>My last attempt was calling a lua script who fires a custom event, like this:<br><br><action application="set" data="api_hangup_hook=${lua(websip/teste.lua ${caller_id_number})}"/><br><br>teste.lua:<br>function fireEvent()<br> local event = freeswitch.Event("CUSTOM", "Gateway::Callback")<br> event:addHeader("My-Header", "test")<br> event:addBody("EventTest")<br> session:sendEvent(event)<br> --event:fire();<br>end<br>fireEvent()<br><br>Ok, the event is fired as I can see in CLI but I think the event hook doesn't work.<br><br>This is the line from lua.conf:<br><hook envent="CUSTOM" subclass="Gateway::Callback" script="testecallback.lua"/><br><br>Can you help me telling me if I'm the right path or if there's a better way to do that?<br><br>Thanks in advance.<br></div>
</blockquote>