|
reSIProcate/DialogUsageManager
9694
|
#include <ServerOutOfDialogReq.hxx>


Public Types | |
| typedef Handle < ServerOutOfDialogReq > | ServerOutOfDialogReqHandle |
Public Member Functions | |
| ServerOutOfDialogReqHandle | getHandle () |
| SharedPtr< SipMessage > | accept (int statusCode=200) |
| SharedPtr< SipMessage > | reject (int statusCode) |
| virtual void | end () |
| virtual void | dispatch (const SipMessage &msg) |
| virtual void | dispatch (const DumTimeout &timer) |
| virtual SharedPtr< SipMessage > | answerOptions () |
| virtual void | send (SharedPtr< SipMessage > msg) |
| virtual EncodeStream & | dump (EncodeStream &strm) const |
Protected Member Functions | |
| virtual | ~ServerOutOfDialogReq () |
Private Member Functions | |
| ServerOutOfDialogReq (DialogUsageManager &dum, DialogSet &dialogSet, const SipMessage &req) | |
| ServerOutOfDialogReq (const ServerOutOfDialogReq &) | |
| ServerOutOfDialogReq & | operator= (const ServerOutOfDialogReq &) |
Private Attributes | |
| SipMessage | mRequest |
| SharedPtr< SipMessage > | mResponse |
Friends | |
| class | DialogSet |
Definition at line 10 of file ServerOutOfDialogReq.hxx.
Definition at line 13 of file ServerOutOfDialogReq.hxx.
| ServerOutOfDialogReq::~ServerOutOfDialogReq | ( | ) | [protected, virtual] |
Definition at line 31 of file ServerOutOfDialogReq.cxx.
References resip::NonDialogUsage::mDialogSet, and resip::DialogSet::mServerOutOfDialogRequest.
{
mDialogSet.mServerOutOfDialogRequest = 0;
}
| 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] |
| 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;
}

| 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;
}

| 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;
}
}
}

| void ServerOutOfDialogReq::dispatch | ( | const DumTimeout & | timer | ) | [virtual] |
| 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;
}

| 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().
{
return ServerOutOfDialogReqHandle(mDum, getBaseHandle().getId());
}

| 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;
}

| 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().

friend class DialogSet [friend] |
Definition at line 34 of file ServerOutOfDialogReq.hxx.
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().
1.7.5.1