Hi Brigit, Set continue_on_fail=true and hangup_after_bridge=false should let you just continue with your script after the bridge. Cheers -- Dave
Hi,
I'm running FreeSWITCH 498:8901 on x86_64 GNU/Linux.
I'm trying to get person 1 to speak to person 2, then after person 2 hangs up, speak to person 3, etc, etc.
So: person1 -> person2 person1 -> person3 ... person1 -> personN
In between connecting person1 to the next person, I need to do some admin and speak phrases to person1 and personX independently.
Our software originates the calls, so I've chosen for RPC and JS.
I succeed orginating a call to person1 and person2 and bridging them. However, I struggle to find a way to 'catch' the hangup and make person1 connect to person3.
I tried using session.setHangupHook, but the function is never called.
Any idea how I can catch the hangup of person2 so it doesn't hangup on person1, so I can connect person1 to person3?
This is what I've got so far:
function on_hangup2(hup_session, how) { console_log("info", "on_hangup2(): " + how + " HOOK" + " name: " + hup_session.name + " state: " + hup_session.state + " cause: " + hup_session.cause + "\n");
exit(); }
function on_hangup1(hup_session, how) { console_log("info", "on_hangup1(): " + how + " HOOK" + " name: " + hup_session.name + " state: " + hup_session.state + " cause: " + hup_session.cause + "\n");
cSession.speak("cepstral", "Diane", "Wait we are trying to find the next person"); var m2Session = new Session("sofia/gateway/westhawk/0661"); cSession.setHangupHook(on_hangup2); m2Session.setHangupHook(on_hangup2); bridge(cSession, m2Session); }
var cSession = new Session("{ignore_early_media=true,call_timeout=60}sofia/gateway/ westhawk/0662"); while (cSession.ready()) { // The call has been answered
cSession.speak("cepstral", "Diane", "Wait we are trying to find the next person"); var m1Session = new Session("sofia/gateway/westhawk/0663"); cSession.setHangupHook(on_hangup1); m1Session.setHangupHook(on_hangup1); bridge(cSession, m1Session); }
(end js).
I tried cSession.bridge("sofia/gateway/westhawk/0663|sofia/gateway/westhawk/ 0661"); but that didn't work either.
Thanks, Birgit
-- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- <URL: http://www.westhawk.co.uk>
_______________________________________________ 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