Bridge or Intercept?
I want to call an extn, then when they pick up connect them to another existing channel - later I'll run this via event_socket, but for now I'm doing it in javascript (I want to do database updates before and after attempting the connection.) As far as I can see, I have two options, and I'm interested in which is better, and more importantly - how to get either of them working! 1) Create the new session, then intercept the existing channel: var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); NewSession.execute('intercept', 'cafc3449-9000-47bc-8b28-257748d7ec40'); The newSession phone rings and on pickup both channels get hung up. The ExistingChannel gives a call status in the CLI of [DESTINATION_OUT_OF_ORDER] 2) Create the new session, and create a session object for the existing session and bridge them: var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); var ExistingSession = new Session('cafc3449-9000-47bc-8b28-257748d7ec40'); bridge(ExistingSession, NewSession); (This has a debug message saying "BRIDGE THREAD DONE", but not much else that seems unusual.) The sound files that are playing in ExistingSession continue, and after about 10sec A notice appears in the CLI indicating a session.hungup event has fired, but both phones remain on the hook and hanging up either doesn't affect the other. Cheers, Fraser
how about no script and 1 command originate ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com intercept:cafc3449-9000-47bc-8b28-257748d7ec40 inline (Providing that uuid is of a channel that is ready to bridge) On Mon, Mar 22, 2010 at 4:47 PM, Fraser Redmond <fraserredmond@gmail.com>wrote:
I want to call an extn, then when they pick up connect them to another existing channel - later I'll run this via event_socket, but for now I'm doing it in javascript (I want to do database updates before and after attempting the connection.)
As far as I can see, I have two options, and I'm interested in which is better, and more importantly - how to get either of them working!
1) Create the new session, then intercept the existing channel:
var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); NewSession.execute('intercept', 'cafc3449-9000-47bc-8b28-257748d7ec40');
The newSession phone rings and on pickup both channels get hung up. The ExistingChannel gives a call status in the CLI of [DESTINATION_OUT_OF_ORDER]
2) Create the new session, and create a session object for the existing session and bridge them:
var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); var ExistingSession = new Session('cafc3449-9000-47bc-8b28-257748d7ec40'); bridge(ExistingSession, NewSession);
(This has a debug message saying "BRIDGE THREAD DONE", but not much else that seems unusual.)
The sound files that are playing in ExistingSession continue, and after about 10sec A notice appears in the CLI indicating a session.hungup event has fired, but both phones remain on the hook and hanging up either doesn't affect the other.
Cheers, Fraser
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Thanks Anthony! That works great. I read about inlines today, but didn't really get it, I'll have to go back and read it again. I think this is the main (only) problem I've seen with FreeSwitch - there's so much you can do, and often in just one line, but to get that one line you often have to ask the creator! :-) Cheers, Fraser On Mon, Mar 22, 2010 at 10:00 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
how about no script and 1 command
originate ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com intercept:cafc3449-9000-47bc-8b28-257748d7ec40 inline
(Providing that uuid is of a channel that is ready to bridge)
On Mon, Mar 22, 2010 at 4:47 PM, Fraser Redmond <fraserredmond@gmail.com>wrote:
I want to call an extn, then when they pick up connect them to another existing channel - later I'll run this via event_socket, but for now I'm doing it in javascript (I want to do database updates before and after attempting the connection.)
As far as I can see, I have two options, and I'm interested in which is better, and more importantly - how to get either of them working!
1) Create the new session, then intercept the existing channel:
var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); NewSession.execute('intercept', 'cafc3449-9000-47bc-8b28-257748d7ec40');
The newSession phone rings and on pickup both channels get hung up. The ExistingChannel gives a call status in the CLI of [DESTINATION_OUT_OF_ORDER]
2) Create the new session, and create a session object for the existing session and bridge them:
var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/ 12610@domainname.com'); var ExistingSession = new Session('cafc3449-9000-47bc-8b28-257748d7ec40'); bridge(ExistingSession, NewSession);
(This has a debug message saying "BRIDGE THREAD DONE", but not much else that seems unusual.)
The sound files that are playing in ExistingSession continue, and after about 10sec A notice appears in the CLI indicating a session.hungup event has fired, but both phones remain on the hook and hanging up either doesn't affect the other.
Cheers, Fraser
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
On Mon, Mar 22, 2010 at 3:32 PM, Fraser Redmond <fraserredmond@gmail.com>wrote:
Thanks Anthony! That works great. I read about inlines today, but didn't really get it, I'll have to go back and read it again.
I think this is the main (only) problem I've seen with FreeSwitch - there's so much you can do, and often in just one line, but to get that one line you often have to ask the creator! :-)
Just try that with Asterisk! :P -MC
participants (3)
-
Anthony Minessale
-
Fraser Redmond
-
Michael Collins