|
reSIProcate/DialogUsageManager
9694
|
#include <RegistrationHandler.hxx>
Public Member Functions | |
| virtual | ~ServerRegistrationHandler () |
| virtual void | onRefresh (ServerRegistrationHandle, const SipMessage ®)=0 |
| Called when registration is refreshed. | |
| virtual void | onRemove (ServerRegistrationHandle, const SipMessage ®)=0 |
| called when one or more specified contacts is removed | |
| virtual void | onRemoveAll (ServerRegistrationHandle, const SipMessage ®)=0 |
| Called when all the contacts are removed using "Contact: *". | |
| virtual void | onAdd (ServerRegistrationHandle, const SipMessage ®)=0 |
| Called when one or more contacts are added. | |
| virtual void | onQuery (ServerRegistrationHandle, const SipMessage ®)=0 |
| Called when a client queries for the list of current registrations. | |
| virtual void | getGlobalExpires (const SipMessage &msg, SharedPtr< MasterProfile > masterProfile, UInt32 &expires, UInt32 &returnCode) |
| When processing a REGISTER request, return the desired expires value when processing the "Expires" header. | |
| virtual void | getContactExpires (const NameAddr &contact, SharedPtr< MasterProfile > masterProfile, UInt32 &expires, UInt32 &returnCode) |
| When processing a REGISTER request, return the desired expires value by processing this contact's expires parameter. | |
| virtual bool | asyncProcessing (void) const |
| If true, the registration processing will use the async* functions here and will not use the RegistrationPersistenceManager. | |
| virtual void | asyncGetContacts (ServerRegistrationHandle, const Uri &aor) |
| Called when a REGISTER is first received to retrieve the current list. | |
| virtual void | asyncUpdateContacts (ServerRegistrationHandle, const Uri &aor, std::auto_ptr< ContactPtrList > modifiedContactList, std::auto_ptr< ContactRecordTransactionLog > transactionLog) |
| Notifies the handler to update the current contact list for the AOR to the specified list that has been updated by DUM's registration processing. | |
| virtual void | asyncRemoveExpired (ServerRegistrationHandle, const resip::Uri &aor, std::auto_ptr< resip::ContactPtrList > contacts) |
| Notifies the handler to remove the entries specified in the contacts parameter. | |
Definition at line 42 of file RegistrationHandler.hxx.
| virtual resip::ServerRegistrationHandler::~ServerRegistrationHandler | ( | ) | [inline, virtual] |
Definition at line 45 of file RegistrationHandler.hxx.
{}
| virtual void resip::ServerRegistrationHandler::asyncGetContacts | ( | ServerRegistrationHandle | , |
| const Uri & | aor | ||
| ) | [inline, virtual] |
Called when a REGISTER is first received to retrieve the current list.
This list is then updated by the registration logic in DUM. When the list is ready, call asyncProvideContacts() on the specified ServerRegistration.
Definition at line 95 of file RegistrationHandler.hxx.
{
}
| virtual bool resip::ServerRegistrationHandler::asyncProcessing | ( | void | ) | const [inline, virtual] |
If true, the registration processing will use the async* functions here and will not use the RegistrationPersistenceManager.
Definition at line 87 of file RegistrationHandler.hxx.
Referenced by resip::ServerRegistration::accept(), resip::ServerRegistration::processRegistration(), and resip::ServerRegistration::reject().
{
return false;
}
| virtual void resip::ServerRegistrationHandler::asyncRemoveExpired | ( | ServerRegistrationHandle | , |
| const resip::Uri & | aor, | ||
| std::auto_ptr< resip::ContactPtrList > | contacts | ||
| ) | [inline, virtual] |
Notifies the handler to remove the entries specified in the contacts parameter.
No further processing is required after receiving this message.
Definition at line 113 of file RegistrationHandler.hxx.
Referenced by resip::ServerRegistration::asyncProcessFinalOkMsg().
{
}
| virtual void resip::ServerRegistrationHandler::asyncUpdateContacts | ( | ServerRegistrationHandle | , |
| const Uri & | aor, | ||
| std::auto_ptr< ContactPtrList > | modifiedContactList, | ||
| std::auto_ptr< ContactRecordTransactionLog > | transactionLog | ||
| ) | [inline, virtual] |
Notifies the handler to update the current contact list for the AOR to the specified list that has been updated by DUM's registration processing.
This is normally called after the REGISTER has been processed and accepted by the user (ServerRegistration::accept())
Definition at line 103 of file RegistrationHandler.hxx.
Referenced by resip::ServerRegistration::accept().
{
}
| void ServerRegistrationHandler::getContactExpires | ( | const NameAddr & | contact, |
| SharedPtr< MasterProfile > | masterProfile, | ||
| UInt32 & | expires, | ||
| UInt32 & | returnCode | ||
| ) | [virtual] |
When processing a REGISTER request, return the desired expires value by processing this contact's expires parameter.
If the expires value is not modified in this function the global expires will be used.
| expires | Set this to the desired expiration value for this contact. |
| returnCode | If the REGISTER should be rejected, use this return code. A value of 423 will result in the Min-Expires header added to the response. |
Definition at line 65 of file RegistrationHandler.cxx.
References resip::NameAddr::exists(), and resip::ParserCategory::param().
Referenced by resip::ServerRegistration::processRegistration().
{
if (!masterProfile)
{
returnCode = 500;
assert(0);
return;
}
returnCode=0;
if (contact.exists(p_expires))
{
expires = contact.param(p_expires);
if (expires != 0)
{
//check min expires first since max expires will not return an error and will just change the expires value.
UInt32 minExpires = masterProfile->serverRegistrationMinExpiresTime();
if (expires < minExpires)
{
returnCode = 423;
expires = minExpires;
}
else
{
UInt32 maxExpires = masterProfile->serverRegistrationMaxExpiresTime();
if (expires > maxExpires)
{
expires = maxExpires;
}
}
}
}
}

