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


Definition at line 25 of file RegEventClient.hxx.
| RegEventClient::RegEventClient | ( | resip::SharedPtr< resip::MasterProfile > | profile | ) |
Definition at line 68 of file RegEventClient.cxx.
References resip::DialogUsageManager::addClientSubscriptionHandler(), resip::DialogUsageManager::addTransport(), mDum, mProfile, regEvent, resip::DialogUsageManager::setClientAuthManager(), resip::DialogUsageManager::setClientRegistrationHandler(), resip::DialogUsageManager::setMasterProfile(), TCP, UDP, and resip::Token::value().
: mSecurity(0), mStack(mSecurity), mStackThread(mStack), mDum(mStack), mDumThread(mDum), mProfile(profile) { mDum.addTransport(UDP, 5060); mDum.addTransport(TCP, 5060); mProfile->addSupportedMethod(NOTIFY); mProfile->addAllowedEvent(regEvent); mProfile->validateAcceptEnabled() = false; mProfile->validateContentEnabled() = false; mProfile->setUserAgent("RFC3680-testUA"); mDum.setMasterProfile(mProfile); std::auto_ptr<resip::ClientAuthManager> clam(new resip::ClientAuthManager()); mDum.setClientAuthManager(clam); mDum.setClientRegistrationHandler(this); mDum.addClientSubscriptionHandler(regEvent.value(), this); }

| RegEventClient::~RegEventClient | ( | ) | [virtual] |
Definition at line 93 of file RegEventClient.cxx.
References mSecurity.
| virtual void RegEventClient::onFailure | ( | resip::ClientRegistrationHandle | , |
| const resip::SipMessage & | response | ||
| ) | [inline, protected, virtual] |
Called if registration fails, usage will be destroyed (unless a Registration retry interval is enabled in the Profile)
Implements resip::ClientRegistrationHandler.
Definition at line 76 of file RegEventClient.hxx.
{
}
| void RegEventClient::onNewSubscription | ( | resip::ClientSubscriptionHandle | h, |
| const resip::SipMessage & | notify | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 152 of file RegEventClient.cxx.
References resip::Message::brief(), and InfoLog.

| virtual void RegEventClient::onRegEvent | ( | const resip::Data & | aor, |
| const resip::Data & | reg | ||
| ) | [pure virtual] |
Implemented in MyApp.
Referenced by onUpdateActive(), and onUpdatePending().
| virtual void RegEventClient::onRegEventError | ( | const resip::Data & | aor, |
| const resip::Data & | reg | ||
| ) | [pure virtual] |
Implemented in MyApp.
| virtual void RegEventClient::onRemoved | ( | resip::ClientRegistrationHandle | , |
| const resip::SipMessage & | response | ||
| ) | [inline, protected, virtual] |
| int RegEventClient::onRequestRetry | ( | resip::ClientSubscriptionHandle | , |
| int | retrySeconds, | ||
| const resip::SipMessage & | notify | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 186 of file RegEventClient.cxx.
{
return -1;
}
| virtual int RegEventClient::onRequestRetry | ( | resip::ClientRegistrationHandle | , |
| int | retrySeconds, | ||
| const resip::SipMessage & | response | ||
| ) | [inline, protected, virtual] |
call on Retry-After failure.
return values: -1 = fail, 0 = retry immediately, N = retry in N seconds
Implements resip::ClientRegistrationHandler.
Definition at line 69 of file RegEventClient.hxx.
{
return -1;
}
| virtual void RegEventClient::onSuccess | ( | resip::ClientRegistrationHandle | , |
| const resip::SipMessage & | response | ||
| ) | [inline, protected, virtual] |
Called when registraion succeeds or each time it is sucessfully refreshed.
Implements resip::ClientRegistrationHandler.
Definition at line 59 of file RegEventClient.hxx.
{
}
| void RegEventClient::onTerminated | ( | resip::ClientSubscriptionHandle | , |
| const resip::SipMessage * | msg | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 192 of file RegEventClient.cxx.
References resip::Message::brief(), and WarningLog.
{
WarningLog (<< "Subscription terminated " << (msg ? "with message " : " with no message"));
if(msg)
{
WarningLog(<< msg->brief());
}
}

| void RegEventClient::onUpdateActive | ( | resip::ClientSubscriptionHandle | h, |
| const resip::SipMessage & | notify, | ||
| bool | outOfOrder | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 169 of file RegEventClient.cxx.
References onRegEvent(), and toGenericContents().
{
h->acceptUpdate();
const OctetContents* generic = toGenericContents(notify);
if (generic)
{
onRegEvent(h->getDocumentKey(), generic->octets());
}
}

| void RegEventClient::onUpdateExtension | ( | resip::ClientSubscriptionHandle | h, |
| const resip::SipMessage & | notify, | ||
| bool | outOfOrder | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 180 of file RegEventClient.cxx.
{
h->acceptUpdate();
}
| void RegEventClient::onUpdatePending | ( | resip::ClientSubscriptionHandle | h, |
| const resip::SipMessage & | notify, | ||
| bool | outOfOrder | ||
| ) | [protected, virtual] |
Implements resip::ClientSubscriptionHandler.
Definition at line 158 of file RegEventClient.cxx.
References onRegEvent(), and toGenericContents().
{
h->acceptUpdate();
const OctetContents* generic = toGenericContents(notify);
if (generic)
{
onRegEvent(h->getDocumentKey(), generic->octets());
}
}

| void RegEventClient::run | ( | ) |
Definition at line 102 of file RegEventClient.cxx.
References mDumThread, mStackThread, and resip::ThreadIf::run().
Referenced by main().
{
mStackThread.run();
mDumThread.run();
}

| void RegEventClient::watchAor | ( | const resip::Uri & | aor | ) |
Definition at line 109 of file RegEventClient.cxx.
References AddAor, mDum, and resip::TransactionUser::post().
Referenced by main().

friend class AddAor [friend] |
Definition at line 90 of file RegEventClient.hxx.
Referenced by watchAor().
resip::DialogUsageManager RegEventClient::mDum [protected] |
Definition at line 86 of file RegEventClient.hxx.
Referenced by AddAor::executeCommand(), RegEventClient(), and watchAor().
resip::DumThread RegEventClient::mDumThread [protected] |
Definition at line 87 of file RegEventClient.hxx.
Referenced by run().
resip::SharedPtr<resip::MasterProfile> RegEventClient::mProfile [protected] |
Definition at line 89 of file RegEventClient.hxx.
Referenced by RegEventClient().
resip::Security* RegEventClient::mSecurity [protected] |
Definition at line 83 of file RegEventClient.hxx.
Referenced by ~RegEventClient().
resip::SipStack RegEventClient::mStack [protected] |
Definition at line 84 of file RegEventClient.hxx.
resip::StackThread RegEventClient::mStackThread [protected] |
Definition at line 85 of file RegEventClient.hxx.
Referenced by run().
1.7.5.1