|
reSIProcate/DialogUsageManager
9694
|


Classes | |
| class | RlsSubscription |
Public Member Functions | |
| RlsServerSubscriptionHandler (const vector< string > inputFiles) | |
| virtual void | onNewSubscription (ServerSubscriptionHandle handle, const SipMessage &sub) |
| virtual void | onTerminated (ServerSubscriptionHandle sub) |
| virtual void | onRefresh (ServerSubscriptionHandle handle, const SipMessage &sub) |
| virtual bool | hasDefaultExpires () const |
| dcm! -- a bit clunky, but really want these objects to not have state | |
| virtual int | getDefaultExpires () const |
| virtual void | sendNextNotify () |
| virtual | ~RlsServerSubscriptionHandler () |
Private Types | |
| typedef map< DialogId, RlsSubscription > | DialogToHandle |
| typedef vector< Contents * > | ContentsList |
Private Attributes | |
| DialogToHandle | mHandleMap |
| vector< Contents * > | mContentsList |
Definition at line 88 of file rlsServer.cxx.
typedef vector<Contents*> RlsServerSubscriptionHandler::ContentsList [private] |
Definition at line 189 of file rlsServer.cxx.
typedef map<DialogId, RlsSubscription> RlsServerSubscriptionHandler::DialogToHandle [private] |
Definition at line 187 of file rlsServer.cxx.
| RlsServerSubscriptionHandler::RlsServerSubscriptionHandler | ( | const vector< string > | inputFiles | ) | [inline] |
Definition at line 110 of file rlsServer.cxx.
References readFromFile().
{
for (vector<string>::const_iterator it = inputFiles.begin(); it != inputFiles.end(); it++)
{
mContentsList.push_back(readFromFile(*it));
}
}

| virtual RlsServerSubscriptionHandler::~RlsServerSubscriptionHandler | ( | ) | [inline, virtual] |
Definition at line 182 of file rlsServer.cxx.
{
//clean up map, contents
}
| virtual int RlsServerSubscriptionHandler::getDefaultExpires | ( | ) | const [inline, virtual] |
Reimplemented from resip::ServerSubscriptionHandler.
Definition at line 159 of file rlsServer.cxx.
{
return 600;
}
| virtual bool RlsServerSubscriptionHandler::hasDefaultExpires | ( | ) | const [inline, virtual] |
dcm! -- a bit clunky, but really want these objects to not have state
Reimplemented from resip::ServerSubscriptionHandler.
Definition at line 154 of file rlsServer.cxx.
{
return true;
}
| virtual void RlsServerSubscriptionHandler::onNewSubscription | ( | ServerSubscriptionHandle | handle, |
| const SipMessage & | sub | ||
| ) | [inline, virtual] |
Implements resip::ServerSubscriptionHandler.
Definition at line 118 of file rlsServer.cxx.
References h_RequestLine, resip::SipMessage::header(), and InfoLog.
{
InfoLog ( << "onNewSubscription: " << sub.header(h_RequestLine) << "\t" <<
sub.header(h_From) << "\t" << handle->getAppDialog()->getDialogId());
assert(mHandleMap.find(handle->getAppDialog()->getDialogId()) == mHandleMap.end());
mHandleMap[handle->getAppDialog()->getDialogId()] = RlsSubscription(handle, 1);
handle->send(handle->accept());
SipMessage& notify = handle->update(mContentsList[0]);
notify.header(h_Requires).push_back(Token("eventlist"));
handle->send(notify);
}

| virtual void RlsServerSubscriptionHandler::onRefresh | ( | ServerSubscriptionHandle | handle, |
| const SipMessage & | sub | ||
| ) | [inline, virtual] |
Reimplemented from resip::ServerSubscriptionHandler.
Definition at line 137 of file rlsServer.cxx.
References resip::SipMessage::header().
{
DialogToHandle::iterator it = mHandleMap.find(handle->getAppDialog()->getDialogId());
if (it == mHandleMap.end())
{
assert(0);
}
else
{
ServerSubscriptionHandle handle = it->second.handle;
it->second.currentContent = 0;
SipMessage& notify = handle->update(mContentsList[it->second.currentContent++]);
notify.header(h_Requires).push_back(Token("eventlist"));
handle->send(notify);
}
}

| virtual void RlsServerSubscriptionHandler::onTerminated | ( | ServerSubscriptionHandle | sub | ) | [inline, virtual] |
Implements resip::ServerSubscriptionHandler.
Definition at line 130 of file rlsServer.cxx.
References InfoLog.
{
InfoLog ( << "onTerminated: " << sub->getAppDialog()->getDialogId());
mHandleMap.erase(sub->getAppDialog()->getDialogId());
}
| virtual void RlsServerSubscriptionHandler::sendNextNotify | ( | ) | [inline, virtual] |
Definition at line 164 of file rlsServer.cxx.
References resip::SipMessage::header().
{
for (DialogToHandle::iterator it = mHandleMap.begin(); it != mHandleMap.end(); it++)
{
ServerSubscriptionHandle handle = it->second.handle;
if (it->second.currentContent > mContentsList.size())
{
handle->end();
}
else
{
SipMessage& notify = handle->update(mContentsList[it->second.currentContent++]);
notify.header(h_Requires).push_back(Token("eventlist"));
handle->send(notify);
}
}
}

vector<Contents*> RlsServerSubscriptionHandler::mContentsList [private] |
Definition at line 190 of file rlsServer.cxx.
Definition at line 188 of file rlsServer.cxx.
1.7.5.1