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

#include <ServerInviteSession.hxx>

Inheritance diagram for resip::ServerInviteSession:
[legend]

Public Types

typedef Handle< ServerInviteSession > ServerInviteSessionHandle
 
- Public Types inherited from resip::InviteSession
enum  OfferAnswerType { None , Offer , Answer }
 
enum  EndReason {
  NotSpecified =0 , UserHangup , AppRejectedSdp , IllegalNegotiation ,
  AckNotReceived , SessionExpired , StaleReInvite , ENDREASON_MAX ,
  UserSpecified
}
 
- Public Types inherited from resip::Handled
enum  { npos = 0 }
 
typedef unsigned long Id
 

Public Member Functions

 ServerInviteSession (const ServerInviteSession &)=delete
 
 ServerInviteSession (ServerInviteSession &&)=delete
 
ServerInviteSession & operator= (const ServerInviteSession &)=delete
 
ServerInviteSession & operator= (ServerInviteSession &&)=delete
 
ServerInviteSessionHandle getHandle ()
 
void redirect (const NameAddrs &contacts, int code=302)
 send a 3xx
 
void provisional (int code=180, bool earlyFlag=true)
 send a 1xx - provisional response.
 
virtual void provideOffer (const Contents &offer)
 Called to set the offer that will be used in the next message that sends an offer.
 
virtual void provideOffer (const Contents &offer, DialogUsageManager::EncryptionLevel level, const Contents *alternative)
 
virtual void provideOffer (const Contents &offer, bool sendOfferAtAccept)
 
virtual void provideOffer (const Contents &offer, DialogUsageManager::EncryptionLevel level, const Contents *alternative, bool sendOfferAtAccept)
 
virtual void requestOffer ()
 Called to request that the far end provide an offer.
 
virtual void provideAnswer (const Contents &answer)
 Similar to provideOffer - called to set the answer to be signaled to the peer.
 
virtual void end (const Data &userReason)
 Makes the specific dialog end.
 
virtual void end (const ParserContainer< Token > &endReasons)
 
virtual void end (EndReason reason)
 
virtual void end ()
 
virtual void reject (int statusCode, WarningCategory *warning=0)
 Rejects an offer at the SIP level.
 
virtual void reject (int statusCode, const Contents *contents, WarningCategory *warning=0)
 
void accept (int statusCode=200)
 accept an initial invite (2xx) - this is only applicable to the UAS
 
void redirectCommand (const NameAddrs &contacts, int code=302)
 Provide asynchronous method access by using command.
 
void provisionalCommand (int code=180, bool earlyFlag=true)
 
void acceptCommand (int statusCode=200)
 
- Public Member Functions inherited from resip::InviteSession
 InviteSession (const InviteSession &)=delete
 
 InviteSession (InviteSession &&)=delete
 
InviteSession & operator= (const InviteSession &)=delete
 
InviteSession & operator= (InviteSession &&)=delete
 
virtual void targetRefresh (const NameAddr &localUri)
 will send a reINVITE (current offerAnswer) or UPDATE with new Contact header
 
virtual void refer (const NameAddr &referTo, bool referSub=true)
 sends a refer request
 
virtual void refer (const NameAddr &referTo, const NameAddr &referredBy, bool referSub=true)
 
virtual void refer (const NameAddr &referTo, std::unique_ptr< resip::Contents > contents, bool referSub=true)
 
virtual void refer (const NameAddr &referTo, const NameAddr &referredBy, std::unique_ptr< resip::Contents > contents, bool referSub=true)
 
virtual void refer (const NameAddr &referTo, InviteSessionHandle sessionToReplace, bool referSub=true)
 sends a refer request with a replaces header
 
virtual void refer (const NameAddr &referTo, InviteSessionHandle sessionToReplace, std::unique_ptr< resip::Contents > contents, bool referSub=true)
 
virtual void refer (const NameAddr &referTo, const CallId &replaces, bool referSub=true)
 
