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.)<br>
<br>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!<br><br><br>1) Create the new session, then intercept the existing channel:<br>
<br>
var NewSession = new
Session('{ignore_early_media=true,hangup_after_bridge=false}user/<a href="mailto:12610@domainname.com">12610@domainname.com</a>');<br>NewSession.execute('intercept', 'cafc3449-9000-47bc-8b28-257748d7ec40');<br>
<br>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]<br><br><br>2) Create the new session, and create a session object for the existing session and bridge them:<br>
<br>
var NewSession = new Session('{ignore_early_media=true,hangup_after_bridge=false}user/<a href="mailto:12610@domainname.com">12610@domainname.com</a>');<br>var ExistingSession = new Session('cafc3449-9000-47bc-8b28-257748d7ec40');<br>
bridge(ExistingSession, NewSession);<br><br>(This has a debug message saying "BRIDGE THREAD DONE", but not much else that seems unusual.)<br><br>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.<br>
<br><br clear="all">Cheers,<br>Fraser<br><br><br>