reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::InviteSessionHandler Class Referenceabstract

#include <InviteSessionHandler.hxx>

Inheritance diagram for resip::InviteSessionHandler:
[legend]

Public Types

enum  TerminatedReason {
  Error , Timeout , Replaced , LocalBye ,
  RemoteBye , LocalCancel , RemoteCancel , Rejected ,
  Referred
}
 called when an dialog enters the terminated state - this can happen after getting a BYE, Cancel, or 4xx,5xx,6xx response - or the session times out More...
 

Public Member Functions

 InviteSessionHandler (bool genericOfferAnswer=false)
 
virtual ~InviteSessionHandler ()
 
virtual bool isGenericOfferAnswer ()
 
virtual void onNewSession (ClientInviteSessionHandle, InviteSession::OfferAnswerType oat, const SipMessage &msg)=0
 called when an initial INVITE or the intial response to an outoing invite

 
virtual void onNewSession (ServerInviteSessionHandle, InviteSession::OfferAnswerType oat, const SipMessage &msg)=0
 
virtual void onFailure (ClientInviteSessionHandle, const SipMessage &msg)=0
 Received a failure response from UAS.
 
virtual void onEarlyMedia (ClientInviteSessionHandle, const SipMessage &, const SdpContents &)=0
 called when an in-dialog provisional response is received that contains a body
 
virtual void onEarlyMedia (ClientInviteSessionHandle, const SipMessage &, const Contents &)
 
virtual void onProvisional (ClientInviteSessionHandle, const SipMessage &)=0
 called when dialog enters the Early state - typically after getting 18x
 
virtual void onConnected (ClientInviteSessionHandle, const SipMessage &msg)=0
 called when a dialog initiated as a UAC enters the connected state
 
virtual void onConnected (InviteSessionHandle, const SipMessage &msg)=0
 called when a dialog initiated as a UAS enters the connected state
 
virtual void onConnectedConfirmed (InviteSessionHandle, const SipMessage &msg)
 called when ACK (with out an answer) is received for initial invite (UAS)
 
virtual void onPrack (ServerInviteSessionHandle, const SipMessage &msg)
 called when PRACK is received for a reliable provisional answer (UAS)
 
virtual void onStaleCallTimeout (ClientInviteSessionHandle h)
 UAC gets no final response within the stale call timeout (default is 3 minutes).
 
virtual void terminate (ClientInviteSessionHandle h)
 called when an early dialog decides it wants to terminate the dialog.
 
virtual void onTerminated (InviteSessionHandle, InviteSessionHandler::TerminatedReason reason, const SipMessage *related=0)=0
 
virtual void onForkDestroyed (ClientInviteSessionHandle)=0
 called when a fork that was created through a 1xx never receives a 2xx because another fork answered and this fork was canceled by a proxy.
 
virtual void onRedirected (ClientInviteSessionHandle, const SipMessage &msg)=0
 called when a 3xx with valid targets is encountered in an early dialog
This is different then getting a 3xx in onTerminated, as another request will be attempted, so the DialogSet will not be destroyed.
 
virtual void onReadyToSend (InviteSessionHandle, SipMessage &msg)
 called to allow app to adorn a message. default is to send immediately
 
virtual void onAnswer (InviteSessionHandle, const SipMessage &msg, const SdpContents &)=0
 called when an answer is received - has nothing to do with user answering the call

 
virtual void onAnswer (InviteSessionHandle, const SipMessage &msg, const Contents &)
 
virtual void onOffer (InviteSessionHandle, const SipMessage &msg, const SdpContents &)=0
 called when an offer is received - must send an answer soon after this
 
virtual void onOffer (InviteSessionHandle, const SipMessage &msg, const Contents &)
 
virtual void onRemoteSdpChanged (InviteSessionHandle, const SipMessage &msg, const SdpContents &)
 called when a modified body is received in a 2xx response to a session-timer reINVITE.
 
virtual void onRemoteAnswerChanged (InviteSessionHandle, const SipMessage &msg, const Contents &)
 