virtual void refer (const NameAddr &referTo, const CallId &replaces, std::unique_ptr< resip::Contents > contents, bool referSub=true)
 
virtual void info (const Contents &contents)
 sends an info request
 
virtual void message (const Contents &contents)
 sends a message request
 
virtual void acceptNIT (int statusCode=200, const Contents *contents=0)
 accepts an INFO or MESSAGE request with a 2xx and an optional contents
 
virtual void rejectNIT (int statusCode=488)
 rejects an INFO or MESSAGE request with an error status code
 
std::shared_ptr< SipMessage > getLastSentNITRequest () const
 gets the last NIT request that was sent by the session
 
virtual void provideOfferCommand (const Contents &offer)
 Provide asynchronous method access by using command.
 
virtual void provideOfferCommand (const Contents &offer, DialogUsageManager::EncryptionLevel level, const Contents *alternative)
 
virtual void provideAnswerCommand (const Contents &answer)
 
virtual void endCommand (EndReason reason=NotSpecified)
 Asynchronously makes the specific dialog end.
 
virtual void endCommand (const Data &userReason)
 
virtual void endCommand (const resip::ParserContainer< resip::Token > &endReasons)
 
virtual void rejectCommand (int statusCode, WarningCategory *warning=0)
 Asynchronously rejects an offer at the SIP level.
 
virtual void rejectCommand (int statusCode, const Contents *contents, WarningCategory *warning=0)
 
virtual void referCommand (const NameAddr &referTo, bool referSub=true)
 
virtual void referCommand (const NameAddr &referTo, InviteSessionHandle sessionToReplace, bool referSub=true)
 
virtual void infoCommand (const Contents &contents)
 
virtual void messageCommand (const Contents &contents)
 
virtual void acceptNITCommand (int statusCode=200, const Contents *contents=0)
 Asynchronously accepts an INFO or MESSAGE request with a 2xx and an optional contents.
 
virtual void rejectNITCommand (int statusCode=488)
 Asynchronously rejects an INFO or MESSAGE request with an error status code.
 
virtual void acceptReferNoSub (int statusCode=200)
 
virtual void rejectReferNoSub (int responseCode)
 
bool hasLocalOfferAnswer () const
 
const Contents & getLocalOfferAnswer () const
 
bool hasRemoteOfferAnswer () const
 
const Contents & getRemoteOfferAnswer () const
 
bool hasProposedRemoteOfferAnswer () const
 
const Contents & getProposedRemoteOfferAnswer () const
 
bool hasLocalSdp () const
 
const SdpContents & getLocalSdp () const
 
bool hasRemoteSdp () const
 
const SdpContents & getRemoteSdp () const
 
bool hasProposedRemoteSdp () const
 
const SdpContents & getProposedRemoteSdp () const
 
bool isConnected () const
 
bool isSessionModificationInFlight () const
 
bool isTerminated () const
 
bool isEarly () const
 
bool isAccepted () const
 
Tokens & getPeerSupportedMethods ()
 
Tokens & getPeerSupportedOptionTags ()
 
Tokens & getPeerRequiresOptionsTags ()
 
Mimes & getPeerSupportedMimeTypes ()
 
Tokens & getPeerSupportedEncodings ()
 
Tokens & getPeerSupportedLanguages ()
 
Tokens & getPeerAllowedEvents ()
 
Data & getPeerUserAgent ()
 
NameAddrs & getPeerPAssertedIdentities ()
 
EncodeStream & dump (EncodeStream &strm) const override
 
InviteSessionHandle getSessionHandle ()
 
- Public Member Functions inherited from resip::DialogUsage
AppDialogSetHandle getAppDialogSet () const
 
AppDialogHandle getAppDialog () const
 
const NameAddr & myAddr () const noexcept
 
const NameAddr & peerAddr () const noexcept
 
const NameAddr & remoteTarget () const noexcept
 
const NameAddr & pendingRemoteTarget () const
 
