<div dir="ltr">The originate method technique really causes more issues than it solves =D<br><br>If you don't have some specific need for doing it that way try this:<br><br>newSession new Session("{ignore_early_media=true}sofia/default/<a href="mailto:foo@bar.com">foo@bar.com</a>");<br>
<br>if (newSession.ready()) {<br> .... yay <br>}<br><br><br><div class="gmail_quote">On Tue, Aug 19, 2008 at 8:40 AM, Jonas Gauffin <span dir="ltr"><<a href="mailto:jonas.gauffin@gmail.com">jonas.gauffin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I had the same problem a while ago. I don't know if it's fixed, but I<br>
do this (and it works)<br>
<br>
session.setVariable("ringback", "%(1000,4000,425)");<br>
bleg = new Session();<br>
bleg.setCallerData("caller_id_name", session.caller_id_name);<br>
bleg.setCallerData("caller_id_num", session.caller_id_num);<br>
log.debug("Calling sofia/" + options[2] + "/" + options[3] + " for<br>
" + options[1] + " seconds");<br>
timeOut = parseInt(options[1]);<br>
destination =<br>
"{ignore_early_media=true,originate_timeout=10}sofia/<a href="http://mydomain.com/" target="_blank">mydomain.com/</a>" +<br>
options[3] + "%" + options[2];<br>
log.debug("DESTINATION: " + destination + " waiting 15 secs");<br>
res = bleg.originate(session, destination);<br>
<br>
if (res) {<br>
res2 = bleg.waitForAnswer(20000);<br>
res2 = session.waitForAnswer(20000);<br>
}<br>
else<br>
res2 = false;<br>
<br>
log.debug("**** Originate result: " + res + ", " + res2 + " ************");<br>
if (res)<br>
{<br>
log.debug("Transferred");<br>
socket.send("transfer\tok\n");<br>
bridge(session, bleg);<br>
exit();<br>
}<br>
else<br>
socket.send("transfer\tfailed\n");<br>
<div><div></div><div class="Wj3C7c"><br>
On Tue, Aug 19, 2008 at 3:36 PM, James Green <<a href="mailto:james.green@stealthnet.net">james.green@stealthnet.net</a>> wrote:<br>
> Taking the following code:<br>
><br>
> new_session.originate(session, dialout);<br>
> new_session.waitForAnswer(20000);<br>
><br>
> At this point either the call connected or we timed out.<br>
><br>
> I expected to be able to use new_session.ready() to determine if the<br>
> call successfully answered but this also returns true if the call timed<br>
> out. The circumstances in which it will return false are not documented<br>
> on the wiki.<br>
><br>
> session.ready() is apparently not a function.<br>
><br>
> So how does one check that the originate() ended up with a connected call?<br>
><br>
> Thanks again,<br>
><br>
> James<br>
><br>
</div></div>> _______________________________________________<br>
> Freeswitch-users mailing list<br>
> <a 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>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a 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>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>
</div>