| void ServerRegistrationHandler::getGlobalExpires | ( | const SipMessage & | msg, |
| SharedPtr< MasterProfile > | masterProfile, | ||
| UInt32 & | expires, | ||
| UInt32 & | returnCode | ||
| ) | [virtual] |
When processing a REGISTER request, return the desired expires value when processing the "Expires" header.
| expires | Set this to the desired expiration value for the set of contacts that do not explicitely set the "expires" param. |
| returnCode | If the REGISTER should be rejected, use this return code. A value of 423 will result in the Min-Expires header added to the response. |
Definition at line 19 of file RegistrationHandler.cxx.
References resip::SipMessage::empty(), resip::SipMessage::header(), and resip::LazyParser::isWellFormed().
Referenced by resip::ServerRegistration::processRegistration().
{
if (!masterProfile)
{
returnCode = 500;
assert(0);
return;
}
expires=3600;
returnCode=0;
if (!msg.empty(h_Expires) && msg.header(h_Expires).isWellFormed())
{
//only client specified Expires value is subject to the min/max constraints, default is used if none specified.
expires = msg.header(h_Expires).value();
if (expires != 0)
{
//check min expires first since max expires will not return an error and will just change the expires value.
UInt32 minExpires = masterProfile->serverRegistrationMinExpiresTime();
if (expires < minExpires)
{
returnCode = 423;
expires = minExpires;
}
else
{
UInt32 maxExpires = masterProfile->serverRegistrationMaxExpiresTime();
if (expires > maxExpires)
{
expires = maxExpires;
}
}
}
}
else
{
expires = masterProfile->serverRegistrationDefaultExpiresTime();
}
}

| virtual void resip::ServerRegistrationHandler::onAdd | ( | ServerRegistrationHandle | , |
| const SipMessage & | reg | ||
| ) | [pure virtual] |
Called when one or more contacts are added.
This is after authentication has all succeeded
Referenced by resip::ServerRegistration::processRegistration().
| virtual void resip::ServerRegistrationHandler::onQuery | ( | ServerRegistrationHandle | , |
| const SipMessage & | reg | ||
| ) | [pure virtual] |
Called when a client queries for the list of current registrations.
Referenced by resip::ServerRegistration::processRegistration().
| virtual void resip::ServerRegistrationHandler::onRefresh | ( | ServerRegistrationHandle | , |
| const SipMessage & | reg | ||
| ) | [pure virtual] |
Called when registration is refreshed.
Referenced by resip::ServerRegistration::processRegistration().
| virtual void resip::ServerRegistrationHandler::onRemove | ( | ServerRegistrationHandle | , |
| const SipMessage & | reg | ||
| ) | [pure virtual] |
called when one or more specified contacts is removed
Referenced by resip::ServerRegistration::processRegistration().
| virtual void resip::ServerRegistrationHandler::onRemoveAll | ( | ServerRegistrationHandle | , |
| const SipMessage & | reg | ||
| ) | [pure virtual] |
Called when all the contacts are removed using "Contact: *".
Referenced by resip::ServerRegistration::processRegistration().
1.7.5.1