const NameAddrs & getRouteSet () const noexcept
 
const DialogId & getDialogId () const
 
const Data & getCallId () const
 
std::shared_ptr< UserProfile > getUserProfile () const
 
- Public Member Functions inherited from resip::BaseUsage
virtual void postDum (Message *messageForDum)
 posts a message on dum
 
- Public Member Functions inherited from resip::Handled
 Handled (HandleManager &ham)
 
virtual ~Handled ()
 

Friends

class Dialog
 

Additional Inherited Members

- Protected Types inherited from resip::InviteSession
enum  State {
  Undefined , Connected , SentUpdate , SentUpdateGlare ,
  SentReinvite , SentReinviteGlare , SentReinviteNoOffer , SentReinviteAnswered ,
  SentReinviteNoOfferGlare , SentOptions , SentOptionsGlare , ReceivedUpdate ,
  ReceivedReinvite , ReceivedReinviteNoOffer , ReceivedReinviteSentOffer , Answered ,
  WaitingToOffer , WaitingToRequestOffer , WaitingToTerminate , WaitingToHangup ,
  Terminated , UAC_Start , UAC_Early , UAC_EarlyWithOffer ,
  UAC_EarlyWithAnswer , UAC_Answered , UAC_SentUpdateEarly , UAC_SentUpdateEarlyGlare ,
  UAC_ReceivedUpdateEarly , UAC_SentAnswer , UAC_QueuedUpdate , UAC_Cancelled ,
  UAS_Start , UAS_Offer , UAS_OfferProvidedAnswer , UAS_EarlyOffer ,
  UAS_EarlyProvidedAnswer , UAS_NoOffer , UAS_ProvidedOffer , UAS_EarlyNoOffer ,
  UAS_EarlyProvidedOffer , UAS_Accepted , UAS_WaitingToOffer , UAS_WaitingToRequestOffer ,
  UAS_AcceptedWaitingAnswer , UAS_OfferReliable , UAS_OfferReliableProvidedAnswer , UAS_NoOfferReliable ,
  UAS_ProvidedOfferReliable , UAS_FirstSentOfferReliable , UAS_FirstSentAnswerReliable , UAS_NoAnswerReliableWaitingPrack ,
  UAS_NegotiatedReliable , UAS_NoAnswerReliable , UAS_SentUpdate , UAS_SentUpdateAccepted ,
  UAS_SentUpdateGlare , UAS_ReceivedUpdate , UAS_ReceivedUpdateWaitingAnswer , UAS_WaitingToHangup
}
 
enum  Event {
  OnRedirect , OnGeneralFailure , OnInvite , OnInviteOffer ,
  OnInviteReliableOffer , OnInviteReliable , OnCancel , OnBye ,
  On200Bye , On1xx , On1xxEarly , On1xxOffer ,
  On1xxAnswer , On2xx , On2xxOffer , On2xxAnswer ,
  On422Invite , On487Invite , On491Invite , OnInviteFailure ,
  OnAck , OnAckAnswer , On200Cancel , OnCancelFailure ,
  OnUpdate , OnUpdateOffer , OnUpdateRejected , On422Update ,
  On491Update , On200Update , OnPrack , On200Prack ,
  OnOptions , On200Options , On491Options , Unknown
}
 
enum  NitState { NitComplete , NitProceeding }
 
typedef HashMap< Data, std::shared_ptr< SipMessage > > AckMap
 
- Protected Member Functions inherited from resip::InviteSession
 InviteSession (DialogUsageManager &dum, Dialog &dialog)
 
virtual ~InviteSession ()
 
virtual void onReadyToSend (SipMessage &msg) override
 
virtual void flowTerminated ()
 
void dispatchConnected (const SipMessage &msg)
 
void dispatchSentUpdate (const SipMessage &msg)
 
void dispatchSentReinvite (const SipMessage &msg)
 
void dispatchSentReinviteNoOffer (const SipMessage &msg)
 
