< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Bug with Multiple Accept headers


The accept header is indicating what body types the endpoint is willing to accept in the response.  The validateAccept code is following RFC3261 checking.  I would recommend that you just disable Accept header validation as it reduces interoperability - by setting MasterProfile::validateAcceptEnabled to false.

Scott

On Thu, May 20, 2010 at 5:02 PM, <aron_rosenberg@xxxxxxxxxxxx> wrote:

So I found the issue. We had strict mimetype checking on and MasterProfile.cxx doesn't add application/sdp for BYE. But this brings up an interesting question...Should the stack be validating Accept for an inbound request on a message that has no body?



-Aron

Aron Rosenberg
Logitech Inc, (SightSpeed Group)

__________________


So adding just

m.header(h_Accepts).push_back(resip::Mime("application","sdp"));

to the onReadyToSend for InviteSession if its a BYE, causes the stack to issue a 406 when receiving it. Let me step debug inside resiprocate to figure out whats going on.


Aron Rosenberg
Sr. Director, Engineering
Phone: +1 (510) 713-5801
Logitech Inc, (SightSpeed Group)

Inactive hide details for Scott Godin ---05/20/2010 01:39:17 PM---The easiest way to decorate the BYE message is to use the onRScott Godin ---05/20/2010 01:39:17 PM---The easiest way to decorate the BYE message is to use the onReadyToSend InviteSession callback.

From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
To: aron_rosenberg@xxxxxxxxxxxx
Cc: resiprocate-devel <resiprocate-devel@xxxxxxxxxxxxxxxxxxxx>
Date: 05/20/2010 01:39 PM
Subject: Re: [reSIProcate] Bug with Multiple Accept headers
Sent by: slgodin@xxxxxxxxx




The easiest way to decorate the BYE message is to use the onReadyToSend InviteSession callback.

Scott

On Thu, May 20, 2010 at 3:42 PM, <aron_rosenberg@xxxxxxxxxxxx> wrote:
    I'll try and a get full resip log to see whats going on, but the hardware endpoint is in India. I have noticed, that resiprocate doesn't include the Accept header in the BYE's it generates, is there a way perhaps to force that?

    -Aron




    Aron Rosenberg
    Logitech Inc, (SightSpeed Group)

    Inactive hide details for Scott Godin ---05/20/2010 12:11:25 PM---The code in validateAccept looks right to me - it should be sScott Godin ---05/20/2010 12:11:25 PM---The code in validateAccept looks right to me - it should be searching all Accept headers. In order

    From:
    Scott Godin <sgodin@xxxxxxxxxxxxxxx>
    To:
    aron_rosenberg@xxxxxxxxxxxx
    Cc:
    resiprocate-devel <resiprocate-devel@xxxxxxxxxxxxxxxxxxxx>
    Date:
    05/20/2010 12:11 PM
    Subject:
    Re: [reSIProcate] Bug with Multiple Accept headers
    Sent by:
    slgodin@xxxxxxxxx






    The code in validateAccept looks right to me - it should be searching all Accept headers.  In order to get into the code block you mentioned the following call would have to be returning false:
    if(request.exists(h_Accepts))
    Given that you see the Accept headers in the BYE message, I'm not sure why this is failing offhand.  Perhaps the SIPMessage failed to parse properly?  Maybe the resip logs would reveal more.


    Scott


    On Thu, May 20, 2010 at 2:19 PM, <
    aron_rosenberg@xxxxxxxxxxxx> wrote:
        So we have an interop issue with another SIP stack relating to that stack sending multiple "Accept" headers. Resiprocate is bouncing the BYE message with a 406 Not Acceptable error.

        The brief snippet from a pcap shows Accept being listed in this exact order.

        Accept: application/sdp,application/media_control+xml\r\n
        Accept: application/presentation_token_control+xml\r\n

        The same set of headers is allowed in the initial INVITE.

        I believe what is happening is that DialogUsageManager::validateAccept(
        const SipMessage& request) isn't properly searching multiple Accept header lines and it's falling into this block of code

        // If no Accept header then application/sdp should be assumed for certain methods

        else
        if(method == INVITE ||
        method == OPTIONS ||
        method == PRACK ||
        method == UPDATE)
        {

        if
        (getMasterProfile()->isMimeTypeSupported(request.header(h_RequestLine).method(), Mime("application", "sdp")))
        {

        return
        true;
        }
        }

        But in this case, BYE is not an option, so it bounces the message.

        A very simple fix would be to add BYE to that list, but are multiple Accept headers legal? If so, then the logic higher up in validateAccept needs to be changed to search more than just the last header line.

        Which is the right approach?

        Aron Rosenberg
        Logitech Inc, (SightSpeed Group)

        _______________________________________________
        resiprocate-devel mailing list

        resiprocate-devel@xxxxxxxxxxxxxxx
        https://list.resiprocate.org/mailman/listinfo/resiprocate-devel


    _______________________________________________
    resiprocate-devel mailing list

    resiprocate-devel@xxxxxxxxxxxxxxx
    https://list.resiprocate.org/mailman/listinfo/resiprocate-devel



_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel