[Freeswitch-users] Hangup problem/SIP BYE lacking authentication

Wellie Chao wchao at yahoo.com
Thu Oct 30 17:52:11 PDT 2008

Here is the BYE from Freeswitch to Metaswitch:

send 683 bytes to udp/[]:5060 at 00:44:46.607025:

    BYE sip:9172388084 at;transport=udp SIP/2.0
    Via: SIP/2.0/UDP;rport;branch=z9hG4bKNa693jZ8SD54D
    Max-Forwards: 70
    From: <sip:2675379325 at>;tag=r4yBmtX3U0Hrr
<sip:9172388084 at;transport=udp>;tag=Broadview1+1+25f76f+cc3ba534
    Call-ID: CEB9027F at Broadview1
    CSeq: 106588607 BYE
    Contact: <sip:mod_sofia at;transport=udp>
    User-Agent: FreeSWITCH-mod_sofia/1.0.1-9171
    Supported: 100rel, timer, precondition, path, replaces
    Reason: Q.850;cause=16;text="NORMAL_CLEARING"
    Content-Length: 0


Metaswitch is not so happy with the BYE message:

recv 491 bytes from udp/[]:5060 at 00:44:46.630445:

    SIP/2.0 401 Unauthorized
    Via: SIP/2.0/UDP;received=;branch=z9hG4bKNa693jZ8SD54D;rport=5060
    From: <sip:2675379325 at>;tag=r4yBmtX3U0Hrr
<sip:9172388084 at;transport=udp>;tag=Broadview1+1+25f76f+cc3ba534
    Call-ID: CEB9027F at Broadview1
    CSeq: 106588607 BYE
    WWW-Authenticate: Digest 
    Server: DC-SIP/2.0
    Supported: 100rel
    Content-Length: 0


Right after receiving the 401 Unauthorized message from Metaswitch, 
Freeswitch emits the following error on the console:

2008-10-30 20:44:46 [ERR] sofia_reg.c:1089 
sofia_reg_handle_sip_r_challenge() No Matching gateway found

At this point, the caller (the endpoint connected to Metaswitch) just 
remains on the line, never having received the BYE.

Did you take a look at the packet traces I captured? The carrier 
gave me a packet trace for an Aastra PBX/softswitch, and it had the same 
interaction, but immediately upon receiving the 401 Unauthorized from 
Metaswitch, the Aastra machine then sent a second BYE, this time with 
authentication. Is there some way I can tell Freeswitch to do the same?


On Thu, 30 Oct 2008, Brian West wrote:

> Date: Thu, 30 Oct 2008 17:11:04 -0500
> From: Brian West <brian at freeswitch.org>
> Reply-To: freeswitch-users at lists.freeswitch.org
> To: freeswitch-users at lists.freeswitch.org
> Subject: Re: [Freeswitch-users] Hangup problem/SIP BYE lacking authentication
> Turn on the TPORT_LOG=1 ./freeswitch and let me see the challenge
> packet.
> /b
> On Oct 30, 2008, at 4:45 PM, Wellie Chao wrote:
>> Here is what I have:
>> <include>
>>  <gateway name="broadview">
>>    <param name="username" value="MY_USERNAME"/>
>>    <param name="password" value="MY_PASSWORD"/>
>>    <param name="realm" value=""/>
>>    <param name="proxy" value=""/>
>>    <param name="register" value="false"/>
>>  </gateway>
>> </include>
>> Whether register is true or false doesn't seem to make a difference
>> (except that Freeswitch then comes up with broadview in NOREG
>> state). On calls from Metaswitch to Freeswitch, it's the same
>> problem, and I get the same message in the Freeswitch logs:
>> 2008-10-30 17:39:04 [ERR] sofia_reg.c:1089
>> sofia_reg_handle_sip_r_challenge() No Matching gateway found
>> I presume this is the same thing with the 401 Unauthorized packet
>> being sent by Metaswitch in response to Freeswitch's BYE message.
>> Note that the call itself goes just fine. I pick up, both sides can
>> hear each other. Just the hangup gets messed up and for some reason
>> Metaswitch expects an authenticated BYE message even though the
>> connection was not authenticated in the beginning when Metaswitch
>> initiated it. The packet trace shows this and it's very odd.
>> Is that what you meant when you said set up a gateway in Freeswitch
>> that has reg=false and the proper credentials?
> _______________________________________________
> 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

More information about the FreeSWITCH-users mailing list