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

[reSIProcate-users] Handling NOTIFY in OutOfDialogHandler


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