virtual void onOfferRequestRejected (InviteSessionHandle, const SipMessage &msg)
 Called when an error response is received for a reinvite-nobody request (via requestOffer)
 
virtual void onOfferRequired (InviteSessionHandle, const SipMessage &msg)=0
 called when an Invite w/out offer is sent, or any other context which requires an offer from the user
 
virtual void onOfferRejected (InviteSessionHandle, const SipMessage *msg)=0
 called if an offer in a UPDATE or re-INVITE was rejected - not real useful.
 
virtual void onInfo (InviteSessionHandle, const SipMessage &msg)=0
 called when INFO message is received the application must call acceptNIT() or rejectNIT() once it is ready for another message.
 
virtual void onInfoSuccess (InviteSessionHandle, const SipMessage &msg)=0
 called when response to INFO message is received
 
virtual void onInfoFailure (InviteSessionHandle, const SipMessage &msg)=0
 
virtual void onMessage (InviteSessionHandle, const SipMessage &msg)=0
 called when MESSAGE message is received
 
virtual void onMessageSuccess (InviteSessionHandle, const SipMessage &msg)=0
 called when response to MESSAGE message is received
 
virtual void onMessageFailure (InviteSessionHandle, const SipMessage &msg)=0
 
virtual void onRefer (InviteSessionHandle, ServerSubscriptionHandle, const SipMessage &msg)=0
 called when an REFER message is received.
 
virtual void onReferNoSub (InviteSessionHandle, const SipMessage &msg)=0
 
virtual void onReferRejected (InviteSessionHandle, const SipMessage &msg)=0
 called when an REFER message receives a failure response
 
virtual void onReferAccepted (InviteSessionHandle, ClientSubscriptionHandle, const SipMessage &msg)=0
 called when an REFER message receives an accepted response
 
virtual void onAckReceived (InviteSessionHandle, const SipMessage &msg)
 called when ACK is received
 
virtual void onAckNotReceived (InviteSessionHandle)
 default behaviour is to send a BYE to end the dialog
 
virtual void onStaleReInviteTimeout (InviteSessionHandle h)
 UAC gets no final response within the stale re-invite timeout (default is 40 seconds).
 
virtual void onIllegalNegotiation (InviteSessionHandle, const SipMessage &msg)
 will be called if reINVITE or UPDATE in dialog fails
 
virtual void onSessionExpired (InviteSessionHandle)
 will be called if Session-Timers are used and Session Timer expires default behaviour is to send a BYE to send the dialog
 
virtual void onFlowTerminated (InviteSessionHandle)
 Called when a TCP or TLS flow to the server has terminated.
 

Detailed Description

Base class for class InviteSessionHandler.  The application must override this class
and provide an imlementation of the handlers below.  The class must then be set as
an invite session handler on dum (DialogUsageManager::setInviteSessionHandler()).

If you wish to handle invite session offer/answers using generic contents instead of
SDP, then construct this class with a bool argument of true, and be sure to add 
implementations of all of the handlers below that take a Contents parameter type
(ie. onEarlyMedia, onOffer, onAnswer, and onRemoteAnswerChanged).  Overriding these 
methods will cause their SdpContent counterparts to not be called.  You can then provide 
a basic empty body implementation of these SdpContent versions of the callbacks.

Example handler for generic (non-sdp only) invite sessions:
class MyInviteSessionHandler : public InviteSessionHandler
{
   MyInviteSessionHandler() : InviteSessionHandler(true) {};
   ...
   virtual void onOffer(InviteSessionHandle, const SipMessage& msg, const SdpContents&)
   {}  // No body required
   virtual void onOffer(InviteSessionHandle, const SipMessage& msg, const Contents&)
   {

Add handler body here } ... };

Definition at line 40 of file InviteSessionHandler.hxx.

Member Enumeration Documentation

◆ TerminatedReason

called when an dialog enters the terminated state - this can happen after getting a BYE, Cancel, or 4xx,5xx,6xx response - or the session times out

