<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><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></body></html>