<!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 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> </DIV>
<DIV><FONT color=#0060bf> new_session = new
Session();<BR> new_session.originate(session,
"sofia/gateway/gizmo/1xxxxxxxxxx");</FONT></DIV>
<DIV><FONT color=#0060bf> console_log("info","Waiting for
answer!\n");<BR>
new_session.waitForAnswer(10000);<BR>
console_log("info","***ANSWERED\n");<BR> do
{<BR> console_log("info","***Playing file . . .
\n");<BR>
playFile("we_are_trying_to_reach.wav");</FONT></DIV>
<DIV><FONT color=#0060bf> } while(1);</FONT></DIV>
<DIV> </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> </DIV>
<DIV>For the SIP provider, I'm using Gizmo Phone with the following settings in
sip_profiles/outbound/gizmo.xml:</DIV>
<DIV> </DIV>
<DIV><FONT color=#0060bf>
<include><BR> <gateway
name="gizmo"><BR> <param
name="username" value="1747xxxxxxx"/><BR>
<param name="password"
value="xxxxxxx"/><BR> <param
name="realm" value="<A href="http://proxy01.sipphone.com/" target=_blank><SPAN
class=yshortcuts
id=lw_1210293503_0>proxy01.sipphone.com</SPAN></A>"/><BR>
<param name="proxy" value="<A
href="http://proxy01.sipphone.com/" target=_blank><SPAN class=yshortcuts
id=lw_1210293503_1>proxy01.sipphone.com</SPAN></A>"/><BR>
<param name="register"
value="true"/><BR>
</gateway><BR> </include></FONT></DIV>
<DIV> </DIV>
<DIV>I'd really appreciate any help.</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Marc</DIV>
<DIV><BR> </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>