reSIProcate/DialogUsageManager  9694
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
resip::ServerOutOfDialogReq Class Reference

#include <ServerOutOfDialogReq.hxx>

Inheritance diagram for resip::ServerOutOfDialogReq:
Inheritance graph
[legend]
Collaboration diagram for resip::ServerOutOfDialogReq:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Handle
< ServerOutOfDialogReq
ServerOutOfDialogReqHandle

Public Member Functions

ServerOutOfDialogReqHandle getHandle ()
SharedPtr< SipMessageaccept (int statusCode=200)
SharedPtr< SipMessagereject (int statusCode)
virtual void end ()
virtual void dispatch (const SipMessage &msg)
virtual void dispatch (const DumTimeout &timer)
virtual SharedPtr< SipMessageanswerOptions ()
virtual void send (SharedPtr< SipMessage > msg)
virtual EncodeStreamdump (EncodeStream &strm) const

Protected Member Functions

virtual ~ServerOutOfDialogReq ()

Private Member Functions

 ServerOutOfDialogReq (DialogUsageManager &dum, DialogSet &dialogSet, const SipMessage &req)
 ServerOutOfDialogReq (const ServerOutOfDialogReq &)
ServerOutOfDialogReqoperator= (const ServerOutOfDialogReq &)

Private Attributes

SipMessage mRequest
SharedPtr< SipMessagemResponse

Friends

class DialogSet

Detailed Description

Definition at line 10 of file ServerOutOfDialogReq.hxx.


Member Typedef Documentation

Definition at line 13 of file ServerOutOfDialogReq.hxx.


Constructor & Destructor Documentation

ServerOutOfDialogReq::~ServerOutOfDialogReq ( ) [protected, virtual]
ServerOutOfDialogReq::ServerOutOfDialogReq ( DialogUsageManager dum,
DialogSet dialogSet,
const SipMessage req 
) [private]

Definition at line 22 of file ServerOutOfDialogReq.cxx.

   : NonDialogUsage(dum, dialogSet),
     mResponse(new SipMessage)
{

}
resip::ServerOutOfDialogReq::ServerOutOfDialogReq ( const ServerOutOfDialogReq ) [private]

Member Function Documentation

SharedPtr< SipMessage > ServerOutOfDialogReq::accept ( int  statusCode = 200)

dcm! -- should any responses should include a contact?

Definition at line 106 of file ServerOutOfDialogReq.cxx.

References resip::DialogUsageManager::makeResponse(), resip::BaseUsage::mDum, mRequest, and mResponse.

{   
   mDum.makeResponse(*mResponse, mRequest, statusCode);
   return mResponse;
}

Here is the call graph for this function:

SharedPtr< SipMessage > ServerOutOfDialogReq::answerOptions ( ) [virtual]

Definition at line 82 of file ServerOutOfDialogReq.cxx.

References resip::DialogUsageManager::getMasterProfile(), h_AllowEvents, resip::DialogUsageManager::makeResponse(), resip::BaseUsage::mDum, mRequest, and mResponse.

Referenced by dispatch().

{
        mDum.makeResponse(*mResponse, mRequest, 200);

        // Add in Allow, Accept, Accept-Encoding, Accept-Language, and Supported Headers from Profile
        mResponse->header(h_Allows) = mDum.getMasterProfile()->getAllowedMethods();
        mResponse->header(h_Accepts) = mDum.getMasterProfile()->getSupportedMimeTypes(INVITE);
        mResponse->header(h_AcceptEncodings) = mDum.getMasterProfile()->getSupportedEncodings();
        mResponse->header(h_AcceptLanguages) = mDum.getMasterProfile()->getSupportedLanguages();
        mResponse->header(h_AllowEvents) = mDum.getMasterProfile()->getAllowedEvents();
        mResponse->header(h_Supporteds) = mDum.getMasterProfile()->getSupportedOptionTags();

        return mResponse;
}

Here is the call graph for this function:

void ServerOutOfDialogReq::dispatch ( const SipMessage msg) [virtual]

Implements resip::BaseUsage.

Definition at line 43 of file ServerOutOfDialogReq.cxx.

