reSIProcate/DialogUsageManager  9694
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
RegEventClient Class Reference

#include <RegEventClient.hxx>

Inheritance diagram for RegEventClient:
Inheritance graph
[legend]
Collaboration diagram for RegEventClient:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RegEventClient (resip::SharedPtr< resip::MasterProfile > profile)
virtual ~RegEventClient ()
void run ()
void watchAor (const resip::Uri &aor)
virtual void onRegEvent (const resip::Data &aor, const resip::Data &reg)=0
virtual void onRegEventError (const resip::Data &aor, const resip::Data &reg)=0

Protected Member Functions

virtual void onUpdatePending (resip::ClientSubscriptionHandle, const resip::SipMessage &notify, bool outOfOrder)
virtual void onUpdateActive (resip::ClientSubscriptionHandle, const resip::SipMessage &notify, bool outOfOrder)
virtual void onUpdateExtension (resip::ClientSubscriptionHandle, const resip::SipMessage &notify, bool outOfOrder)
virtual int onRequestRetry (resip::ClientSubscriptionHandle, int retrySeconds, const resip::SipMessage &notify)
virtual void onTerminated (resip::ClientSubscriptionHandle, const resip::SipMessage *msg)
virtual void onNewSubscription (resip::ClientSubscriptionHandle, const resip::SipMessage &notify)
virtual void onSuccess (resip::ClientRegistrationHandle, const resip::SipMessage &response)
 Called when registraion succeeds or each time it is sucessfully refreshed.
virtual void onRemoved (resip::ClientRegistrationHandle, const resip::SipMessage &response)
virtual int onRequestRetry (resip::ClientRegistrationHandle, int retrySeconds, const resip::SipMessage &response)
 call on Retry-After failure.
virtual void onFailure (resip::ClientRegistrationHandle, const resip::SipMessage &response)
 Called if registration fails, usage will be destroyed (unless a Registration retry interval is enabled in the Profile)

Protected Attributes

resip::SecuritymSecurity
resip::SipStack mStack
resip::StackThread mStackThread
resip::DialogUsageManager mDum
resip::DumThread mDumThread
resip::SharedPtr
< resip::MasterProfile
mProfile

Friends

class AddAor

Detailed Description

Definition at line 25 of file RegEventClient.hxx.


Constructor & Destructor Documentation

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

Here is the call graph for this function:

RegEventClient::~RegEventClient ( ) [virtual]

Definition at line 93 of file RegEventClient.cxx.

References mSecurity.

{
#ifdef USE_SSL
   delete mSecurity;
   mSecurity = 0;
#endif
}

Member Function Documentation

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.

{
   InfoLog (<< "Got subscription " << notify.brief());
}

Here is the call graph for this function:

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]

Implements resip::ClientRegistrationHandler.

Definition at line 64 of file RegEventClient.hxx.

      {
      }
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());
   }
}

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

void RegEventClient::run ( )

Definition at line 102 of file RegEventClient.cxx.

References mDumThread, mStackThread, and resip::ThreadIf::run().

Referenced by main().

Here is the call graph for this function:

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

{
   AddAor* add = new AddAor(*this, aor);
   mDum.post(add);
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class AddAor [friend]

Definition at line 90 of file RegEventClient.hxx.

Referenced by watchAor().


Member Data Documentation

Definition at line 86 of file RegEventClient.hxx.

Referenced by AddAor::executeCommand(), RegEventClient(), and watchAor().

Definition at line 87 of file RegEventClient.hxx.

Referenced by run().

Definition at line 89 of file RegEventClient.hxx.

Referenced by RegEventClient().

Definition at line 83 of file RegEventClient.hxx.

Referenced by ~RegEventClient().

Definition at line 84 of file RegEventClient.hxx.

Definition at line 85 of file RegEventClient.hxx.

Referenced by run().


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