void dispatchSentReinviteAnswered (const SipMessage &msg)
 
void dispatchGlare (const SipMessage &msg)
 
void dispatchSentOptions (const SipMessage &msg)
 
void dispatchReinviteNoOfferGlare (const SipMessage &msg)
 
void dispatchReceivedUpdateOrReinvite (const SipMessage &msg)
 
void dispatchReceivedReinviteSentOffer (const SipMessage &msg)
 
void dispatchAnswered (const SipMessage &msg)
 
void dispatchWaitingToOffer (const SipMessage &msg)
 
void dispatchWaitingToRequestOffer (const SipMessage &msg)
 
void dispatchWaitingToTerminate (const SipMessage &msg)
 
void dispatchWaitingToHangup (const SipMessage &msg)
 
void dispatchTerminated (const SipMessage &msg)
 
void dispatchBye (const SipMessage &msg)
 
void dispatchInfo (const SipMessage &msg)
 
void dispatchMessage (const SipMessage &msg)
 
void dispatchOptions (const SipMessage &msg)
 
bool isAckForCurrent200 (const SipMessage &ack) const
 
void startRetransmit200Timer ()
 
void start491Timer ()
 
void startStaleReInviteTimer ()
 
void setSessionTimerHeaders (SipMessage &msg)
 
void sessionRefresh ()
 
void checkDeferredSessionExpiration ()
 
bool expireSessionAfterFailedModification ()
 
void setSessionTimerPreferences ()
 
void startSessionTimer ()
 
void handleSessionTimerResponse (const SipMessage &msg)
 
void handleSessionTimerRequest (SipMessage &response, const SipMessage &request)
 
void transition (State target)
 
std::unique_ptr< Contents > getOfferAnswer (const SipMessage &msg)
 
bool isReliable (const SipMessage &msg) const
 
void provideProposedOffer ()
 
void storePeerCapabilities (const SipMessage &msg)
 
bool updateMethodSupported () const
 
bool sessionTimerSupportedLocalAndPeer () const
 
std::shared_ptr< SipMessage > sendAck (const Contents *answer=0)
 
std::shared_ptr< SipMessage > sendBye ()
 
const Data & getEndReasonString (InviteSession::EndReason reason)
 
DialogUsageManager::EncryptionLevel getEncryptionLevel (const SipMessage &msg)
 
void setCurrentLocalOfferAnswer (const SipMessage &msg)
 
void referNoSub (const SipMessage &msg)
 
Event toEvent (const SipMessage &msg, const Contents *offeranswer)
 
void nitComplete ()
 
- Protected Member Functions inherited from resip::DialogUsage
virtual void send (std::shared_ptr< SipMessage > msg)
 
virtual void sendCommand (std::shared_ptr< SipMessage > msg)
 
 DialogUsage (DialogUsageManager &dum, Dialog &dialog)
 
virtual ~DialogUsage ()
 
- Protected Member Functions inherited from resip::BaseUsage
 BaseUsage (DialogUsageManager &dum)
 
virtual ~BaseUsage ()
 
BaseUsageHandle getBaseHandle () const
 
- Static Protected Member Functions inherited from resip::InviteSession
static Data toData (State state)
 
static std::unique_ptr< Contents > makeOfferAnswer (const Contents &offerAnswer)
 
static std::unique_ptr< Contents > makeOfferAnswer (const Contents &offerAnswer, const Contents *alternative)
 
static void setOfferAnswer (SipMessage &msg, const Contents &offerAnswer, const Contents *alternative=0)
 
static void setOfferAnswer (SipMessage &msg, const Contents *offerAnswer)
 
- Protected Attributes inherited from resip::InviteSession
Tokens mPeerSupportedMethods
 
Tokens mPeerSupportedOptionTags
 
Tokens mPeerRequiresOptionTags
 
Mimes mPeerSupportedMimeTypes
 
Tokens mPeerSupportedEncodings
 
