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
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900