<font color="#0060bf">This block :<br><br>&nbsp;&nbsp;&nbsp; new_session = new Session();<br>&nbsp;&nbsp;&nbsp; new_session.originate(session, &quot;sofia/gateway/gizmo/1xxxxxxxxxx&quot;);</font>
<div><font color="#0060bf">&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;Waiting for answer!\n&quot;);<br>&nbsp;&nbsp;&nbsp; new_session.waitForAnswer(10000);<br>&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;***ANSWERED\n&quot;);<br><br>Can be refactored to:<br>
<br></font><font color="#0060bf">&nbsp;&nbsp;&nbsp; new_session = new Session();<br></font><font color="#0060bf">&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;Waiting for answer!\n&quot;);</font><br><font color="#0060bf">&nbsp;&nbsp;&nbsp; new_session.originate(session, &quot;{ignore_early_media=true}sofia/gateway/gizmo/1xxxxxxxxxx&quot;);</font>
<div><font color="#0060bf">&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;***ANSWERED\n&quot;);<br><br>Can be refactored to:<br></font><font color="#0060bf"><br>&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;Waiting for answer!\n&quot;);</font><br>


<font color="#0060bf">&nbsp;&nbsp;&nbsp; new_session = new Session(</font><font color="#0060bf">&quot;{ignore_early_media=true}sofia/gateway/gizmo/1xxxxxxxxxx&quot;);</font>
<div><font color="#0060bf">&nbsp;&nbsp;&nbsp; console_log(&quot;info&quot;,&quot;***ANSWERED\n&quot;);<br>
</font></div><br></div>
You may want to compare the console log with debug level (press f8 on cli) and start FS with TPORT_LOG=1 env var set.<br>Many voip providers mistakenly answer calls on the inbound SIP leg before bridging it to the PSTN.<br>
You should be able to see the SIP dialog and other console lines telling you if the call was actually answered or not.<br><br><font color="#0060bf"><br></font></div><br><div class="gmail_quote">On Fri, May 9, 2008 at 12:56 AM, Jonathan Palley &lt;<a href="mailto:jpalley@idapted.com">jpalley@idapted.com</a>&gt; 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 think you want:<br>
<br>
ignore_early_media=true<br>
<font color="#888888"><br>
JP<br>
</font><div><div></div><div class="Wj3C7c">On May 9, 2008, at 1:29 PM, Jonas Gauffin wrote:<br>
<br>
&gt; Doesn&#39;t that just allow media to be sent before a 200 ok? In that<br>
&gt; case, it doesn&#39;t solve the waitForAnswer problem?<br>
&gt;<br>
&gt; On Fri, May 9, 2008 at 7:05 AM, Leonardo Alves<br>
&gt; &lt;<a href="mailto:leoalves@teltec.com.br">leoalves@teltec.com.br</a>&gt; wrote:<br>
&gt;&gt; Try using the parameter early_media=true<br>
&gt;&gt; From: Marc Orenberg<br>
&gt;&gt; Sent: Thursday, May 08, 2008 9:39 PM<br>
&gt;&gt; To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
&gt;&gt; Subject: [Freeswitch-users] waitForAnswer returns too soon<br>
&gt;&gt; Hello everyone. I&#39;m a new FreeSwitch user, and I&#39;m having a<br>
&gt;&gt; problem with<br>
&gt;&gt; waitForAnswer() with SpiderMonkey. I&#39;m using it to make an<br>
&gt;&gt; outbound call as<br>
&gt;&gt; follows:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; new_session = new Session();<br>
&gt;&gt; &nbsp; &nbsp; new_session.originate(session, &quot;sofia/gateway/gizmo/<br>
&gt;&gt; 1xxxxxxxxxx&quot;);<br>
&gt;&gt; &nbsp; &nbsp; console_log(&quot;info&quot;,&quot;Waiting for answer!\n&quot;);<br>
&gt;&gt; &nbsp; &nbsp; new_session.waitForAnswer(10000);<br>
&gt;&gt; &nbsp; &nbsp; console_log(&quot;info&quot;,&quot;***ANSWERED\n&quot;);<br>
&gt;&gt; &nbsp; &nbsp; do {<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; console_log(&quot;info&quot;,&quot;***Playing file . . . \n&quot;);<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; playFile(&quot;we_are_trying_to_reach.wav&quot;);<br>
&gt;&gt; &nbsp; &nbsp; } while(1);<br>
&gt;&gt;<br>
&gt;&gt; When I run this code, the call is answered and it starts playing<br>
&gt;&gt; the file<br>
&gt;&gt; before my phone even starts ringing.<br>
&gt;&gt; I&#39;m not sure if it&#39;s a bug with waitForAnswer, or a configuration<br>
&gt;&gt; issue on<br>
&gt;&gt; my side.<br>
&gt;&gt;<br>
&gt;&gt; For the SIP provider, I&#39;m using Gizmo Phone with the following<br>
&gt;&gt; settings in<br>
&gt;&gt; sip_profiles/outbound/gizmo.xml:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &lt;include&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &lt;gateway name=&quot;gizmo&quot;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param name=&quot;username&quot; value=&quot;1747xxxxxxx&quot;/&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param name=&quot;password&quot; value=&quot;xxxxxxx&quot;/&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param name=&quot;realm&quot; value=&quot;<a href="http://proxy01.sipphone.com" target="_blank">proxy01.sipphone.com</a>&quot;/&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param name=&quot;proxy&quot; value=&quot;<a href="http://proxy01.sipphone.com" target="_blank">proxy01.sipphone.com</a>&quot;/&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param name=&quot;register&quot; value=&quot;true&quot;/&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &lt;/gateway&gt;<br>
&gt;&gt; &nbsp; &nbsp; &lt;/include&gt;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d really appreciate any help.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Marc<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ________________________________<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Freeswitch-users mailing list<br>
&gt;&gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-</a><br>
&gt;&gt; users<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Freeswitch-users mailing list<br>
&gt;&gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-</a><br>
&gt;&gt; users<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Freeswitch-users mailing list<br>
&gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-</a><br>
&gt; users<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><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>
</div></div></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