reSIProcate/DialogUsageManager  9694
Public Member Functions
resip::ServerSubscriptionHandler Class Reference

#include <SubscriptionHandler.hxx>

Inheritance diagram for resip::ServerSubscriptionHandler:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~ServerSubscriptionHandler ()
virtual void onNewSubscription (ServerSubscriptionHandle, const SipMessage &sub)=0
virtual void onNewSubscriptionFromRefer (ServerSubscriptionHandle, const SipMessage &sub)
virtual void onRefresh (ServerSubscriptionHandle, const SipMessage &sub)
virtual void onPublished (ServerSubscriptionHandle associated, ServerPublicationHandle publication, const Contents *contents, const SecurityAttributes *attrs)
virtual void onNotifyRejected (ServerSubscriptionHandle, const SipMessage &msg)
virtual void onTerminated (ServerSubscriptionHandle)=0
virtual void onReadyToSend (ServerSubscriptionHandle, SipMessage &msg)
virtual void onError (ServerSubscriptionHandle, const SipMessage &msg)
virtual void onExpiredByClient (ServerSubscriptionHandle, const SipMessage &sub, SipMessage &notify)
virtual void onExpired (ServerSubscriptionHandle, SipMessage &notify)
virtual void onFlowTerminated (ServerSubscriptionHandle)
 Called when a TCP or TLS flow to the server has terminated.
virtual void getExpires (const SipMessage &msg, UInt32 &expires, int &errorResponseCode)
 Default behavior is to use the expires value in the SipMessage, if it exists.
virtual bool hasDefaultExpires () const
 dcm! -- a bit clunky, but really want these objects to not have state
virtual UInt32 getDefaultExpires () const
virtual bool hasMinExpires () const
virtual UInt32 getMinExpires () const
virtual bool hasMaxExpires () const
virtual UInt32 getMaxExpires () const
const MimesgetSupportedMimeTypes () const

Detailed Description

Definition at line 43 of file SubscriptionHandler.hxx.


Constructor & Destructor Documentation

virtual resip::ServerSubscriptionHandler::~ServerSubscriptionHandler ( ) [inline, virtual]

Definition at line 46 of file SubscriptionHandler.hxx.

{}

Member Function Documentation

UInt32 ServerSubscriptionHandler::getDefaultExpires ( ) const [virtual]

Reimplemented in RlsServerSubscriptionHandler, resip::BasicClientUserAgent, and resip::DefaultServerReferHandler.

Definition at line 63 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return 0;
}
void ServerSubscriptionHandler::getExpires ( const SipMessage msg,
UInt32 expires,
int &  errorResponseCode 
) [virtual]

Default behavior is to use the expires value in the SipMessage, if it exists.

Then verify the expires >= Min and <= Max (if set). If an expires value does not exists, use getDefaultExpires(). If hasDefaultExpires() is false, then reject the message with a 400. Set errorReturnCode to an error code >= 400 to reject this subscription.

Definition at line 92 of file SubscriptionHandler.cxx.

References resip::SipMessage::exists(), getDefaultExpires(), getMaxExpires(), getMinExpires(), hasDefaultExpires(), hasMaxExpires(), hasMinExpires(), and resip::SipMessage::header().

{
   if (msg.exists(h_Expires))
   {         
      expires = msg.header(h_Expires).value();

      if (expires > 0)
      {
         if (hasMinExpires() && (expires < getMinExpires()))
         {
            errorResponseCode = 423;
         }
         else if (hasMaxExpires() && (expires > getMaxExpires()))
         {
            expires = getMaxExpires();
         }
      }
   }
   else if (hasDefaultExpires())
   {
      expires = getDefaultExpires();
   }
   else
   {
      errorResponseCode = 400;     
   }
}

Here is the call graph for this function:

UInt32 ServerSubscriptionHandler::getMaxExpires ( ) const [virtual]

Definition at line 86 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return 0;
}
UInt32 ServerSubscriptionHandler::getMinExpires ( ) const [virtual]

Definition at line 75 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return 0;
}
const Mimes & ServerSubscriptionHandler::getSupportedMimeTypes ( ) const

Definition at line 35 of file SubscriptionHandler.cxx.

References empty.

