<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">
and just to point it out, you can also do:<br><br>session1 = new Session();<br>session1.originate(session1, "{ignore_early_media=true}sofia/gateway/ <br><a target="_blank" href="http://asterlink.com/19184249378"><span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="yshortcuts" id="lw_1206717089_0">asterlink.com/19184249378</span></a>");<br><br>session1.execute("bridge", "sofia/gateway/asterlink.com/<span class="yshortcuts" id="lw_1206717089_1">19184238080</span>");<br><br>or even better<br><br>// this will transfer the channel into the dialplan and end the script<br>// thus reducing overhead of leaving JS open.<br>session1.execute("transfer", "<span class="yshortcuts" id="lw_1206717089_1">19184238080</span>");<br><br><br><br><div> </div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank"
href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Brian West <brian.west@mac.com><br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Thursday, March 27, 2008 9:55:25 PM<br>Subject: Re: [Freeswitch-users] How to bridge 2 sessions with Javascript?<br><br>
Revised script:<br><br>session1 = new Session();<br>session1.originate(session1, "{ignore_early_media=true}sofia/gateway/ <br><a target="_blank" href="http://asterlink.com/19184249378">asterlink.com/19184249378</a>");<br><br>session2 = new Session();<br>session2.originate(session2, "sofia/gateway/asterlink.com/19184238080");<br><br>bridge(session1, session2);<br>session.hangup();<br>while (session1.ready() && session2.ready()) { }<br><br><br>You don't need waitForAnswer because the ignore_early_media=true <br>performs that automatically for you so it won't return till you <br>answer. And you don't want the ignore_early_media on the second leg <br>otherwise you get NO ringback and its just silent till the other end <br>is answered.<br><br>/b<br><br>On Mar 27, 2008, at 9:10 PM, Nicolas Brenner wrote:<br><br>> Hello everybody again,<br>><br>> First of all I want to say thanks to the people on this list and
on<br>> IRC, I'm really surprised (in a very good way) of the help I've<br>> received.<br>><br>> Now to my problem: I'm trying to bridge two SIP calls together with a<br>> JS script, and to achieve it, I'm did the following:<br>> - created a dialplan entry for extension 500 which calls js script<br>> - created a js script with the following code:<br>><br>> // Create new_session<br>> session1 = new Session();<br>> session1.originate(session,<br>> "{ignore_early_media=true}sofia/gateway/sip.sipdiscount.com/ <br>> 005624949458");<br>> session1.waitForAnswer(10000);<br>><br>> new_session = new Session();<br>> new_session.originate(session,<br>> "{ignore_early_media=true}sofia/gateway/sip.sipdiscount.com/ <br>> 0056979039388",<br>> 30);<br>> new_session.waitForAnswer(10000);<br>><br>> // IF everybody is ready, then bridge our current session & the <br>> new_session<br>> if
(session1.ready() && new_session.ready()) {<br>> console_log("info", "Interoligofrenico!\n");<br>> bridge(session1, new_session);<br>> }<br>><br>> // hangup when done<br>> session1.hangup();<br>> new_session.hangup();<br>><br>> When I register with extension 1000 using a softphone and dial<br>> extension 500, the code above successfully creates the two new<br>> sessions, makes the calls in order, and supposedly bridges the<br>> sessions (I get no error about the bridge on the console, and I get<br>> the log text too), but I get no audio on either end. Anybody know<br>> what's wrong with the code?<br>><br>> Btw, how can I originate a call to a configure extension? All examples<br>> on the wiki use the 'sofia syntax', should I just use<br>> sofia/default/1001 for example?<br>><br>> Thanks!<br>><br>> Nicolas<br>><br>>
_______________________________________________<br>> Freeswitch-users mailing list<br>> <a ymailto="mailto:Freeswitch-users@lists.freeswitch.org" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><br><br>_______________________________________________<br>Freeswitch-users mailing list<br><a ymailto="mailto:Freeswitch-users@lists.freeswitch.org" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br><a
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div><br></div></div><br>
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>