Enumerator
Error 
Timeout 
Replaced 
LocalBye 
RemoteBye 
LocalCancel 
RemoteCancel 
Rejected 
Referred 

slg! - This is really Redirected - not sure why it is called Referred. Only gets used when we send a redirect (ie: 302).

Definition at line 87 of file InviteSessionHandler.hxx.

Constructor & Destructor Documentation

◆ InviteSessionHandler()

resip::InviteSessionHandler::InviteSessionHandler ( bool  genericOfferAnswer = false)
inline

Definition at line 43 of file InviteSessionHandler.hxx.

◆ ~InviteSessionHandler()

virtual resip::InviteSessionHandler::~InviteSessionHandler ( )
inlinevirtual

Definition at line 44 of file InviteSessionHandler.hxx.

Member Function Documentation

◆ isGenericOfferAnswer()

virtual bool resip::InviteSessionHandler::isGenericOfferAnswer ( )
inlinevirtual

Definition at line 45 of file InviteSessionHandler.hxx.

◆ onAckNotReceived()

void InviteSessionHandler::onAckNotReceived ( InviteSessionHandle  handle)
virtual

default behaviour is to send a BYE to end the dialog

Definition at line 40 of file InviteSessionHandler.cxx.

◆ onAckReceived()

void InviteSessionHandler::onAckReceived ( InviteSessionHandle  ,
const SipMessage &  msg 
)
virtual

called when ACK is received

Definition at line 35 of file InviteSessionHandler.cxx.

◆ onAnswer() [1/2]

void InviteSessionHandler::onAnswer ( InviteSessionHandle  h,
const SipMessage &  msg,
const Contents &  body 
)
virtual

Definition at line 67 of file InviteSessionHandler.cxx.

◆ onAnswer() [2/2]

virtual void resip::InviteSessionHandler::onAnswer ( InviteSessionHandle  ,
const SipMessage &  msg,
const SdpContents &   
)
pure virtual

called when an answer is received - has nothing to do with user answering the call

Implemented in recon::ConversationManager.

◆ onConnected() [1/2]