{
   return empty;
}
bool ServerSubscriptionHandler::hasDefaultExpires ( ) const [virtual]

dcm! -- a bit clunky, but really want these objects to not have state

Reimplemented in RlsServerSubscriptionHandler, resip::BasicClientUserAgent, and resip::DefaultServerReferHandler.

Definition at line 57 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return false;
}
bool ServerSubscriptionHandler::hasMaxExpires ( ) const [virtual]

Definition at line 80 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return false;
}
bool ServerSubscriptionHandler::hasMinExpires ( ) const [virtual]

Definition at line 69 of file SubscriptionHandler.cxx.

Referenced by getExpires().

{
   return false;
}
void ServerSubscriptionHandler::onError ( ServerSubscriptionHandle  ,
const SipMessage msg 
) [virtual]
void ServerSubscriptionHandler::onExpired ( ServerSubscriptionHandle  ,
SipMessage notify 
) [virtual]

Reimplemented in resip::BasicClientUserAgent.

Definition at line 51 of file SubscriptionHandler.cxx.

Referenced by resip::ServerSubscription::dispatch().

{
}
void ServerSubscriptionHandler::onExpiredByClient ( ServerSubscriptionHandle  ,
const SipMessage sub,
SipMessage notify 
) [virtual]

Reimplemented in resip::BasicClientUserAgent.

Definition at line 46 of file SubscriptionHandler.cxx.

{
}
void ServerSubscriptionHandler::onFlowTerminated ( ServerSubscriptionHandle  h) [virtual]

Called when a TCP or TLS flow to the server has terminated.

This can be caused by socket errors, or missing CRLF keep alives pong responses from the server. supports RFC5626 (outbound). Default implementation is to tear down the subscription

Definition at line 154 of file SubscriptionHandler.cxx.

References InfoLog.

Referenced by resip::ServerSubscription::flowTerminated().

{
   InfoLog(<< "ServerSubscriptionHandler::onFlowTerminated");
   // By default, tear down the sub.
   h->end();
}
virtual void resip::ServerSubscriptionHandler::onNewSubscription ( ServerSubscriptionHandle  ,
const SipMessage sub 
) [pure virtual]
void ServerSubscriptionHandler::onNewSubscriptionFromRefer ( ServerSubscriptionHandle  ,
const SipMessage sub 
) [virtual]

Reimplemented in resip::BasicClientUserAgent, and resip::DefaultServerReferHandler.

Definition at line 149 of file SubscriptionHandler.cxx.

{
}
void ServerSubscriptionHandler::onNotifyRejected ( ServerSubscriptionHandle  h,
const SipMessage msg 
) [virtual]

Reimplemented in resip::BasicClientUserAgent.

Definition at line 138 of file SubscriptionHandler.cxx.

{
}
void ServerSubscriptionHandler::onPublished ( ServerSubscriptionHandle  associated,
ServerPublicationHandle  publication,
const Contents contents,
const SecurityAttributes attrs 
) [virtual]

Reimplemented in PrivateKeySubscriptionHandler, and CertSubscriptionHandler.

Definition at line 128 of file SubscriptionHandler.cxx.

Referenced by resip::ServerPublication::updateMatchingSubscriptions().

{
   // do nothing by default
}
void ServerSubscriptionHandler::onReadyToSend ( ServerSubscriptionHandle  h,
SipMessage msg 
) [virtual]

Reimplemented in resip::BasicClientUserAgent, and resip::DefaultServerReferHandler.

Definition at line 143 of file SubscriptionHandler.cxx.

Referenced by resip::ServerSubscription::onReadyToSend().

{
   // default is to do nothing. this is for adornment   
}
void ServerSubscriptionHandler::onRefresh ( ServerSubscriptionHandle  handle,
const SipMessage sub 
) [virtual]

Reimplemented in RlsServerSubscriptionHandler, resip::BasicClientUserAgent, and resip::DefaultServerReferHandler.

Definition at line 121 of file SubscriptionHandler.cxx.

{
   handle->send(handle->accept(200));
   handle->send(handle->neutralNotify());
}
virtual void resip::ServerSubscriptionHandler::onTerminated ( ServerSubscriptionHandle  ) [pure virtual]

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