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

Re: [reSIProcate-users] Handling NOTIFY in OutOfDialogHandler


Sorry for the late response - I just realized this went unanswered.

>Does that look right? 

[Scott] Looks ok to me.  The first mime type check you have is fine, but it's avoidable if you used the DUM profile to validate content: Profile::validateContentEnabled and Profile::addSupportedMimeType.

>Sending 489 for unhandled content types 

[Scott] A 415 should be returned for unsupported mime types (8.2.3 - RFC3261).  See DialogUsageManager::validateContent.

>and 400 for invalid simple-message-summary?

[Scott] 400 seems reasonable here.

>Can I use MessageWaitingContents::isWellFormed to check for valid content?

[Scott]  Yes this will detect any parse errors by calling MessageWaitingContents::Parse.


Scott


On Mon, May 4, 2009 at 3:05 PM, Matthias Moetje <moetje@xxxxxxxxxxxx> wrote:

Hi,

 

I just wanted to make sure that my handling of MWI NOTIFY messages is correct, especially the reject responses..:

 

case NOTIFY:

{

    SharedPtr<SipMessage> resp;

 

    if ((request.header(h_ContentType).type() == "application") && (request.header(h_ContentType).subType() == "simple-message-summary"))

    {

        MessageWaitingContents* mwi = dynamic_cast<MessageWaitingContents*>(request.getContents());

        if (!mwi)

        {

            resp = ood->reject(400);

        }

        else

        {

            mwi->checkParsed();

            if (!mwi->isWellFormed())

            {

                resp = ood->reject(400);

            }

            else

            {

                // Do something app specific…

                // ...

                resp = ood->accept();

            }

        }

    }

    else

    {

        // We only handle simple-message-summary at this time

        resp = ood->reject(489);

    }

 

    ASSERT(pDumCS);

    CLock sLock(pDumCS, "MyOutOfDialogHandler::onReceivedRequest: NOTIFY");

    ood->send(resp);

    break;

}

 

 

Does that look right? Sending 489 for unhandled content types and 400 for invalid simple-message-summary?

Can I use MessageWaitingContents::isWellFormed to check for valid content?

 

 

Best regards,

 

Matthias Moetje

TERASENS GmbH
Augustenstraße 24
80333 Munich
GERMANY

 

Phone:
Fax:
e-mail:
Web:

+49.89.143370-0
+49.89.143370-22
info@xxxxxxxxxxxx
www.terasens.com

 

 


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/