virtual void resip::InviteSessionHandler::onConnected ( ClientInviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when a dialog initiated as a UAC enters the connected state

Implemented in recon::ConversationManager.

◆ onConnected() [2/2]

virtual void resip::InviteSessionHandler::onConnected ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when a dialog initiated as a UAS enters the connected state

Implemented in recon::ConversationManager.

◆ onConnectedConfirmed()

void InviteSessionHandler::onConnectedConfirmed ( InviteSessionHandle  handle,
const SipMessage &  msg 
)
virtual

called when ACK (with out an answer) is received for initial invite (UAS)

Reimplemented in recon::ConversationManager.

Definition at line 116 of file InviteSessionHandler.cxx.

◆ onEarlyMedia() [1/2]

void InviteSessionHandler::onEarlyMedia ( ClientInviteSessionHandle  h,
const SipMessage &  msg,
const Contents &  body 
)
virtual

Definition at line 12 of file InviteSessionHandler.cxx.

◆ onEarlyMedia() [2/2]

virtual void resip::InviteSessionHandler::onEarlyMedia ( ClientInviteSessionHandle  ,
const SipMessage &  ,
const SdpContents &   
)
pure virtual

called when an in-dialog provisional response is received that contains a body

Implemented in recon::ConversationManager.

◆ onFailure()

virtual void resip::InviteSessionHandler::onFailure ( ClientInviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

Received a failure response from UAS.

Implemented in recon::ConversationManager.

◆ onFlowTerminated()

void InviteSessionHandler::onFlowTerminated ( InviteSessionHandle  )
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 do nothing

Definition at line 126 of file InviteSessionHandler.cxx.

◆ onForkDestroyed()

virtual void resip::InviteSessionHandler::onForkDestroyed ( ClientInviteSessionHandle  )
pure virtual

called when a fork that was created through a 1xx never receives a 2xx because another fork answered and this fork was canceled by a proxy.


Implemented in recon::ConversationManager.

◆ onIllegalNegotiation()

void InviteSessionHandler::onIllegalNegotiation ( InviteSessionHandle  handle,
const SipMessage &  msg 
)
virtual

will be called if reINVITE or UPDATE in dialog fails

Definition at line 54 of file InviteSessionHandler.cxx.

◆ onInfo()

virtual void resip::InviteSessionHandler::onInfo ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when INFO message is received the application must call acceptNIT() or rejectNIT() once it is ready for another message.

Implemented in recon::ConversationManager.

◆ onInfoFailure()

virtual void resip::InviteSessionHandler::onInfoFailure ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

Implemented in recon::ConversationManager.

◆ onInfoSuccess()

virtual void resip::InviteSessionHandler::onInfoSuccess ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when response to INFO message is received

Implemented in recon::ConversationManager.

◆ onMessage()

virtual void resip::InviteSessionHandler::onMessage ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when MESSAGE message is received

Implemented in recon::ConversationManager.

◆ onMessageFailure()

virtual void resip::InviteSessionHandler::onMessageFailure ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

Implemented in recon::ConversationManager.

◆ onMessageSuccess()

virtual void resip::InviteSessionHandler::onMessageSuccess ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when response to MESSAGE message is received

Implemented in recon::ConversationManager.

◆ onNewSession() [1/2]

virtual void resip::InviteSessionHandler::onNewSession ( ClientInviteSessionHandle  ,
InviteSession::OfferAnswerType  oat,
const SipMessage &  msg 
)
pure virtual

called when an initial INVITE or the intial response to an outoing invite

Implemented in recon::ConversationManager.

◆ onNewSession() [2/2]

virtual void resip::InviteSessionHandler::onNewSession ( ServerInviteSessionHandle  ,
InviteSession::OfferAnswerType  oat,
const SipMessage &  msg 
)
pure virtual

Implemented in recon::ConversationManager.

◆ onOffer() [1/2]

void InviteSessionHandler::onOffer ( InviteSessionHandle  h,
const SipMessage &  msg,
const Contents &  body 
)
virtual

Definition at line 78 of file InviteSessionHandler.cxx.

◆ onOffer() [2/2]

virtual void resip::InviteSessionHandler::onOffer ( InviteSessionHandle  ,
const SipMessage &  msg,
const SdpContents &   
)
pure virtual

called when an offer is received - must send an answer soon after this

Implemented in recon::ConversationManager.

◆ onOfferRejected()

virtual void resip::InviteSessionHandler::onOfferRejected ( InviteSessionHandle  ,
const SipMessage *  msg 
)
pure virtual

called if an offer in a UPDATE or re-INVITE was rejected - not real useful.

A SipMessage is provided if one is available

Implemented in recon::ConversationManager.

◆ onOfferRequestRejected()

void InviteSessionHandler::onOfferRequestRejected ( InviteSessionHandle  ,
const SipMessage &  msg 
)
virtual

Called when an error response is received for a reinvite-nobody request (via requestOffer)

Reimplemented in recon::ConversationManager.

Definition at line 111 of file InviteSessionHandler.cxx.

◆ onOfferRequired()

virtual void resip::InviteSessionHandler::onOfferRequired ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when an Invite w/out offer is sent, or any other context which requires an offer from the user

Implemented in recon::ConversationManager.

◆ onPrack()

void InviteSessionHandler::onPrack ( ServerInviteSessionHandle  ,
const SipMessage &  msg 
)
virtual

called when PRACK is received for a reliable provisional answer (UAS)

Definition at line 121 of file InviteSessionHandler.cxx.

◆ onProvisional()

virtual void resip::InviteSessionHandler::onProvisional ( ClientInviteSessionHandle  ,
const SipMessage &   
)
pure virtual

called when dialog enters the Early state - typically after getting 18x

Implemented in recon::ConversationManager.

◆ onReadyToSend()

void InviteSessionHandler::onReadyToSend ( InviteSessionHandle  ,
SipMessage &  msg 
)
virtual

called to allow app to adorn a message. default is to send immediately

Definition at line 105 of file InviteSessionHandler.cxx.

◆ onRedirected()

virtual void resip::InviteSessionHandler::onRedirected ( ClientInviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when a 3xx with valid targets is encountered in an early dialog
This is different then getting a 3xx in onTerminated, as another request will be attempted, so the DialogSet will not be destroyed.

Basically an onTermintated that conveys more information. checking for 3xx respones in onTerminated will not work as there may be no valid targets.

Implemented in recon::ConversationManager.

◆ onRefer()

virtual void resip::InviteSessionHandler::onRefer ( InviteSessionHandle  ,
ServerSubscriptionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when an REFER message is received.

The refer is accepted or rejected using the server subscription. If the offer is accepted, DialogUsageManager::makeInviteSessionFromRefer can be used to create an InviteSession that will send notify messages using the ServerSubscription

Implemented in recon::ConversationManager.

◆ onReferAccepted()

virtual void resip::InviteSessionHandler::onReferAccepted ( InviteSessionHandle  ,
ClientSubscriptionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when an REFER message receives an accepted response

Implemented in recon::ConversationManager.

◆ onReferNoSub()

virtual void resip::InviteSessionHandler::onReferNoSub ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

Implemented in recon::ConversationManager.

◆ onReferRejected()

virtual void resip::InviteSessionHandler::onReferRejected ( InviteSessionHandle  ,
const SipMessage &  msg 
)
pure virtual

called when an REFER message receives a failure response

Implemented in recon::ConversationManager.

◆ onRemoteAnswerChanged()

void InviteSessionHandler::onRemoteAnswerChanged ( InviteSessionHandle  h,
const SipMessage &  msg,
const Contents &  body 
)
virtual

Definition at line 94 of file InviteSessionHandler.cxx.

◆ onRemoteSdpChanged()

void InviteSessionHandler::onRemoteSdpChanged ( InviteSessionHandle  ,
const SipMessage &  msg,
const SdpContents &   
)
virtual

called when a modified body is received in a 2xx response to a session-timer reINVITE.

Under normal circumstances where the response body is unchanged from current remote body no handler is called

Reimplemented in recon::ConversationManager.

Definition at line 89 of file InviteSessionHandler.cxx.

◆ onSessionExpired()

void InviteSessionHandler::onSessionExpired ( InviteSessionHandle  handle)
virtual

will be called if Session-Timers are used and Session Timer expires default behaviour is to send a BYE to send the dialog

Definition at line 60 of file InviteSessionHandler.cxx.

◆ onStaleCallTimeout()

void InviteSessionHandler::onStaleCallTimeout ( ClientInviteSessionHandle  h)
virtual

UAC gets no final response within the stale call timeout (default is 3 minutes).

This is just a notification. After the notification is called, the InviteSession will then call InviteSessionHandler::terminate()

Reimplemented in recon::ConversationManager.

Definition at line 23 of file InviteSessionHandler.cxx.

◆ onStaleReInviteTimeout()

void InviteSessionHandler::onStaleReInviteTimeout ( InviteSessionHandle  h)
virtual

UAC gets no final response within the stale re-invite timeout (default is 40 seconds).

Default behaviour is to send a BYE to end the dialog.

Definition at line 47 of file InviteSessionHandler.cxx.

◆ onTerminated()

virtual void resip::InviteSessionHandler::onTerminated ( InviteSessionHandle  ,
InviteSessionHandler::TerminatedReason  reason,
const SipMessage *  related = 0 
)
pure virtual

Implemented in recon::ConversationManager.

◆ terminate()

void InviteSessionHandler::terminate ( ClientInviteSessionHandle  h)
virtual

called when an early dialog decides it wants to terminate the dialog.

Default behavior is to CANCEL all related early dialogs as well.

Definition at line 29 of file InviteSessionHandler.cxx.


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