Tokens mPeerSupportedLanguages
 
Tokens mPeerAllowedEvents
 
Data mPeerUserAgent
 
NameAddrs mPeerPAssertedIdentities
 
bool mPeerSupportsSessionTimer
 
State mState
 
NitState mNitState
 
NitState mServerNitState
 
std::unique_ptr< Contents > mCurrentLocalOfferAnswer
 
std::unique_ptr< Contents > mProposedLocalOfferAnswer
 
std::unique_ptr< Contents > mCurrentRemoteOfferAnswer
 
std::unique_ptr< Contents > mProposedRemoteOfferAnswer
 
std::shared_ptr< SipMessage > mLastLocalSessionModification
 
std::shared_ptr< SipMessage > mLastRemoteSessionModification
 
std::shared_ptr< SipMessage > mInvite200
 
std::shared_ptr< SipMessage > mLastNitResponse
 
SipMessage mLastReferNoSubRequest
 
unsigned long mCurrentRetransmit200
 
unsigned int mStaleReInviteTimerSeq
 
uint32_t mSessionInterval
 
uint32_t mMinSE
 
bool mSessionRefresher
 
unsigned int mSessionRefreshTimerSeq
 
unsigned int mSessionExpirationTimerSeq
 
bool mSessionRefreshReInvite
 
bool mSessionExpirationPending
 
std::queue< QueuedNIT * > mNITQueue
 
bool mReferSub
 
std::shared_ptr< SipMessage > mLastSentNITRequest
 
DialogUsageManager::EncryptionLevel mCurrentEncryptionLevel
 
DialogUsageManager::EncryptionLevel mProposedEncryptionLevel
 
EndReason mEndReason
 
Data mUserEndReason
 
ParserContainer< Token > mUserEndReasons
 
AckMap mAcks
 
- Protected Attributes inherited from resip::DialogUsage
Dialog & mDialog
 
- Protected Attributes inherited from resip::BaseUsage
DialogUsageManager & mDum
 
- Protected Attributes inherited from resip::Handled
HandleManager & mHam
 
Handled::Id mId
 

Detailed Description

Definition at line 12 of file ServerInviteSession.hxx.

Member Typedef Documentation

◆ ServerInviteSessionHandle

Constructor & Destructor Documentation

◆ ServerInviteSession() [1/2]

resip::ServerInviteSession::ServerInviteSession ( const ServerInviteSession &  )
delete

◆ ServerInviteSession() [2/2]

resip::ServerInviteSession::ServerInviteSession ( ServerInviteSession &&  )
delete

Member Function Documentation

◆ accept()

void ServerInviteSession::accept ( int  statusCode = 200)

accept an initial invite (2xx) - this is only applicable to the UAS

Definition at line 681 of file ServerInviteSession.cxx.

◆ acceptCommand()

void ServerInviteSession::acceptCommand ( int  statusCode = 200)

Definition at line 796 of file ServerInviteSession.cxx.

◆ end() [1/4]

void ServerInviteSession::end ( )
virtual

Reimplemented from resip::InviteSession.

Definition at line 512 of file ServerInviteSession.cxx.

◆ end() [2/4]

void ServerInviteSession::end ( const Data &  userReason)
virtual

Makes the specific dialog end.

Will send a 480.

Reimplemented from resip::InviteSession.

Definition at line 518 of file ServerInviteSession.cxx.

◆ end() [3/4]

void ServerInviteSession::end ( const ParserContainer< Token > &  endReasons)
virtual

Reimplemented from resip::InviteSession.

Definition at line 525 of file ServerInviteSession.cxx.

◆ end() [4/4]

void ServerInviteSession::end ( EndReason  reason)
virtual

Reimplemented from resip::InviteSession.

Definition at line 532 of file ServerInviteSession.cxx.

◆ getHandle()

ServerInviteSessionHandle ServerInviteSession::getHandle ( )

Definition at line 37 of file ServerInviteSession.cxx.

◆ operator=() [1/2]

ServerInviteSession & resip::ServerInviteSession::operator= ( const ServerInviteSession &  )
delete

◆ operator=() [2/2]

ServerInviteSession & resip::ServerInviteSession::operator= ( ServerInviteSession &&  )
delete

◆ provideAnswer()

void ServerInviteSession::provideAnswer ( const Contents &  answer)
virtual

Similar to provideOffer - called to set the answer to be signaled to the peer.

May result in message being sent synchronously depending on the state.

Reimplemented from resip::InviteSession.

Definition at line 396 of file ServerInviteSession.cxx.

◆ provideOffer() [1/4]

void ServerInviteSession::provideOffer ( const Contents &  offer)
virtual

Called to set the offer that will be used in the next message that sends an offer.

If possible, this will synchronously send the appropriate request or response. In some cases, the UAS might have to call accept in order to cause the message to be sent. If sendOfferAtAccept is true, no UPDATE will be sent if media is negotiated reliable, it will be sent at accept

Reimplemented from resip::InviteSession.

Definition at line 369 of file ServerInviteSession.cxx.

◆ provideOffer() [2/4]

void ServerInviteSession::provideOffer ( const Contents &  offer,
bool  sendOfferAtAccept 
)
virtual

Definition at line 362 of file ServerInviteSession.cxx.

◆ provideOffer() [3/4]

void ServerInviteSession::provideOffer ( const Contents &  offer,
DialogUsageManager::EncryptionLevel  level,
const Contents *  alternative 
)
virtual

Reimplemented from resip::InviteSession.

Definition at line 354 of file ServerInviteSession.cxx.

◆ provideOffer() [4/4]

void ServerInviteSession::provideOffer ( const Contents &  offer,
DialogUsageManager::EncryptionLevel  level,
const Contents *  alternative,
bool  sendOfferAtAccept 
)
virtual

Definition at line 270 of file ServerInviteSession.cxx.

◆ provisional()

void ServerInviteSession::provisional ( int  code = 180,
bool  earlyFlag = true 
)

send a 1xx - provisional response.

If you set earlyFlag to true, and have provided an answer, then DUM will attach the answer to the provisional response, as an early media indication

Definition at line 140 of file ServerInviteSession.cxx.

◆ provisionalCommand()

void ServerInviteSession::provisionalCommand ( int  code = 180,
bool  earlyFlag = true 
)

Definition at line 264 of file ServerInviteSession.cxx.

◆ redirect()

void ServerInviteSession::redirect ( const NameAddrs &  contacts,
int  code = 302 
)

send a 3xx

Definition at line 43 of file ServerInviteSession.cxx.

◆ redirectCommand()

void ServerInviteSession::redirectCommand ( const NameAddrs &  contacts,
int  code = 302 
)

Provide asynchronous method access by using command.

Definition at line 134 of file ServerInviteSession.cxx.

◆ reject() [1/2]

void ServerInviteSession::reject ( int  statusCode,
const Contents *  contents,
WarningCategory *  warning = 0 
)
virtual

Reimplemented from resip::InviteSession.

Definition at line 607 of file ServerInviteSession.cxx.

◆ reject() [2/2]

void ServerInviteSession::reject ( int  statusCode,
WarningCategory *  warning = 0 
)
virtual

Rejects an offer at the SIP level.

So this can send a 488 to a reINVITE or UPDATE

Reimplemented from resip::InviteSession.

Definition at line 601 of file ServerInviteSession.cxx.

◆ requestOffer()

void ServerInviteSession::requestOffer ( )
virtual

Called to request that the far end provide an offer.

This will cause a reinvite with no body to be sent.

Reimplemented from resip::InviteSession.

Definition at line 375 of file ServerInviteSession.cxx.

Friends And Related Symbol Documentation

◆ Dialog

friend class Dialog
friend

Definition at line 76 of file ServerInviteSession.hxx.


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