References answerOptions(), DebugLog, getHandle(), getMethodName(), resip::DialogUsageManager::getOutOfDialogHandler(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::DialogUsageManager::makeResponse(), resip::BaseUsage::mDum, resip::RequestLine::method(), mRequest, mResponse, and resip::DialogUsageManager::send().

Referenced by resip::DialogSet::dispatch().

{
        assert(msg.isRequest());

        OutOfDialogHandler *pHandler = mDum.getOutOfDialogHandler(msg.header(h_CSeq).method());
        if(pHandler != NULL)
        {
                // Let handler deal with message
                mRequest = msg; 
            DebugLog ( << "ServerOutOfDialogReq::dispatch - handler found for " << getMethodName(msg.header(h_CSeq).method()) << " method.");   
                pHandler->onReceivedRequest(getHandle(), msg);  // Wait for application to send response
        }
        else
        {
                if(msg.header(h_CSeq).method() == OPTIONS)
                {
           DebugLog ( << "ServerOutOfDialogReq::dispatch - handler not found for OPTIONS - sending autoresponse.");   
                        // If no handler exists for OPTIONS then handle internally
                        mRequest = msg; 
                        mDum.send(answerOptions());
                        delete this;
                }
                else
                {
           DebugLog ( << "ServerOutOfDialogReq::dispatch - handler not found for " << getMethodName(msg.header(h_CSeq).method()) << " method - sending 405.");   
                        // No handler found for out of dialog request - return a 405
                        mDum.makeResponse(*mResponse, msg, 405);
                        mDum.send(mResponse);
                        delete this;
                }
        }
}

Here is the call graph for this function:

void ServerOutOfDialogReq::dispatch ( const DumTimeout timer) [virtual]

Implements resip::BaseUsage.

Definition at line 77 of file ServerOutOfDialogReq.cxx.

{
}
EncodeStream & ServerOutOfDialogReq::dump ( EncodeStream strm) const [virtual]

Implements resip::BaseUsage.

Definition at line 122 of file ServerOutOfDialogReq.cxx.

References resip::SipMessage::exists(), getMethodName(), h_RequestLine, resip::SipMessage::header(), resip::RequestLine::method(), and mRequest.

{
   if(mRequest.exists(h_CSeq))
   {
      strm << "ServerOutOfDialogReq " << getMethodName(mRequest.header(h_RequestLine).method()) 
           << " cseq=" << mRequest.header(h_CSeq).sequence();
   }
   else
   {
      strm << "ServerOutOfDialogReq, dispatch has not occured yet.";
   }
   return strm;
}

Here is the call graph for this function:

void ServerOutOfDialogReq::end ( ) [virtual]

Implements resip::BaseUsage.

Definition at line 37 of file ServerOutOfDialogReq.cxx.

{
   delete this;
}
ServerOutOfDialogReqHandle ServerOutOfDialogReq::getHandle ( )

Definition at line 16 of file ServerOutOfDialogReq.cxx.

References resip::BaseUsage::getBaseHandle(), and resip::BaseUsage::mDum.

Referenced by dispatch(), and resip::DialogSet::getServerOutOfDialog().

Here is the call graph for this function:

ServerOutOfDialogReq& resip::ServerOutOfDialogReq::operator= ( const ServerOutOfDialogReq ) [private]
SharedPtr< SipMessage > ServerOutOfDialogReq::reject ( int  statusCode)

dcm! -- should any responses should include a contact?

Definition at line 114 of file ServerOutOfDialogReq.cxx.

References resip::DialogUsageManager::makeResponse(), resip::BaseUsage::mDum, mRequest, and mResponse.

{
   mDum.makeResponse(*mResponse, mRequest, statusCode);
   return mResponse;
}

Here is the call graph for this function:

void ServerOutOfDialogReq::send ( SharedPtr< SipMessage msg) [virtual]

Reimplemented from resip::NonDialogUsage.

Definition at line 98 of file ServerOutOfDialogReq.cxx.

References resip::BaseUsage::mDum, and resip::DialogUsageManager::send().

{
   assert(response->isResponse());
   mDum.send(response);
   delete this;
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class DialogSet [friend]

Definition at line 34 of file ServerOutOfDialogReq.hxx.


Member Data Documentation

Definition at line 37 of file ServerOutOfDialogReq.hxx.

Referenced by accept(), answerOptions(), dispatch(), dump(), and reject().

Definition at line 38 of file ServerOutOfDialogReq.hxx.

Referenced by accept(), answerOptions(), dispatch(), and reject().


The documentation for this class was generated from the following files: