<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>

<META content="MSHTML 6.00.6000.16643" name=GENERATOR></HEAD>
<BODY id=MailContainerBody 
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" 
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT face=Arial size=2>Try using the parameter 
early_media=true</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=marc@kasteris.com 
href="mailto:marc@kasteris.com">Marc Orenberg</A> </DIV>
<DIV><B>Sent:</B> Thursday, May 08, 2008 9:39 PM</DIV>
<DIV><B>To:</B> <A title=freeswitch-users@lists.freeswitch.org 
href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</A> 
</DIV>
<DIV><B>Subject:</B> [Freeswitch-users] waitForAnswer returns too 
soon</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV 
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif">
<DIV>
<DIV>Hello everyone. I'm&nbsp;a new FreeSwitch user, and I'm having a problem 
with waitForAnswer() with SpiderMonkey. I'm using it to make an outbound call as 
follows:</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#0060bf>&nbsp;&nbsp;&nbsp; new_session = new 
Session();<BR>&nbsp;&nbsp;&nbsp; new_session.originate(session, 
"sofia/gateway/gizmo/1xxxxxxxxxx");</FONT></DIV>
<DIV><FONT color=#0060bf>&nbsp;&nbsp;&nbsp; console_log("info","Waiting for 
answer!\n");<BR>&nbsp;&nbsp;&nbsp; 
new_session.waitForAnswer(10000);<BR>&nbsp;&nbsp;&nbsp; 
console_log("info","***ANSWERED\n");<BR>&nbsp;&nbsp;&nbsp; do 
{<BR>&nbsp;&nbsp;&nbsp; &nbsp; console_log("info","***Playing file . . . 
\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp; 
playFile("we_are_trying_to_reach.wav");</FONT></DIV>
<DIV><FONT color=#0060bf>&nbsp;&nbsp;&nbsp; } while(1);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>When I run this code, the call is answered and it starts playing the file 
before my phone even starts ringing.</DIV>
<DIV>I'm not sure if it's a bug with waitForAnswer, or a configuration issue on 
my side.</DIV>
<DIV>&nbsp;</DIV>
<DIV>For the SIP provider, I'm using Gizmo Phone with the following settings in 
sip_profiles/outbound/gizmo.xml:</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#0060bf>&nbsp;&nbsp;&nbsp; 
&lt;include&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp; &lt;gateway 
name="gizmo"&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param 
name="username" value="1747xxxxxxx"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;param name="password" 
value="xxxxxxx"/&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param 
name="realm" value="<A href="http://proxy01.sipphone.com/" target=_blank><SPAN 
class=yshortcuts 
id=lw_1210293503_0>proxy01.sipphone.com</SPAN></A>"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;param name="proxy" value="<A 
href="http://proxy01.sipphone.com/" target=_blank><SPAN class=yshortcuts 
id=lw_1210293503_1>proxy01.sipphone.com</SPAN></A>"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;param name="register" 
value="true"/&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp; 
&lt;/gateway&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/include&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>I'd really appreciate any help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Marc</DIV>
<DIV><BR>&nbsp;</DIV></DIV></DIV>
<P>
<HR>

<P></P>_______________________________________________<BR>Freeswitch-users 
mailing 
list<BR>Freeswitch-users@lists.freeswitch.org<BR>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR>http://www.freeswitch.org<BR></BODY></HTML>