[Freeswitch-users] waitForAnswer returns too soon

Marc Orenberg marc at kasteris.com
Fri May 9 19:56:02 PDT 2008


Thanks for the help everyone.
You were right Anthony. I put the relevant section of the trace below. I also got ahold of a VoicePulse line and tried it, and it worked fine.
I really appreciate it!
Trace from my Gizmo line:
2008-05-09 11:30:32 [DEBUG] sofia.c:222 sofia_event_callback() event [nua_i_state] status [0][INVITE sent] session: sofia/outbound/17818640108
2008-05-09 11:30:32 [DEBUG] sofia.c:1714 sofia_handle_sip_i_state() Channel sofia/outbound/17818640108 entering state [calling]
2008-05-09 11:30:34 [DEBUG] sofia.c:1714 sofia_handle_sip_i_state() Channel sofia/outbound/17818640108 entering state [ready]
2008-05-09 11:30:34 [DEBUG] sofia.c:1718 sofia_handle_sip_i_state() Remote SDP:
v=0
o=root 3158 3158 IN IP4 130.94.88.90
s=session
c=IN IP4 130.94.88.90
t=0 0
m=audio 17186 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
2008-05-09 11:30:34 [DEBUG] sofia_glue.c:2024 sofia_glue_negotiate_sdp() Audio Codec Compare [PCMU:0:8000]/[PCMU:0:8000]
2008-05-09 11:30:34 [DEBUG] sofia_glue.c:1333 sofia_glue_tech_set_codec() Set Codec sofia/outbound/17818640108 PCMU/8000 20 ms 160 samples
2008-05-09 11:30:34 [DEBUG] sofia_glue.c:1988 sofia_glue_negotiate_sdp() Set 2833 dtmf payload to 101
2008-05-09 11:30:34 [DEBUG] sofia_glue.c:1523 sofia_glue_activate_rtp() AUDIO RTP [sofia/outbound/17818640108] 69.64.92.160:26720->130.94.88.90:17186 codec: 0 ms: 20
2008-05-09 11:30:34 [DEBUG] switch_rtp.c:716 switch_rtp_create() Starting timer [soft] 160 bytes per 20000ms
2008-05-09 11:30:34 [NOTICE] sofia.c:2064 sofia_handle_sip_i_state() Channel [sofia/outbound/17818640108] has been answered
2008-05-09 11:30:34 [DEBUG] switch_ivr_originate.c:1213 switch_ivr_originate() Originate Resulted in Success: [sofia/outbound/17818640108]


----- Original Message ----
From: Anthony Minessale <anthony.minessale at gmail.com>
To: freeswitch-users at lists.freeswitch.org
Sent: Friday, May 9, 2008 8:49:58 AM
Subject: Re: [Freeswitch-users] waitForAnswer returns too soon

This block :

    new_session = new Session();
    new_session.originate(session, "sofia/gateway/gizmo/1xxxxxxxxxx"); 
    console_log("info","Waiting for answer!\n");
    new_session.waitForAnswer(10000);
    console_log("info","***ANSWERED\n");

Can be refactored to:

    new_session = new Session();
    console_log("info","Waiting for answer!\n");
    new_session.originate(session, "{ignore_early_media=true}sofia/gateway/gizmo/1xxxxxxxxxx"); 
    console_log("info","***ANSWERED\n");

Can be refactored to:

    console_log("info","Waiting for answer!\n");
    new_session = new Session("{ignore_early_media=true}sofia/gateway/gizmo/1xxxxxxxxxx"); 
    console_log("info","***ANSWERED\n");

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.
Many voip providers mistakenly answer calls on the inbound SIP leg before bridging it to the PSTN.
You should be able to see the SIP dialog and other console lines telling you if the call was actually answered or not.




On Fri, May 9, 2008 at 12:56 AM, Jonathan Palley <jpalley at idapted.com> wrote:

I think you want:

ignore_early_media=true

JP

On May 9, 2008, at 1:29 PM, Jonas Gauffin wrote:

> Doesn't that just allow media to be sent before a 200 ok? In that
> case, it doesn't solve the waitForAnswer problem?
>
> On Fri, May 9, 2008 at 7:05 AM, Leonardo Alves
> <leoalves at teltec.com.br> wrote:
>> Try using the parameter early_media=true
>> From: Marc Orenberg
>> Sent: Thursday, May 08, 2008 9:39 PM
>> To: freeswitch-users at lists.freeswitch.org
>> Subject: [Freeswitch-users] waitForAnswer returns too soon
>> 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:
>>
>>     new_session = new Session();
>>     new_session.originate(session, "sofia/gateway/gizmo/
>> 1xxxxxxxxxx");
>>     console_log("info","Waiting for answer!\n");
>>     new_session.waitForAnswer(10000);
>>     console_log("info","***ANSWERED\n");
>>     do {
>>       console_log("info","***Playing file . . . \n");
>>       playFile("we_are_trying_to_reach.wav");
>>     } while(1);
>>
>> When I run this code, the call is answered and it starts playing
>> the file
>> before my phone even starts ringing.
>> I'm not sure if it's a bug with waitForAnswer, or a configuration
>> issue on
>> my side.
>>
>> For the SIP provider, I'm using Gizmo Phone with the following
>> settings in
>> sip_profiles/outbound/gizmo.xml:
>>
>>     <include>
>>       <gateway name="gizmo">
>>         <param name="username" value="1747xxxxxxx"/>
>>         <param name="password" value="xxxxxxx"/>
>>         <param name="realm" value="proxy01.sipphone.com"/>
>>         <param name="proxy" value="proxy01.sipphone.com"/>
>>         <param name="register" value="true"/>
>>       </gateway>
>>     </include>
>>
>> I'd really appreciate any help.
>>
>> Thanks,
>> Marc
>>
>>
>> ________________________________
>>
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-
>> users
>> http://www.freeswitch.org
>>
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-
>> users
>> http://www.freeswitch.org
>>
>>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-
> users
> http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080509/80b13616/attachment-0002.html 


More information about the FreeSWITCH-users mailing list