mod lua session:bridged() not implemented?
Yes you are absolutelly right, maybe I might be looking at the wrong tool... I have tried several approaches but haven't found the right one... I don't only need to detect if a call was answered, but I need also to detect and log the failure cause in case the call was not answered. Which usually can be found in the originate_disposition variable... If I use a socket command: "bgapi originate {ignore_early_media=true,originate_timeout=10,api_hangup_hook='luarun cc.lua predictive_hangup'}sofia/gateway/gwname/13246789 9999" I cannot detect the originate_disposition variable in predictive_hangup() in lua, becouse the session is nil after hangup... I think I should start dialing out from the dialplan, but in this case how to call to the dialplan using sockets? I've tried: "bgapi originate {phoneno=13246789}loopback/9999" with no success... What do you suggest? Is it possible to get this working only with 2 call legs??? I think you might be looking at the wrong tool. The session:bridged() method is for knowing if the current session is bridged to another leg. Tony says it has a very specific use case and I doubt that this is what they had in mind. If you're building a predictive dialer and you are generating the outbound call leg then you're most likely in need of knowing that the far end has answered. In a case like this I would build a dialplan extension and have the b leg drop in there. Then set execute_on_answer to your lua script. You could also use that dialplan to handle timeouts, call failures, etc. This way you're letting the dialplan do what it's good at and your Lua script can focus on the single task of handling an answered call... -MC
On Mon, Mar 8, 2010 at 10:06 AM, rentmycoder rentmycoder < rentmycoder@gmail.com> wrote:
Yes you are absolutelly right, maybe I might be looking at the wrong tool... I have tried several approaches but haven't found the right one... I don't only need to detect if a call was answered, but I need also to detect and log the failure cause in case the call was not answered. Which usually can be found in the originate_disposition variable...
If I use a socket command: "bgapi originate {ignore_early_media=true,originate_timeout=10,api_hangup_hook='luarun cc.lua predictive_hangup'}sofia/gateway/gwname/13246789 9999" I cannot detect the originate_disposition variable in predictive_hangup() in lua, becouse the session is nil after hangup...
I think I should start dialing out from the dialplan, but in this case how to call to the dialplan using sockets? I've tried: "bgapi originate {phoneno=13246789}loopback/9999" with no success...
What do you suggest? Is it possible to get this working only with 2 call legs???
It's been a while but I did this with two call legs a few years back. I was using OpenZAP but the principles are the same: use the dialplan to process the calls and if the call is answered you launch a script (or in my case, transfer to a different dp extension) otherwise you wait for the call to timeout. It might be easier to discuss this in realtime on IRC, or you could call the public conference tomorrow and after the main agenda and Mathieu's mod_sofia presentation there will be an open floor for people to ask questions and discuss FreeSWITCH topics. -MC
participants (2)
-
Michael Collins
-
rentmycoder rentmycoder