|
reSIProcate/DialogUsageManager
9694
|
Base class for class ClientInviteSession and class ServerInviteSession. More...
#include <InviteSession.hxx>


Base class for class ClientInviteSession and class ServerInviteSession.
Implements common attributes and behavior (i.e.t post connected) of the two classes.
Definition at line 22 of file InviteSession.hxx.
typedef HashMap<Data, SharedPtr<SipMessage> > resip::InviteSession::AckMap [protected] |
Definition at line 405 of file InviteSession.hxx.
| NotSpecified | |
| UserHangup | |
| AppRejectedSdp | |
| IllegalNegotiation | |
| AckNotReceived | |
| SessionExpired | |
| StaleReInvite | |
| ENDREASON_MAX | |
| UserSpecified |
Definition at line 50 of file InviteSession.hxx.
{
NotSpecified=0,
UserHangup,
AppRejectedSdp,
IllegalNegotiation,
AckNotReceived,
SessionExpired,
StaleReInvite,
ENDREASON_MAX, // Maximum used by the global array in InviteSession.cxx
UserSpecified // User-specified reason - doesn't use the array in InviteSession.cxx
};
enum resip::InviteSession::Event [protected] |
Definition at line 235 of file InviteSession.hxx.
{
OnRedirect, // 3xx
OnGeneralFailure, // 481 or 408
OnInvite, // UAS
OnInviteOffer,// UAS
OnInviteReliableOffer, // UAS
OnInviteReliable, // UAS
OnCancel, // UAS
OnBye,
On200Bye,
On1xx, // UAC
On1xxEarly, // UAC
On1xxOffer, // UAC
On1xxAnswer, // UAC
On2xx,
On2xxOffer,
On2xxAnswer,
On422Invite,
On487Invite,
On491Invite,
OnInviteFailure,
OnAck,
OnAckAnswer,
On200Cancel, // UAC
OnCancelFailure, // UAC
OnUpdate,
OnUpdateOffer,
OnUpdateRejected,
On422Update,
On491Update,
On200Update,
OnPrack, // UAS
On200Prack, // UAC
Unknown
} Event;
enum resip::InviteSession::NitState [protected] |
Definition at line 272 of file InviteSession.hxx.
{
NitComplete,
NitProceeding
} NitState;
Definition at line 41 of file InviteSession.hxx.
{
None, // means no Offer or Answer (may have body)
Offer,
Answer
} OfferAnswerType;
enum resip::InviteSession::State [protected] |
Definition at line 173 of file InviteSession.hxx.
{
Undefined, // Not used
Connected,
SentUpdate, // Sent an UPDATE
SentUpdateGlare, // got a 491
SentReinvite, // Sent a reINVITE
SentReinviteGlare, // Got a 491
SentReinviteNoOffer, // Sent a reINVITE with no offer (requestOffer)
SentReinviteAnswered, // Sent a reINVITE no offer and received a 200-offer
SentReinviteNoOfferGlare, // Got a 491
ReceivedUpdate, // Received an UPDATE
ReceivedReinvite, // Received a reINVITE
ReceivedReinviteNoOffer, // Received a reINVITE with no offer
ReceivedReinviteSentOffer, // Sent a 200 to a reINVITE with no offer
Answered,
WaitingToOffer,
WaitingToRequestOffer,
WaitingToTerminate, // Waiting for 2xx response before sending BYE
WaitingToHangup, // Waiting for ACK before sending BYE
Terminated, // Ended. waiting to delete
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_ReceivedOfferReliable,
UAS_NoOfferReliable,
UAS_FirstSentOfferReliable,
UAS_FirstSentAnswerReliable,
UAS_NegotiatedReliable,
UAS_SentUpdate,
UAS_SentUpdateAccepted,
UAS_ReceivedUpdate,
UAS_ReceivedUpdateWaitingAnswer,
UAS_WaitingToTerminate,
UAS_WaitingToHangup
} State;
| InviteSession::InviteSession | ( | DialogUsageManager & | dum, |
| Dialog & | dialog | ||
| ) | [protected] |
Definition at line 63 of file InviteSession.cxx.
References DebugLog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, and None.
: DialogUsage(dum, dialog), mState(Undefined), mNitState(NitComplete), mServerNitState(NitComplete), mLastLocalSessionModification(new SipMessage), mLastRemoteSessionModification(new SipMessage), mInvite200(new SipMessage), mLastNitResponse(new SipMessage), mCurrentRetransmit200(0), mStaleReInviteTimerSeq(1), mSessionInterval(0), mMinSE(90), mSessionRefresher(false), mSessionTimerSeq(0), mSessionRefreshReInvite(false), mReferSub(true), mCurrentEncryptionLevel(DialogUsageManager::None), mProposedEncryptionLevel(DialogUsageManager::None), mEndReason(NotSpecified) { DebugLog ( << "^^^ InviteSession::InviteSession " << this); assert(mDum.mInviteSessionHandler); }
| InviteSession::~InviteSession | ( | ) | [protected, virtual] |
Definition at line 88 of file InviteSession.cxx.
References DebugLog, resip::DialogUsage::mDialog, resip::Dialog::mInviteSession, and mNITQueue.
| resip::InviteSession::InviteSession | ( | const InviteSession & | ) | [private] |
| void InviteSession::acceptNIT | ( | int | statusCode = 200, |
| const Contents * | contents = 0 |
||
| ) | [virtual] |
accepts an INFO or MESSAGE request with a 2xx and an optional contents
Definition at line 2181 of file InviteSession.cxx.
References resip::Helper::getResponseCodeReason(), h_StatusLine, mLastNitResponse, mServerNitState, NitComplete, NitProceeding, and resip::DialogUsage::send().
{
if (statusCode / 100 != 2)
{
throw UsageUseException("Must accept with a 2xx", __FILE__, __LINE__);
}
if (mServerNitState != NitProceeding )
{
throw UsageUseException("No transaction to accept", __FILE__, __LINE__);
}
mLastNitResponse->header(h_StatusLine).statusCode() = statusCode;
mLastNitResponse->setContents(contents);
Helper::getResponseCodeReason(statusCode, mLastNitResponse->header(h_StatusLine).reason());
send(mLastNitResponse);
mServerNitState = NitComplete;
}

| void InviteSession::acceptNITCommand | ( | int | statusCode = 200, |
| const Contents * | contents = 0 |
||
| ) | [virtual] |
Asynchronously accepts an INFO or MESSAGE request with a 2xx and an optional contents.
Definition at line 2227 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionAcceptNITCommand(*this, statusCode, contents));
}

| void InviteSession::acceptReferNoSub | ( | int | statusCode = 200 | ) | [virtual] |
Definition at line 3135 of file InviteSession.cxx.
References resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, mLastReferNoSubRequest, and resip::DialogUsage::send().
{
if (statusCode / 100 != 2)
{
throw UsageUseException("Must accept with a 2xx", __FILE__, __LINE__);
}
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, mLastReferNoSubRequest, statusCode);
response->header(h_ReferSub).value() = "false";
//response->header(h_Supporteds).push_back(Token(Symbols::NoReferSub));
send(response);
}

| void InviteSession::dialogDestroyed | ( | const SipMessage & | msg | ) | [protected, virtual] |
Implements resip::DialogUsage.
Definition at line 100 of file InviteSession.cxx.
Referenced by resip::Dialog::dispatch().
{
assert(0);
// !jf! Is this correct? Merged from main...
// !jf! what reason - guessed for now?
//mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::PeerEnded, msg);
//delete this;
}
| void InviteSession::dispatch | ( | const SipMessage & | msg | ) | [protected, virtual] |
Implements resip::BaseUsage.
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 1124 of file InviteSession.cxx.
References Answered, Connected, dispatchAnswered(), dispatchConnected(), dispatchGlare(), dispatchReceivedReinviteSentOffer(), dispatchReceivedUpdateOrReinvite(), dispatchReinviteNoOfferGlare(), dispatchSentReinvite(), dispatchSentReinviteAnswered(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), dispatchTerminated(), dispatchWaitingToHangup(), dispatchWaitingToOffer(), dispatchWaitingToRequestOffer(), dispatchWaitingToTerminate(), resip::SipMessage::getTransactionId(), h_StatusLine, resip::SipMessage::header(), resip::SipMessage::isResponse(), mAcks, resip::RequestLine::method(), mState, ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedReinviteSentOffer, ReceivedUpdate, resip::DialogUsage::send(), SentReinvite, SentReinviteAnswered, SentReinviteGlare, SentReinviteNoOffer, SentReinviteNoOfferGlare, SentUpdate, SentUpdateGlare, Terminated, Undefined, WaitingToHangup, WaitingToOffer, WaitingToRequestOffer, and WaitingToTerminate.
Referenced by resip::Dialog::dispatch().
{
// Look for 2xx retransmissions - resend ACK and filter out of state machine
if(msg.header(h_CSeq).method() == INVITE && msg.isResponse() && msg.header(h_StatusLine).statusCode() / 100 == 2)
{
AckMap::iterator i = mAcks.find(msg.getTransactionId());
if (i != mAcks.end())
{
send(i->second); // resend ACK
return;
}
}
// !jf! do we need to handle 3xx here or is it handled elsewhere?
switch (mState)
{
case Connected:
dispatchConnected(msg);
break;
case SentUpdate:
dispatchSentUpdate(msg);
break;
case SentReinvite:
dispatchSentReinvite(msg);
break;
case SentReinviteNoOffer:
dispatchSentReinviteNoOffer(msg);
break;
case SentReinviteAnswered:
dispatchSentReinviteAnswered(msg);
break;
case SentUpdateGlare:
case SentReinviteGlare:
// The behavior is the same except for timer which is handled in dispatch(Timer)
dispatchGlare(msg);
break;
case SentReinviteNoOfferGlare:
dispatchReinviteNoOfferGlare(msg);
break;
case ReceivedUpdate:
case ReceivedReinvite:
case ReceivedReinviteNoOffer:
dispatchReceivedUpdateOrReinvite(msg);
break;
case ReceivedReinviteSentOffer:
dispatchReceivedReinviteSentOffer(msg);
break;
case Answered:
dispatchAnswered(msg);
break;
case WaitingToOffer:
dispatchWaitingToOffer(msg);
break;
case WaitingToRequestOffer:
dispatchWaitingToRequestOffer(msg);
break;
case WaitingToTerminate:
dispatchWaitingToTerminate(msg);
break;
case WaitingToHangup:
dispatchWaitingToHangup(msg);
break;
case Terminated:
dispatchTerminated(msg);
break;
case Undefined:
default:
assert(0);
break;
}
}

| void InviteSession::dispatch | ( | const DumTimeout & | timer | ) | [protected, virtual] |
dcm! -- should this be onIllegalNegotiation?
Implements resip::BaseUsage.
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 1197 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimerMs(), resip::DumTimeout::CanDiscardAck, Connected, resip::SharedPtr< T >::get(), resip::BaseUsage::getBaseHandle(), getSessionHandle(), resip::DumTimeout::Glare, InfoLog, isTerminated(), resip::InviteSessionHandler::LocalBye, mAcks, resip::Dialog::makeRequest(), mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mInvite200, resip::DialogUsageManager::mInviteSessionHandler, mLastLocalSessionModification, mLastRemoteSessionModification, mProposedEncryptionLevel, mProposedLocalOfferAnswer, mSessionTimerSeq, mStaleReInviteTimerSeq, mState, None, resip::InviteSessionHandler::onAckNotReceived(), resip::InviteSessionHandler::onOfferRejected(), resip::InviteSessionHandler::onSessionExpired(), resip::InviteSessionHandler::onStaleReInviteTimeout(), resip::InviteSessionHandler::onTerminated(), provideProposedOffer(), ReceivedReinviteSentOffer, requestOffer(), resip::resipMin(), resip::DumTimeout::Retransmit200, resip::DialogUsage::send(), sendBye(), SentReinvite, SentReinviteGlare, SentReinviteNoOffer, SentReinviteNoOfferGlare, SentUpdate, SentUpdateGlare, resip::DumTimeout::seq(), resip::DumTimeout::SessionExpiration, resip::DumTimeout::SessionRefresh, sessionRefresh(), StaleReInvite, startStaleReInviteTimer(), resip::Timer::T2, Terminated, resip::DumTimeout::transactionId(), transition(), resip::DumTimeout::type(), UAS_WaitingToHangup, UAS_WaitingToOffer, UAS_WaitingToRequestOffer, resip::DumTimeout::WaitForAck, WaitingToHangup, WaitingToOffer, WaitingToRequestOffer, and WaitingToTerminate.
{
if (timeout.type() == DumTimeout::Retransmit200)
{
if (mCurrentRetransmit200)
{
InfoLog (<< "Retransmitting: " << endl << mInvite200->brief());
//DumHelper::setOutgoingEncryptionLevel(*mInvite200, mCurrentEncryptionLevel);
send(mInvite200);
mCurrentRetransmit200 *= 2;
mDum.addTimerMs(DumTimeout::Retransmit200, resipMin(Timer::T2, mCurrentRetransmit200), getBaseHandle(), timeout.seq());
}
}
else if (timeout.type() == DumTimeout::WaitForAck)
{
if(mCurrentRetransmit200) // If retransmit200 timer is active then ACK is not received yet
{
if (timeout.seq() == mLastRemoteSessionModification->header(h_CSeq).sequence())
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
// If we are waiting for an Ack and it times out, then end with a BYE
if(mState == UAS_WaitingToHangup ||
mState == WaitingToHangup)
{
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
}
else if(mState == ReceivedReinviteSentOffer)
{
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
mDum.mInviteSessionHandler->onOfferRejected(getSessionHandle(), 0);
}
else if(mState == WaitingToOffer ||
mState == UAS_WaitingToOffer)
{
assert(mProposedLocalOfferAnswer.get());
mDum.mInviteSessionHandler->onAckNotReceived(getSessionHandle());
if(!isTerminated())
{
provideProposedOffer();
}
}
else if(mState == WaitingToRequestOffer ||
mState == UAS_WaitingToRequestOffer)
{
mDum.mInviteSessionHandler->onAckNotReceived(getSessionHandle());
if(!isTerminated())
{
requestOffer();
}
}
else
{
// this is so the app can decided to ignore this. default implementation
// will call end next
mDum.mInviteSessionHandler->onAckNotReceived(getSessionHandle());
}
}
}
}
else if (timeout.type() == DumTimeout::CanDiscardAck)
{
AckMap::iterator i = mAcks.find(timeout.transactionId());
if (i != mAcks.end())
{
mAcks.erase(i);
}
}
else if (timeout.type() == DumTimeout::Glare)
{
if (mState == SentUpdateGlare)
{
transition(SentUpdate);
InfoLog (<< "Retransmitting the UPDATE (glare condition timer)");
mDialog.makeRequest(*mLastLocalSessionModification, UPDATE); // increments CSeq
send(mLastLocalSessionModification);
}
else if (mState == SentReinviteGlare)
{
transition(SentReinvite);
InfoLog (<< "Retransmitting the reINVITE (glare condition timer)");
mDialog.makeRequest(*mLastLocalSessionModification, INVITE); // increments CSeq
startStaleReInviteTimer();
send(mLastLocalSessionModification);
}
else if (mState == SentReinviteNoOfferGlare)
{
transition(SentReinviteNoOffer);
InfoLog (<< "Retransmitting the reINVITE-nooffer (glare condition timer)");
mDialog.makeRequest(*mLastLocalSessionModification, INVITE); // increments CSeq
startStaleReInviteTimer();
send(mLastLocalSessionModification);
}
}
else if (timeout.type() == DumTimeout::StaleReInvite)
{
if(timeout.seq() == mStaleReInviteTimerSeq)
{
if(mState == WaitingToTerminate)
{
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
}
else if(mState == SentReinvite ||
mState == SentReinviteNoOffer)
{
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
// this is so the app can decide to ignore this. default implementation
// will call end next - which will send a BYE
mDum.mInviteSessionHandler->onStaleReInviteTimeout(getSessionHandle());
}
}
}
else if (timeout.type() == DumTimeout::SessionExpiration)
{
if(timeout.seq() == mSessionTimerSeq)
{
// this is so the app can decide to ignore this. default implementation
// will call end next - which will send a BYE
mDum.mInviteSessionHandler->onSessionExpired(getSessionHandle());
}
}
else if (timeout.type() == DumTimeout::SessionRefresh)
{
if(timeout.seq() == mSessionTimerSeq)
{
// Note: If not connected then we must be issueing a reinvite/update or
// receiving one - in either case the session timer stuff will get
// reset/renegotiated - thus just ignore this referesh
if(mState == Connected)
{
sessionRefresh();
}
}
}
}

| void InviteSession::dispatchAnswered | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ClientInviteSession.
Definition at line 1861 of file InviteSession.cxx.
References Connected, dispatchOthers(), h_RequestLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), mCurrentRetransmit200, resip::RequestLine::method(), and transition().
Referenced by dispatch().
{
if (msg.isRequest() && msg.header(h_RequestLine).method() == ACK)
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
transition(Connected);
}
else
{
dispatchOthers(msg);
}
}

| void InviteSession::dispatchBye | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 2101 of file InviteSession.cxx.
References resip::Message::brief(), resip::DialogUsageManager::destroy(), resip::Helper::getResponseCodeReason(), getSessionHandle(), h_StatusLine, InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mLastNitResponse, mServerNitState, NitComplete, NitProceeding, resip::DialogEventStateManager::onTerminated(), resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::RemoteBye, resip::DialogUsage::send(), Terminated, transition(), and WarningLog.
Referenced by resip::ClientInviteSession::dispatchAnswered(), resip::ClientInviteSession::dispatchCancelled(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), dispatchOthers(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedUpdateOrReinvite(), resip::ClientInviteSession::dispatchSentAnswer(), resip::ClientInviteSession::dispatchStart(), and dispatchWaitingToTerminate().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
if (msg.isRequest())
{
// Check for any non-invite server transactions (e.g. INFO)
// that have not been responded yet and terminate them.
if (mServerNitState == NitProceeding)
{
mLastNitResponse->header(h_StatusLine).statusCode() = 487;
mLastNitResponse->setContents(0);
Helper::getResponseCodeReason(487, mLastNitResponse->header(h_StatusLine).reason());
send(mLastNitResponse);
mServerNitState = NitComplete;
}
SharedPtr<SipMessage> rsp(new SipMessage);
InfoLog (<< "Received " << msg.brief());
mDialog.makeResponse(*rsp, msg, 200);
send(rsp);
// !jf! should we make some other callback here
transition(Terminated);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onTerminated(mDialog, msg, InviteSessionHandler::RemoteBye);
}
handler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteBye, &msg);
mDum.destroy(this);
}
else
{
WarningLog (<< "DUM let me send a BYE at an incorrect state " << endl << msg);
assert(0);
}
}

| void InviteSession::dispatchCancel | ( | const SipMessage & | msg | ) | [private] |
Reimplemented in resip::ServerInviteSession.
Definition at line 2077 of file InviteSession.cxx.
References getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::RemoteCancel, resip::DialogUsage::send(), sendBye(), Terminated, transition(), and WarningLog.
Referenced by dispatchOthers().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
assert(msg.header(h_CSeq).method() == CANCEL);
if(msg.isRequest())
{
SharedPtr<SipMessage> rsp(new SipMessage);
mDialog.makeResponse(*rsp, msg, 200);
send(rsp);
sendBye();
// !jf! should we make some other callback here
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteCancel, &msg);
}
else
{
WarningLog (<< "DUM let me send a CANCEL at an incorrect state " << endl << msg);
assert(0);
}
}

| void InviteSession::dispatchConnected | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1347 of file InviteSession.cxx.
References dispatchOthers(), getEncryptionLevel(), getOfferAnswer(), getSessionHandle(), handleSessionTimerRequest(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mLastRemoteSessionModification, mProposedRemoteOfferAnswer, On200Update, On2xx, On2xxAnswer, On2xxOffer, OnAck, OnAckAnswer, resip::InviteSessionHandler::onAckReceived(), OnInvite, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, resip::InviteSessionHandler::onOffer(), resip::InviteSessionHandler::onOfferRequired(), OnUpdate, OnUpdateOffer, OnUpdateRejected, ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedUpdate, resip::DialogUsage::send(), sendAck(), toEvent(), transition(), and WarningLog.
Referenced by dispatch(), dispatchGlare(), and dispatchReinviteNoOfferGlare().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
*mLastRemoteSessionModification = msg;
transition(ReceivedReinviteNoOffer);
handler->onOfferRequired(getSessionHandle(), msg);
break;
case OnInviteOffer:
case OnInviteReliableOffer:
*mLastRemoteSessionModification = msg;
transition(ReceivedReinvite);
mCurrentEncryptionLevel = getEncryptionLevel(msg);
mProposedRemoteOfferAnswer = offerAnswer;
handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer);
break;
case On2xx:
case On2xxOffer:
case On2xxAnswer:
// retransmission of 200I
// !jf! Need to include the answer here.
sendAck();
break;
case OnUpdateOffer:
transition(ReceivedUpdate);
// !kh!
// Find out if it's an UPDATE requiring state change.
// See rfc3311 5.2, 4th paragraph.
*mLastRemoteSessionModification = msg;
mCurrentEncryptionLevel = getEncryptionLevel(msg);
mProposedRemoteOfferAnswer = offerAnswer;
handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer);
break;
case OnUpdate:
{
// ?slg? no offerAnswer in update - just respond immediately (likely session timer) - do we need a callback?
SharedPtr<SipMessage> response(new SipMessage);
*mLastRemoteSessionModification = msg;
mDialog.makeResponse(*response, *mLastRemoteSessionModification, 200);
handleSessionTimerRequest(*response, *mLastRemoteSessionModification);
send(response);
break;
}
case OnUpdateRejected:
case On200Update:
WarningLog (<< "DUM delivered an UPDATE response in an incorrect state " << endl << msg);
assert(0);
break;
case OnAck:
case OnAckAnswer: // .bwc. Don't drop ACK with SDP!
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
handler->onAckReceived(getSessionHandle(), msg);
break;
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchGlare | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1771 of file InviteSession.cxx.
References DebugLog, dispatchConnected(), dispatchOthers(), dispatchTerminated(), getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), isTerminated(), resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, and resip::InviteSessionHandler::onOfferRejected().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
MethodTypes method = msg.header(h_CSeq).method();
if (msg.isRequest() && (method == INVITE || method == UPDATE))
{
DebugLog(<< "Re-INVITE or UPDATE received when in SentReinviteGlare or SentUpdateGlare" << endl);
// Received inbound reinvite or update, when waiting to resend outbound reinvite or update
handler->onOfferRejected(getSessionHandle(), &msg);
if(!isTerminated()) // make sure application didn't call end()
{
dispatchConnected(msg); // act as if we received message in Connected state
}
else
{
dispatchTerminated(msg);
}
}
else
{
dispatchOthers(msg);
}
}

| void InviteSession::dispatchInfo | ( | const SipMessage & | msg | ) | [protected] |
dcm! -- toss away 1xx to an info?
Definition at line 2142 of file InviteSession.cxx.
References resip::Message::brief(), resip::Random::getRandom(), getSessionHandle(), h_StatusLine, resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mLastNitResponse, mNitState, mServerNitState, nitComplete(), NitProceeding, resip::InviteSessionHandler::onInfo(), resip::InviteSessionHandler::onInfoFailure(), resip::InviteSessionHandler::onInfoSuccess(), and resip::DialogUsage::send().
Referenced by resip::ClientInviteSession::dispatch(), resip::ServerInviteSession::dispatch(), and dispatchOthers().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
if (msg.isRequest())
{
if (mServerNitState == NitProceeding)
{
// Means that the UAC has sent us a second INFO before we
// responded to the first one.
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 500);
response->header(h_RetryAfter).value() = Random::getRandom() % 10;
send(response);
}
else
{
InfoLog (<< "Received " << msg.brief());
mServerNitState = NitProceeding;
mDialog.makeResponse(*mLastNitResponse, msg, 200);
handler->onInfo(getSessionHandle(), msg);
}
}
else
{
assert(mNitState == NitProceeding);
if (msg.header(h_StatusLine).statusCode() >= 300)
{
handler->onInfoFailure(getSessionHandle(), msg);
}
else if (msg.header(h_StatusLine).statusCode() >= 200)
{
handler->onInfoSuccess(getSessionHandle(), msg);
}
nitComplete();
}
}

| void InviteSession::dispatchMessage | ( | const SipMessage & | msg | ) | [protected] |
dcm! -- toss away 1xx to an message?
Definition at line 2282 of file InviteSession.cxx.
References resip::Message::brief(), resip::Random::getRandom(), getSessionHandle(), h_StatusLine, resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mLastNitResponse, mNitState, mServerNitState, nitComplete(), NitProceeding, resip::InviteSessionHandler::onMessage(), resip::InviteSessionHandler::onMessageFailure(), resip::InviteSessionHandler::onMessageSuccess(), and resip::DialogUsage::send().
Referenced by resip::ClientInviteSession::dispatch(), resip::ServerInviteSession::dispatch(), and dispatchOthers().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
if (msg.isRequest())
{
if (mServerNitState == NitProceeding)
{
// Means that the UAC has sent us a second NIT message before we
// responded to the first one.
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 500);
response->header(h_RetryAfter).value() = Random::getRandom() % 10;
send(response);
}
else
{
InfoLog (<< "Received " << msg.brief());
mServerNitState = NitProceeding;
mDialog.makeResponse(*mLastNitResponse, msg, 200);
mLastNitResponse->header(h_Contacts).clear();
handler->onMessage(getSessionHandle(), msg);
}
}
else
{
assert(mNitState == NitProceeding);
if (msg.header(h_StatusLine).statusCode() >= 300)
{
handler->onMessageFailure(getSessionHandle(), msg);
}
else if (msg.header(h_StatusLine).statusCode() >= 200)
{
handler->onMessageSuccess(getSessionHandle(), msg);
}
nitComplete();
}
}

| void InviteSession::dispatchOthers | ( | const SipMessage & | msg | ) | [private] |
Definition at line 2000 of file InviteSession.cxx.
References dispatchBye(), dispatchCancel(), dispatchInfo(), dispatchMessage(), dispatchPrack(), resip::SipMessage::header(), resip::RequestLine::method(), mState, toData(), resip::RequestLine::unknownMethodName(), and WarningLog.
Referenced by dispatchAnswered(), dispatchConnected(), dispatchGlare(), dispatchReceivedReinviteSentOffer(), dispatchReceivedUpdateOrReinvite(), dispatchReinviteNoOfferGlare(), dispatchSentReinvite(), dispatchSentReinviteAnswered(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), dispatchWaitingToOffer(), and dispatchWaitingToRequestOffer().
{
// handle OnGeneralFailure
// handle OnRedirect
switch (msg.header(h_CSeq).method())
{
case PRACK:
dispatchPrack(msg);
break;
case CANCEL:
dispatchCancel(msg);
break;
case BYE:
dispatchBye(msg);
break;
case INFO:
dispatchInfo(msg);
break;
case MESSAGE:
dispatchMessage(msg);
break;
case ACK:
// Ignore duplicate ACKs from 2xx reTransmissions
break;
default:
// handled in Dialog
WarningLog (<< "DUM delivered a "
<< msg.header(h_CSeq).unknownMethodName()
<< " to the InviteSession in state: " << toData(mState)
<< endl
<< msg);
assert(0);
break;
}
}

| void InviteSession::dispatchPrack | ( | const SipMessage & | msg | ) | [private] |
Definition at line 2056 of file InviteSession.cxx.
References resip::InviteSessionHandler::Error, getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::DialogUsage::send(), sendBye(), Terminated, and transition().
Referenced by dispatchOthers().
{
assert(msg.header(h_CSeq).method() == PRACK);
if(msg.isRequest())
{
SharedPtr<SipMessage> rsp(new SipMessage);
mDialog.makeResponse(*rsp, msg, 481);
send(rsp);
sendBye();
// !jf! should we make some other callback here
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
}
else
{
// ignore. could be PRACK/200
}
}

| void InviteSession::dispatchReceivedReinviteSentOffer | ( | const SipMessage & | msg | ) | [protected] |
dcm! -- should this be onIllegalNegotiation?
Definition at line 1720 of file InviteSession.cxx.
References Connected, dispatchOthers(), getEncryptionLevel(), getOfferAnswer(), getSessionHandle(), resip::SipMessage::header(), InfoLog, resip::Dialog::makeResponse(), mCurrentEncryptionLevel, mCurrentRemoteOfferAnswer, mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mLastRemoteSessionModification, mProposedEncryptionLevel, mProposedLocalOfferAnswer, None, OnAck, OnAckAnswer, resip::InviteSessionHandler::onAnswer(), OnInvite, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, resip::InviteSessionHandler::onOfferRejected(), OnUpdate, OnUpdateOffer, resip::DialogUsage::send(), setCurrentLocalOfferAnswer(), toEvent(), and transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
case OnInviteOffer:
case OnInviteReliableOffer:
case OnUpdate:
case OnUpdateOffer:
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 491);
send(response);
break;
}
case OnAckAnswer:
transition(Connected);
setCurrentLocalOfferAnswer(msg);
mCurrentRemoteOfferAnswer = offerAnswer;
mCurrentEncryptionLevel = getEncryptionLevel(msg);
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer);
break;
case OnAck:
if (mLastRemoteSessionModification->header(h_CSeq).sequence() > msg.header(h_CSeq).sequence())
{
InfoLog(<< "dropped stale ACK");
}
else
{
InfoLog(<< "Got Ack with no answer");
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
handler->onOfferRejected(getSessionHandle(), &msg);
}
break;
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchReceivedUpdateOrReinvite | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1820 of file InviteSession.cxx.
References dispatchBye(), dispatchOthers(), getOfferAnswer(), resip::Random::getRandom(), handleSessionTimerRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, mLastRemoteSessionModification, OnBye, OnInvite, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, OnUpdate, OnUpdateOffer, resip::DialogUsage::send(), and toEvent().
Referenced by dispatch().
{
// InviteSessionHandler* handler = mDum.mInviteSessionHandler; // unused
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
case OnInviteOffer:
case OnInviteReliableOffer:
case OnUpdate:
case OnUpdateOffer:
{
// Means that the UAC has sent us a second reINVITE or UPDATE before we
// responded to the first one. Bastard!
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 500);
response->header(h_RetryAfter).value() = Random::getRandom() % 10;
send(response);
break;
}
case OnBye:
{
// BYE received after a reINVITE, terminate the reINVITE transaction.
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, *mLastRemoteSessionModification, 487); // Request Terminated
handleSessionTimerRequest(*response, *mLastRemoteSessionModification);
send(response);
dispatchBye(msg);
break;
}
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchReinviteNoOfferGlare | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1796 of file InviteSession.cxx.
References dispatchConnected(), dispatchOthers(), dispatchTerminated(), getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), isTerminated(), resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, and resip::InviteSessionHandler::onOfferRequestRejected().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
MethodTypes method = msg.header(h_CSeq).method();
if (msg.isRequest() && (method == INVITE || method == UPDATE))
{
// Received inbound reinvite or update, when waiting to resend outbound reinvite or update
handler->onOfferRequestRejected(getSessionHandle(), msg);
if(!isTerminated()) // make sure application didn't call end()
{
dispatchConnected(msg); // act as if we received message in Connected state
}
else
{
dispatchTerminated(msg);
}
}
else
{
dispatchOthers(msg);
}
}

| void InviteSession::dispatchSentReinvite | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1504 of file InviteSession.cxx.
References Connected, dispatchOthers(), resip::InviteSessionHandler::Error, resip::SipMessage::exists(), getEncryptionLevel(), resip::MD5Stream::getHex(), getOfferAnswer(), getSessionHandle(), handleSessionTimerResponse(), resip::SipMessage::header(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, mCurrentRemoteOfferAnswer, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mMinSE, mProposedEncryptionLevel, mProposedLocalOfferAnswer, mSessionInterval, mSessionRefreshReInvite, mStaleReInviteTimerSeq, None, On1xx, On1xxEarly, On2xx, On2xxAnswer, On2xxOffer, On422Invite, On487Invite, On491Invite, resip::InviteSessionHandler::onAnswer(), OnGeneralFailure, resip::InviteSessionHandler::onIllegalNegotiation(), OnInvite, OnInviteFailure, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, resip::InviteSessionHandler::onOfferRejected(), resip::InviteSessionHandler::onRemoteAnswerChanged(), resip::InviteSessionHandler::onTerminated(), OnUpdate, OnUpdateOffer, resip::DialogUsage::send(), sendAck(), sendBye(), SentReinviteGlare, sessionRefresh(), setCurrentLocalOfferAnswer(), start491Timer(), Terminated, toEvent(), and transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
case OnInviteOffer:
case OnInviteReliableOffer:
case OnUpdate:
case OnUpdateOffer:
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 491);
send(response);
break;
}
case On1xx:
case On1xxEarly:
// Some UA's send a 100 response to a ReInvite - just ignore it
break;
case On2xxAnswer:
case On2xxOffer: // .slg. doesn't really make sense
{
mStaleReInviteTimerSeq++;
transition(Connected);
handleSessionTimerResponse(msg);
setCurrentLocalOfferAnswer(msg);
// !jf! I need to potentially include an answer in the ACK here
sendAck();
mCurrentEncryptionLevel = getEncryptionLevel(msg);
if (mSessionRefreshReInvite)
{
mSessionRefreshReInvite = false;
MD5Stream currentRemote;
currentRemote<< *mCurrentRemoteOfferAnswer;
MD5Stream newRemote;
newRemote << *offerAnswer;
bool changed = currentRemote.getHex() != newRemote.getHex();
if (changed)
{
mCurrentRemoteOfferAnswer = offerAnswer;
handler->onRemoteAnswerChanged(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer);
}
}
else
{
mCurrentRemoteOfferAnswer = offerAnswer;
handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer);
}
// !jf! do I need to allow a reINVITE overlapping the retransmission of
// the ACK when a 200I is received? If yes, then I need to store all
// ACK messages for 64*T1
break;
}
case On2xx:
mStaleReInviteTimerSeq++;
sendAck();
transition(Connected);
handleSessionTimerResponse(msg);
handler->onIllegalNegotiation(getSessionHandle(), msg);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
break;
case On422Invite:
mStaleReInviteTimerSeq++;
if(msg.exists(h_MinSE))
{
// Change interval to min from 422 response
mSessionInterval = msg.header(h_MinSE).value();
mMinSE = mSessionInterval;
sessionRefresh();
}
else
{
// Response must contact Min_SE - if not - just ignore
// ?slg? callback?
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
}
break;
case On491Invite:
mStaleReInviteTimerSeq++;
transition(SentReinviteGlare);
start491Timer();
break;
case OnGeneralFailure:
mStaleReInviteTimerSeq++;
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
case OnInviteFailure:
case On487Invite:
mStaleReInviteTimerSeq++;
transition(Connected);
mProposedLocalOfferAnswer.reset();
handler->onOfferRejected(getSessionHandle(), &msg);
break;
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchSentReinviteAnswered | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1875 of file InviteSession.cxx.
References dispatchOthers(), h_StatusLine, resip::SipMessage::header(), resip::SipMessage::isResponse(), and resip::RequestLine::method().
Referenced by dispatch().
{
if (msg.isResponse() &&
msg.header(h_CSeq).method() == INVITE &&
msg.header(h_StatusLine).statusCode() / 200 == 1)
{
// Receving a 200 retransmission is possible - but we don't have an ACK response yet - we are still waiting for provideAnswer to be
// called by the app - so just drop the retransmission
return;
}
dispatchOthers(msg);
}

| void InviteSession::dispatchSentReinviteNoOffer | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1625 of file InviteSession.cxx.
References Connected, dispatchOthers(), resip::InviteSessionHandler::Error, resip::SipMessage::exists(), getEncryptionLevel(), getOfferAnswer(), getSessionHandle(), handleSessionTimerResponse(), resip::SipMessage::header(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mMinSE, mProposedEncryptionLevel, mProposedLocalOfferAnswer, mProposedRemoteOfferAnswer, mSessionInterval, mStaleReInviteTimerSeq, None, On1xx, On1xxEarly, On2xx, On2xxAnswer, On2xxOffer, On422Invite, On487Invite, On491Invite, OnGeneralFailure, resip::InviteSessionHandler::onIllegalNegotiation(), OnInvite, OnInviteFailure, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, resip::InviteSessionHandler::onOffer(), resip::InviteSessionHandler::onOfferRejected(), resip::InviteSessionHandler::onTerminated(), OnUpdate, OnUpdateOffer, resip::DialogUsage::send(), sendAck(), sendBye(), SentReinviteAnswered, SentReinviteNoOfferGlare, sessionRefresh(), start491Timer(), Terminated, toEvent(), and transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
case OnInviteOffer:
case OnInviteReliableOffer:
case OnUpdate:
case OnUpdateOffer:
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 491);
send(response);
break;
}
case On1xx:
case On1xxEarly:
// Some UA's send a 100 response to a ReInvite - just ignore it
break;
case On2xxAnswer: // .slg. doesn't really make sense
case On2xxOffer:
{
mStaleReInviteTimerSeq++;
transition(SentReinviteAnswered);
handleSessionTimerResponse(msg);
// mLastSessionModification = msg; // ?slg? why are we storing 200's?
mCurrentEncryptionLevel = getEncryptionLevel(msg);
mProposedRemoteOfferAnswer = offerAnswer;
handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer);
break;
}
case On2xx:
mStaleReInviteTimerSeq++;
sendAck();
transition(Connected);
handleSessionTimerResponse(msg);
handler->onIllegalNegotiation(getSessionHandle(), msg);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
break;
case On422Invite:
mStaleReInviteTimerSeq++;
if(msg.exists(h_MinSE))
{
// Change interval to min from 422 response
mSessionInterval = msg.header(h_MinSE).value();
mMinSE = mSessionInterval;
sessionRefresh();
}
else
{
// Response must contact Min_SE - if not - just ignore
// ?slg? callback?
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
}
break;
case On491Invite:
mStaleReInviteTimerSeq++;
transition(SentReinviteNoOfferGlare);
start491Timer();
break;
case OnGeneralFailure:
mStaleReInviteTimerSeq++;
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
case OnInviteFailure:
case On487Invite:
mStaleReInviteTimerSeq++;
transition(Connected);
mProposedLocalOfferAnswer.reset();
handler->onOfferRejected(getSessionHandle(), &msg);
break;
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchSentUpdate | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 1421 of file InviteSession.cxx.
References Connected, dispatchOthers(), resip::InviteSessionHandler::Error, resip::SipMessage::exists(), getEncryptionLevel(), getOfferAnswer(), getSessionHandle(), handleSessionTimerResponse(), resip::SipMessage::header(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, mCurrentRemoteOfferAnswer, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, mMinSE, mProposedEncryptionLevel, mProposedLocalOfferAnswer, mSessionInterval, None, On200Update, On422Update, On491Update, resip::InviteSessionHandler::onAnswer(), OnGeneralFailure, resip::InviteSessionHandler::onIllegalNegotiation(), OnInvite, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, resip::InviteSessionHandler::onOfferRejected(), resip::InviteSessionHandler::onTerminated(), OnUpdate, OnUpdateOffer, OnUpdateRejected, resip::DialogUsage::send(), sendBye(), SentUpdateGlare, sessionRefresh(), setCurrentLocalOfferAnswer(), start491Timer(), Terminated, toEvent(), and transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnInvite:
case OnInviteReliable:
case OnInviteOffer:
case OnInviteReliableOffer:
case OnUpdate:
case OnUpdateOffer:
{
// glare
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 491);
send(response);
break;
}
case On200Update:
transition(Connected);
handleSessionTimerResponse(msg);
if (offerAnswer.get() && mProposedLocalOfferAnswer.get())
{
mCurrentEncryptionLevel = getEncryptionLevel(msg);
setCurrentLocalOfferAnswer(msg);
mCurrentRemoteOfferAnswer = offerAnswer;
handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer);
}
else if(mProposedLocalOfferAnswer.get())
{
// If we sent an offer in the Update Request and no answer is received
handler->onIllegalNegotiation(getSessionHandle(), msg);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
}
break;
case On491Update:
transition(SentUpdateGlare);
start491Timer();
break;
case On422Update: // session timer
if(msg.exists(h_MinSE))
{
// Change interval to min from 422 response
mSessionInterval = msg.header(h_MinSE).value();
mMinSE = mSessionInterval;
sessionRefresh();
}
else
{
// Response must contain Min_SE - if not - just ignore
// ?slg? callback?
transition(Connected);
mProposedLocalOfferAnswer.reset();
mProposedEncryptionLevel = DialogUsageManager::None;
}
break;
case OnUpdateRejected:
transition(Connected);
mProposedLocalOfferAnswer.reset();
handler->onOfferRejected(getSessionHandle(), &msg);
break;
case OnGeneralFailure:
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
default:
dispatchOthers(msg);
break;
}
}

| void InviteSession::dispatchTerminated | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 1971 of file InviteSession.cxx.
References resip::Message::brief(), resip::DialogUsageManager::destroy(), resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::RequestLine::method(), and resip::DialogUsage::send().
Referenced by dispatch(), dispatchGlare(), and dispatchReinviteNoOfferGlare().
{
InfoLog (<< "InviteSession::dispatchTerminated " << msg.brief());
if (msg.isRequest())
{
if (BYE == msg.header(h_CSeq).method())
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 200);
send(response);
}
else
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 481);
send(response);
}
// !jf! means the peer sent BYE while we are waiting for response to BYE
//mDum.destroy(this);
}
else
{
mDum.destroy(this);
}
}

| void InviteSession::dispatchUnhandledInvite | ( | const SipMessage & | msg | ) | [private] |
Definition at line 2038 of file InviteSession.cxx.
References resip::InviteSessionHandler::Error, getSessionHandle(), resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::DialogUsage::send(), sendBye(), Terminated, and transition().
{
assert(msg.isRequest());
assert(msg.header(h_CSeq).method() == INVITE);
// If we get an INVITE request from the wire and we are not in
// Connected state, reject the request and send a BYE
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 400); // !jf! what code to use?
InfoLog (<< "Sending " << response->brief());
send(response);
sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
}

| void InviteSession::dispatchWaitingToHangup | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 1948 of file InviteSession.cxx.
References resip::SharedPtr< T >::get(), getOfferAnswer(), getSessionHandle(), resip::InviteSessionHandler::LocalBye, mCurrentRetransmit200, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, OnAck, OnAckAnswer, resip::InviteSessionHandler::onTerminated(), sendBye(), Terminated, toEvent(), and transition().
Referenced by dispatch().
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnAck:
case OnAckAnswer:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
break;
}
default:
break;
}
}

| void InviteSession::dispatchWaitingToOffer | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 1889 of file InviteSession.cxx.
References dispatchOthers(), h_RequestLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), mCurrentRetransmit200, resip::RequestLine::method(), mProposedLocalOfferAnswer, and provideProposedOffer().
Referenced by dispatch().
{
if (msg.isRequest() && msg.header(h_RequestLine).method() == ACK)
{
assert(mProposedLocalOfferAnswer.get());
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
provideProposedOffer();
}
else
{
dispatchOthers(msg);
}
}

| void InviteSession::dispatchWaitingToRequestOffer | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 1904 of file InviteSession.cxx.
References dispatchOthers(), h_RequestLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), mCurrentRetransmit200, resip::RequestLine::method(), and requestOffer().
Referenced by dispatch().
{
if (msg.isRequest() && msg.header(h_RequestLine).method() == ACK)
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
requestOffer();
}
else
{
dispatchOthers(msg);
}
}

| void InviteSession::dispatchWaitingToTerminate | ( | const SipMessage & | msg | ) | [protected] |
Reimplemented in resip::ServerInviteSession.
Definition at line 1918 of file InviteSession.cxx.
References dispatchBye(), resip::SharedPtr< T >::get(), getSessionHandle(), h_StatusLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::SipMessage::isResponse(), resip::InviteSessionHandler::LocalBye, resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::SipMessage::method(), resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::DialogUsage::send(), sendAck(), sendBye(), Terminated, and transition().
Referenced by dispatch().
{
if (msg.isResponse() &&
msg.header(h_CSeq).method() == INVITE)
{
if(msg.header(h_StatusLine).statusCode() / 200 == 1) // Note: stack ACK's non-2xx final responses only
{
// !jf! Need to include the answer here.
sendAck();
}
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
}
else if(msg.isRequest())
{
if(msg.method() == BYE)
{
dispatchBye(msg);
}
else
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, msg, 400 /* Bad Request */);
send(response);
}
}
}

| EncodeStream & InviteSession::dump | ( | EncodeStream & | strm | ) | const [virtual] |
Implements resip::BaseUsage.
Definition at line 373 of file InviteSession.cxx.
References resip::Handled::mId, mState, resip::DialogUsage::myAddr(), resip::DialogUsage::peerAddr(), and toData().
{
strm << "INVITE: " << mId
<< " " << toData(mState)
<< " ADDR=" << myAddr()
<< " PEER=" << peerAddr();
return strm;
}

| void InviteSession::end | ( | const Data & | userReason | ) | [virtual] |
Makes the specific dialog end.
Will send a BYE (not a CANCEL)
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 622 of file InviteSession.cxx.
References end(), mUserEndReason, and UserSpecified.
Referenced by resip::Dialog::end().
{
mUserEndReason = userReason;
end(UserSpecified);
}

| void InviteSession::end | ( | EndReason | reason | ) | [virtual] |
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 629 of file InviteSession.cxx.
References Answered, Connected, resip::SharedPtr< T >::get(), getSessionHandle(), InfoLog, resip::InviteSessionHandler::LocalBye, resip::Dialog::makeResponse(), mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mEndReason, resip::DialogUsageManager::mInviteSessionHandler, mLastRemoteSessionModification, mState, NotSpecified, resip::InviteSessionHandler::onTerminated(), ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedReinviteSentOffer, ReceivedUpdate, resip::DialogUsage::send(), sendBye(), SentReinvite, SentReinviteAnswered, SentReinviteGlare, SentReinviteNoOffer, SentReinviteNoOfferGlare, SentUpdate, SentUpdateGlare, Terminated, transition(), WaitingToHangup, WaitingToOffer, WaitingToRequestOffer, and WaitingToTerminate.
{
if (mEndReason == NotSpecified)
{
mEndReason = reason;
}
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
switch (mState)
{
case Connected:
case SentUpdate:
case SentUpdateGlare:
case SentReinviteGlare:
case SentReinviteNoOfferGlare:
case SentReinviteAnswered:
{
// !jf! do we need to store the BYE somewhere?
// .dw. BYE message handled
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
break;
}
case SentReinvite:
case SentReinviteNoOffer:
transition(WaitingToTerminate);
break;
case Answered:
case WaitingToOffer:
case WaitingToRequestOffer:
case ReceivedReinviteSentOffer:
if(mCurrentRetransmit200) // If retransmit200 timer is active then ACK is not received yet - wait for it
{
transition(WaitingToHangup);
}
else
{
// ACK has likely timedout - hangup immediately
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
}
break;
case ReceivedUpdate:
case ReceivedReinvite:
case ReceivedReinviteNoOffer:
{
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, *mLastRemoteSessionModification, 488);
InfoLog (<< "Sending " << response->brief());
send(response);
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
break;
}
case WaitingToTerminate: // ?slg? Why is this here?
{
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
break;
}
case Terminated:
// no-op.
break;
default:
assert(0);
break;
}
}

| void InviteSession::end | ( | ) | [virtual] |
Implements resip::BaseUsage.
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 616 of file InviteSession.cxx.
References NotSpecified.
Referenced by end().
{
end(NotSpecified);
}
| void InviteSession::endCommand | ( | EndReason | reason = NotSpecified | ) | [virtual] |
Asynchronously makes the specific dialog end.
Will send a BYE (not a CANCEL)
Definition at line 734 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionEndCommand(*this, reason));
}

| void InviteSession::flowTerminated | ( | ) | [protected, virtual] |
Definition at line 3120 of file InviteSession.cxx.
References getSessionHandle(), resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, and resip::InviteSessionHandler::onFlowTerminated().
Referenced by resip::Dialog::flowTerminated().
{
// notify handler
mDum.mInviteSessionHandler->onFlowTerminated(getSessionHandle());
}

| DialogUsageManager::EncryptionLevel InviteSession::getEncryptionLevel | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 3075 of file InviteSession.cxx.
References resip::DialogUsageManager::Encrypt, resip::SipMessage::getSecurityAttributes(), resip::SecurityAttributes::getSignatureStatus(), resip::SecurityAttributes::isEncrypted(), None, resip::DialogUsageManager::Sign, resip::DialogUsageManager::SignAndEncrypt, SignatureCATrusted, SignatureSelfSigned, and SignatureTrusted.
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), resip::ClientInviteSession::handleAnswer(), resip::ClientInviteSession::handleOffer(), and setCurrentLocalOfferAnswer().
{
DialogUsageManager::EncryptionLevel level = DialogUsageManager::None;
const SecurityAttributes* secAttr = msg.getSecurityAttributes();
if (secAttr)
{
SignatureStatus sig = secAttr->getSignatureStatus();
bool sign = (SignatureTrusted == sig || SignatureCATrusted == sig || SignatureSelfSigned == sig);
bool encrypted = secAttr->isEncrypted();
if (encrypted && sign ) level = DialogUsageManager::SignAndEncrypt;
else if (encrypted) level = DialogUsageManager::Encrypt;
else if (sign) level = DialogUsageManager::Sign;
}
return level;
}

| const Data & InviteSession::getEndReasonString | ( | InviteSession::EndReason | reason | ) | [protected] |
dcm! -- necessary?
Definition at line 50 of file InviteSession.cxx.
References ENDREASON_MAX, EndReasons, NotSpecified, and UserSpecified.
Referenced by sendBye().
{
if(reason != InviteSession::UserSpecified)
{
assert(reason >= InviteSession::NotSpecified && reason < InviteSession::ENDREASON_MAX);
return EndReasons[reason];
}
else
{
return mUserEndReason;
}
}
| const SharedPtr< SipMessage > InviteSession::getLastSentNITRequest | ( | ) | const |
gets the last NIT request that was sent by the session
Definition at line 865 of file InviteSession.cxx.
References mLastSentNITRequest.
{
return mLastSentNITRequest;
}
| const Contents & InviteSession::getLocalOfferAnswer | ( | ) | const |
Definition at line 117 of file InviteSession.cxx.
References resip::SdpContents::Empty, and mCurrentLocalOfferAnswer.
{
if(mCurrentLocalOfferAnswer.get())
{
return *mCurrentLocalOfferAnswer;
}
else
{
return SdpContents::Empty;
}
}
| const SdpContents & InviteSession::getLocalSdp | ( | ) | const |
Definition at line 175 of file InviteSession.cxx.
References resip::SdpContents::Empty, resip::InviteSessionHandler::isGenericOfferAnswer(), mCurrentLocalOfferAnswer, resip::BaseUsage::mDum, and resip::DialogUsageManager::mInviteSessionHandler.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
if(mCurrentLocalOfferAnswer.get())
{
const SdpContents* sdp = dynamic_cast<const SdpContents*>(mCurrentLocalOfferAnswer.get());
assert(sdp);
return *sdp;
}
else
{
return SdpContents::Empty;
}
}

| std::auto_ptr< Contents > InviteSession::getOfferAnswer | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 2730 of file InviteSession.cxx.
References resip::Contents::clone(), resip::SipMessage::getContents(), resip::Helper::getSdp(), resip::InviteSessionHandler::isGenericOfferAnswer(), resip::BaseUsage::mDum, and resip::DialogUsageManager::mInviteSessionHandler.
Referenced by resip::ServerInviteSession::dispatchAccepted(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchAnswered(), resip::ClientInviteSession::dispatchCancelled(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), resip::ServerInviteSession::dispatchOfferOrEarly(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), dispatchReceivedUpdateOrReinvite(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchSentUpdateEarlyGlare(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), and resip::ServerInviteSession::dispatchWaitingToRequestOffer().
{
if(mDum.mInviteSessionHandler->isGenericOfferAnswer())
{
if(msg.getContents())
{
return std::auto_ptr<Contents>(msg.getContents()->clone());
}
else
{
return std::auto_ptr<Contents>();
}
}
else
{
return std::auto_ptr<Contents>(Helper::getSdp(msg.getContents()));
}
}

| Tokens& resip::InviteSession::getPeerAllowedEvents | ( | ) | [inline] |
Definition at line 164 of file InviteSession.hxx.
References mPeerAllowedEvents.
{ return mPeerAllowedEvents; }
| NameAddrs& resip::InviteSession::getPeerPAssertedIdentities | ( | ) | [inline] |
Definition at line 166 of file InviteSession.hxx.
References mPeerPAssertedIdentities.
{ return mPeerPAssertedIdentities; }
| Tokens& resip::InviteSession::getPeerSupportedEncodings | ( | ) | [inline] |
Definition at line 162 of file InviteSession.hxx.
References mPeerSupportedEncodings.
{ return mPeerSupportedEncodings; }
| Tokens& resip::InviteSession::getPeerSupportedLanguages | ( | ) | [inline] |
Definition at line 163 of file InviteSession.hxx.
References mPeerSupportedLanguages.
{ return mPeerSupportedLanguages; }
| Tokens& resip::InviteSession::getPeerSupportedMethods | ( | ) | [inline] |
Definition at line 159 of file InviteSession.hxx.
References mPeerSupportedMethods.
{ return mPeerSupportedMethods; }
| Mimes& resip::InviteSession::getPeerSupportedMimeTypes | ( | ) | [inline] |
Definition at line 161 of file InviteSession.hxx.
References mPeerSupportedMimeTypes.
{ return mPeerSupportedMimeTypes; }
| Tokens& resip::InviteSession::getPeerSupportedOptionTags | ( | ) | [inline] |
Definition at line 160 of file InviteSession.hxx.
References mPeerSupportedOptionTags.
{ return mPeerSupportedOptionTags; }
| Data& resip::InviteSession::getPeerUserAgent | ( | ) | [inline] |
Definition at line 165 of file InviteSession.hxx.
References mPeerUserAgent.
{ return mPeerUserAgent; }
| const Contents & InviteSession::getProposedRemoteOfferAnswer | ( | ) | const |
Definition at line 155 of file InviteSession.cxx.
References resip::SdpContents::Empty, and mProposedRemoteOfferAnswer.
{
if(mProposedRemoteOfferAnswer.get())
{
return *mProposedRemoteOfferAnswer;
}
else
{
return SdpContents::Empty;
}
}
| const SdpContents & InviteSession::getProposedRemoteSdp | ( | ) | const |
Definition at line 221 of file InviteSession.cxx.
References resip::SdpContents::Empty, resip::InviteSessionHandler::isGenericOfferAnswer(), resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, and mProposedRemoteOfferAnswer.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
if(mProposedRemoteOfferAnswer.get())
{
const SdpContents* sdp = dynamic_cast<const SdpContents*>(mProposedRemoteOfferAnswer.get());
assert(sdp);
return *sdp;
}
else
{
return SdpContents::Empty;
}
}

| const Contents & InviteSession::getRemoteOfferAnswer | ( | ) | const |
Definition at line 136 of file InviteSession.cxx.
References resip::SdpContents::Empty, and mCurrentRemoteOfferAnswer.
{
if(mCurrentRemoteOfferAnswer.get())
{
return *mCurrentRemoteOfferAnswer;
}
else
{
return SdpContents::Empty;
}
}
| const SdpContents & InviteSession::getRemoteSdp | ( | ) | const |
Definition at line 198 of file InviteSession.cxx.
References resip::SdpContents::Empty, resip::InviteSessionHandler::isGenericOfferAnswer(), mCurrentRemoteOfferAnswer, resip::BaseUsage::mDum, and resip::DialogUsageManager::mInviteSessionHandler.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
if(mCurrentRemoteOfferAnswer.get())
{
const SdpContents* sdp = dynamic_cast<const SdpContents*>(mCurrentRemoteOfferAnswer.get());
assert(sdp);
return *sdp;
}
else
{
return SdpContents::Empty;
}
}

| InviteSessionHandle InviteSession::getSessionHandle | ( | ) |
Definition at line 237 of file InviteSession.cxx.
References resip::BaseUsage::getBaseHandle(), and resip::BaseUsage::mDum.
Referenced by resip::ServerInviteSession::accept(), resip::ClientInviteSession::dispatch(), resip::Dialog::dispatch(), dispatch(), resip::ServerInviteSession::dispatchAccepted(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchAnswered(), resip::ServerInviteSession::dispatchBye(), dispatchBye(), resip::ServerInviteSession::dispatchCancel(), dispatchCancel(), resip::ClientInviteSession::dispatchCancelled(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), dispatchGlare(), dispatchInfo(), dispatchMessage(), dispatchPrack(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), dispatchReinviteNoOfferGlare(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchSentUpdateEarlyGlare(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), dispatchUnhandledInvite(), resip::ServerInviteSession::dispatchUnknown(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), resip::ServerInviteSession::dispatchWaitingToRequestOffer(), dispatchWaitingToTerminate(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), end(), resip::DialogUsageManager::findInviteSession(), flowTerminated(), resip::Dialog::getInviteSession(), resip::ClientInviteSession::handleAnswer(), resip::ClientInviteSession::handleOffer(), resip::ClientInviteSession::onConnectedAspect(), resip::ClientInviteSession::onProvisionalAspect(), onReadyToSend(), resip::ServerInviteSession::provideAnswer(), resip::ServerInviteSession::redirect(), referNoSub(), resip::ClientInviteSession::reject(), resip::ServerInviteSession::reject(), resip::ServerInviteSession::sendAccept(), and resip::ServerInviteSession::sendProvisional().
{
return InviteSessionHandle(mDum, getBaseHandle().getId());
}

| void InviteSession::handleSessionTimerRequest | ( | SipMessage & | response, |
| const SipMessage & | request | ||
| ) | [protected] |
Definition at line 2520 of file InviteSession.cxx.
References resip::SipMessage::exists(), resip::DialogUsageManager::getMasterProfile(), h_PAssertedIdentities, resip::SipMessage::header(), resip::BaseUsage::mDum, resip::RequestLine::method(), mMinSE, mPeerPAssertedIdentities, mSessionInterval, mSessionRefresher, resip::resipMax(), setSessionTimerHeaders(), setSessionTimerPreferences(), startSessionTimer(), and resip::Symbols::Timer.
Referenced by resip::ServerInviteSession::accept(), dispatchConnected(), dispatchReceivedUpdateOrReinvite(), provideAnswer(), provideOffer(), and resip::ServerInviteSession::sendAccept().
{
assert(request.header(h_CSeq).method() == INVITE || request.header(h_CSeq).method() == UPDATE);
// Allow Re-Invites and Updates to update the Peer P-Asserted-Identity
if (request.exists(h_PAssertedIdentities))
{
mPeerPAssertedIdentities = request.header(h_PAssertedIdentities);
}
// If session timers are locally supported then add necessary headers to response
if(mDum.getMasterProfile()->getSupportedOptionTags().find(Token(Symbols::Timer)))
{
setSessionTimerPreferences();
// Check if far-end supports
bool farEndSupportsTimer = false;
if(request.exists(h_Supporteds) && request.header(h_Supporteds).find(Token(Symbols::Timer)))
{
farEndSupportsTimer = true;
if(request.exists(h_SessionExpires))
{
// Use Session Interval requested by remote - if none then use local settings
mSessionInterval = request.header(h_SessionExpires).value();
if(request.header(h_SessionExpires).exists(p_refresher))
{
mSessionRefresher = (request.header(h_SessionExpires).param(p_refresher) == Data("uas"));
}
}
// Update MinSE if specified and longer than current value
if(request.exists(h_MinSE))
{
mMinSE = resipMax(mMinSE, request.header(h_MinSE).value());
}
}
else
{
// If far end doesn't support then refresher must be local
mSessionRefresher = true;
}
// Add Session-Expires to response if required
if(mSessionInterval >= 90)
{
if(farEndSupportsTimer)
{
// If far end supports session-timer then require it, if not already present
if(!response.header(h_Requires).find(Token(Symbols::Timer)))
{
response.header(h_Requires).push_back(Token(Symbols::Timer));
}
}
setSessionTimerHeaders(response);
}
startSessionTimer();
}
}

| void InviteSession::handleSessionTimerResponse | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 2470 of file InviteSession.cxx.
References resip::SipMessage::exists(), resip::DialogUsageManager::getMasterProfile(), h_PAssertedIdentities, resip::SipMessage::header(), resip::BaseUsage::mDum, resip::RequestLine::method(), mMinSE, mPeerPAssertedIdentities, mSessionInterval, mSessionRefresher, resip::resipMax(), setSessionTimerPreferences(), startSessionTimer(), and resip::Symbols::Timer.
Referenced by dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), and resip::ClientInviteSession::handleFinalResponse().
{
assert(msg.header(h_CSeq).method() == INVITE || msg.header(h_CSeq).method() == UPDATE);
// Allow Re-Invites and Updates to update the Peer P-Asserted-Identity
if (msg.exists(h_PAssertedIdentities))
{
mPeerPAssertedIdentities = msg.header(h_PAssertedIdentities);
}
// If session timers are locally supported then handle response
if(mDum.getMasterProfile()->getSupportedOptionTags().find(Token(Symbols::Timer)))
{
setSessionTimerPreferences();
if(msg.exists(h_Requires) && msg.header(h_Requires).find(Token(Symbols::Timer))
&& !msg.exists(h_SessionExpires))
{
// If no Session Expires in response and Requires header is present then session timer is to be 'turned off'
mSessionInterval = 0;
}
// Process Session Timer headers
else if(msg.exists(h_SessionExpires))
{
mSessionInterval = msg.header(h_SessionExpires).value();
if(msg.header(h_SessionExpires).exists(p_refresher))
{
// Remote end specified refresher preference
mSessionRefresher = (msg.header(h_SessionExpires).param(p_refresher) == Data("uac"));
}
}
else
{
// Note: If no Requires or Session-Expires, then UAS does not support Session Timers
// - we are free to use our SessionInterval settings (set above as a default)
// If far end doesn't support then refresher must be local
mSessionRefresher = true;
}
// Update MinSE if specified and longer than current value
if(msg.exists(h_MinSE))
{
mMinSE = resipMax(mMinSE, msg.header(h_MinSE).value());
}
startSessionTimer();
}
}

| bool InviteSession::hasLocalOfferAnswer | ( | ) | const |
Definition at line 111 of file InviteSession.cxx.
References mCurrentLocalOfferAnswer.
{
return (mCurrentLocalOfferAnswer.get());
}
| bool InviteSession::hasLocalSdp | ( | ) | const |
Definition at line 168 of file InviteSession.cxx.
References resip::InviteSessionHandler::isGenericOfferAnswer(), mCurrentLocalOfferAnswer, resip::BaseUsage::mDum, and resip::DialogUsageManager::mInviteSessionHandler.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
return (mCurrentLocalOfferAnswer.get());
}

| bool InviteSession::hasProposedRemoteOfferAnswer | ( | ) | const |
Definition at line 149 of file InviteSession.cxx.
References mProposedRemoteOfferAnswer.
{
return (mProposedRemoteOfferAnswer.get());
}
| bool InviteSession::hasProposedRemoteSdp | ( | ) | const |
Definition at line 214 of file InviteSession.cxx.
References resip::InviteSessionHandler::isGenericOfferAnswer(), resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, and mProposedRemoteOfferAnswer.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
return (mProposedRemoteOfferAnswer.get());
}

| bool InviteSession::hasRemoteOfferAnswer | ( | ) | const |
Definition at line 130 of file InviteSession.cxx.
References mCurrentRemoteOfferAnswer.
{
return (mCurrentRemoteOfferAnswer.get());
}
| bool InviteSession::hasRemoteSdp | ( | ) | const |
Definition at line 191 of file InviteSession.cxx.
References resip::InviteSessionHandler::isGenericOfferAnswer(), mCurrentRemoteOfferAnswer, resip::BaseUsage::mDum, and resip::DialogUsageManager::mInviteSessionHandler.
{
assert(!mDum.mInviteSessionHandler->isGenericOfferAnswer());
return (mCurrentRemoteOfferAnswer.get());
}

| void InviteSession::info | ( | const Contents & | contents | ) | [virtual] |
sends an info request
Definition at line 1024 of file InviteSession.cxx.
References InfoLog, resip::Dialog::makeRequest(), mCurrentEncryptionLevel, resip::DialogUsage::mDialog, mLastSentNITRequest, mNITQueue, mNitState, NitComplete, NitProceeding, resip::DialogUsage::send(), and resip::DumHelper::setOutgoingEncryptionLevel().
{
SharedPtr<SipMessage> info(new SipMessage());
mDialog.makeRequest(*info, INFO);
// !jf! handle multipart here
info->setContents(&contents);
DumHelper::setOutgoingEncryptionLevel(*info, mCurrentEncryptionLevel);
if (mNitState == NitComplete)
{
mNitState = NitProceeding;
mLastSentNITRequest = info;
send(info);
return;
}
mNITQueue.push(new QueuedNIT(info));
InfoLog(<< "info - queuing NIT:" << info->brief());
return;
}

| void InviteSession::infoCommand | ( | const Contents & | contents | ) | [virtual] |
Definition at line 1067 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionInfoCommand(*this, contents));
}

| bool InviteSession::isAccepted | ( | ) | const |
Definition at line 332 of file InviteSession.cxx.
References mState, UAS_EarlyNoOffer, UAS_EarlyOffer, UAS_EarlyProvidedAnswer, UAS_EarlyProvidedOffer, UAS_FirstSentAnswerReliable, UAS_FirstSentOfferReliable, UAS_NegotiatedReliable, UAS_NoOffer, UAS_NoOfferReliable, UAS_Offer, UAS_OfferProvidedAnswer, UAS_ProvidedOffer, and UAS_Start.
Referenced by resip::BasicClientCall::onOffer().
{
switch (mState)
{
case UAS_Start:
case UAS_Offer:
case UAS_NoOffer:
case UAS_NoOfferReliable:
case UAS_ProvidedOffer:
case UAS_OfferProvidedAnswer:
case UAS_EarlyOffer:
case UAS_EarlyProvidedOffer:
case UAS_EarlyProvidedAnswer:
case UAS_EarlyNoOffer:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_NegotiatedReliable:
return false;
default:
return true;
}
}
| bool InviteSession::isConnected | ( | ) | const |
Definition at line 287 of file InviteSession.cxx.
References Answered, Connected, mState, ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedReinviteSentOffer, ReceivedUpdate, SentReinvite, SentReinviteAnswered, SentReinviteGlare, SentReinviteNoOffer, SentReinviteNoOfferGlare, SentUpdate, SentUpdateGlare, WaitingToOffer, and WaitingToRequestOffer.
Referenced by refer(), and targetRefresh().
{
switch (mState)
{
case Connected:
case SentUpdate:
case SentUpdateGlare:
case SentReinvite:
case SentReinviteGlare:
case SentReinviteNoOffer:
case SentReinviteAnswered:
case SentReinviteNoOfferGlare:
case ReceivedUpdate:
case ReceivedReinvite:
case ReceivedReinviteNoOffer:
case ReceivedReinviteSentOffer:
case Answered:
case WaitingToOffer:
case WaitingToRequestOffer:
return true;
default:
return false;
}
}
| bool InviteSession::isEarly | ( | ) | const |
Definition at line 314 of file InviteSession.cxx.
References mState, UAC_Early, UAC_EarlyWithAnswer, UAC_EarlyWithOffer, UAC_QueuedUpdate, UAC_ReceivedUpdateEarly, UAC_SentAnswer, and UAC_SentUpdateEarly.
{
switch (mState)
{
case UAC_Early:
case UAC_EarlyWithOffer:
case UAC_EarlyWithAnswer:
case UAC_SentUpdateEarly:
case UAC_ReceivedUpdateEarly:
case UAC_SentAnswer:
case UAC_QueuedUpdate:
return true;
default:
return false;
}
}
| bool InviteSession::isReliable | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 2709 of file InviteSession.cxx.
References resip::Symbols::C100rel, resip::SipMessage::exists(), resip::DialogUsageManager::getMasterProfile(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::BaseUsage::mDum, resip::SipMessage::method(), and resip::MasterProfile::Never.
Referenced by resip::ClientInviteSession::handleProvisional(), resip::ClientInviteSession::sendPrackIfNeeded(), and toEvent().
{
if(msg.method() != INVITE)
{
return false;
}
if(msg.isRequest())
{
return mDum.getMasterProfile()->getUasReliableProvisionalMode() > MasterProfile::Never
&& ((msg.exists(h_Supporteds) && msg.header(h_Supporteds).find(Token(Symbols::C100rel)))
|| (msg.exists(h_Requires) && msg.header(h_Requires).find(Token(Symbols::C100rel))));
}
else
{
return mDum.getMasterProfile()->getUacReliableProvisionalMode() > MasterProfile::Never
&& msg.exists(h_Requires) && msg.header(h_Requires).find(Token(Symbols::C100rel));
}
}

| bool InviteSession::isTerminated | ( | ) | const |
Definition at line 356 of file InviteSession.cxx.
References mState, Terminated, UAC_Cancelled, UAS_WaitingToHangup, UAS_WaitingToTerminate, WaitingToHangup, and WaitingToTerminate.
Referenced by dispatch(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), dispatchGlare(), dispatchReinviteNoOfferGlare(), resip::ClientInviteSession::dispatchStart(), and resip::ServerInviteSession::dispatchStart().
{
switch (mState)
{
case Terminated:
case WaitingToTerminate:
case WaitingToHangup:
case UAC_Cancelled:
case UAS_WaitingToTerminate:
case UAS_WaitingToHangup:
return true;
default:
return false;
}
}
| std::auto_ptr< Contents > InviteSession::makeOfferAnswer | ( | const Contents & | offerAnswer | ) | [static, protected] |
Definition at line 2750 of file InviteSession.cxx.
References resip::Contents::clone().
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), resip::ClientInviteSession::handleAnswer(), resip::ClientInviteSession::handleOffer(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), and sessionRefresh().

| auto_ptr< Contents > InviteSession::makeOfferAnswer | ( | const Contents & | offerAnswer, |
| const Contents * | alternative | ||
| ) | [static, protected] |
Definition at line 2756 of file InviteSession.cxx.
References resip::Contents::clone(), and resip::MultipartMixedContents::parts().
{
if (alternative)
{
MultipartAlternativeContents* mac = new MultipartAlternativeContents;
mac->parts().push_back(alternative->clone());
mac->parts().push_back(offerAnswer.clone());
return auto_ptr<Contents>(mac);
}
else
{
return auto_ptr<Contents>(offerAnswer.clone());
}
}

| void InviteSession::message | ( | const Contents & | contents | ) | [virtual] |
sends a message request
Definition at line 1073 of file InviteSession.cxx.
References InfoLog, resip::Dialog::makeRequest(), mCurrentEncryptionLevel, resip::DialogUsage::mDialog, mLastSentNITRequest, mNITQueue, mNitState, NitComplete, NitProceeding, resip::DialogUsage::send(), and resip::DumHelper::setOutgoingEncryptionLevel().
{
SharedPtr<SipMessage> message(new SipMessage());
mDialog.makeRequest(*message, MESSAGE);
// !jf! handle multipart here
message->setContents(&contents);
DumHelper::setOutgoingEncryptionLevel(*message, mCurrentEncryptionLevel);
InfoLog (<< "Trying to send MESSAGE: " << message);
if (mNitState == NitComplete)
{
mNitState = NitProceeding;
mLastSentNITRequest = message;
send(message);
return;
}
mNITQueue.push(new QueuedNIT(message));
InfoLog(<< "message - queuing NIT:" << message->brief());
return;
}

| void InviteSession::messageCommand | ( | const Contents & | contents | ) | [virtual] |
Definition at line 1118 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionMessageCommand(*this, contents));
}

| void InviteSession::nitComplete | ( | ) | [protected] |
Definition at line 871 of file InviteSession.cxx.
References resip::InviteSession::QueuedNIT::getNIT(), InfoLog, mLastSentNITRequest, mNITQueue, mNitState, mReferSub, NitComplete, NitProceeding, resip::InviteSession::QueuedNIT::referSubscription(), and resip::DialogUsage::send().
Referenced by resip::Dialog::dispatch(), dispatchInfo(), and dispatchMessage().
{
mNitState = NitComplete;
if (mNITQueue.size())
{
QueuedNIT *qn=mNITQueue.front();
mNITQueue.pop();
mNitState = NitProceeding;
mReferSub = qn->referSubscription();
mLastSentNITRequest = qn->getNIT();
InfoLog(<< "checkNITQueue - sending queued NIT:" << mLastSentNITRequest->brief());
send(mLastSentNITRequest);
delete qn;
}
}

| void InviteSession::onReadyToSend | ( | SipMessage & | msg | ) | [protected, virtual] |
Reimplemented from resip::DialogUsage.
Definition at line 3114 of file InviteSession.cxx.
References getSessionHandle(), resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, and resip::InviteSessionHandler::onReadyToSend().
{
mDum.mInviteSessionHandler->onReadyToSend(getSessionHandle(), msg);
}

| InviteSession& resip::InviteSession::operator= | ( | const InviteSession & | ) | [private] |
| void InviteSession::provideAnswer | ( | const Contents & | answer | ) | [virtual] |
Similar to provideOffer - called to set the answer to be signalled to the peer.
May result in message being sent synchronously depending on the state.
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 539 of file InviteSession.cxx.
References Connected, handleSessionTimerRequest(), InfoLog, makeOfferAnswer(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, mCurrentLocalOfferAnswer, mCurrentRemoteOfferAnswer, resip::DialogUsage::mDialog, mInvite200, mLastRemoteSessionModification, mProposedRemoteOfferAnswer, mState, ReceivedReinvite, ReceivedUpdate, resip::DialogUsage::send(), sendAck(), SentReinviteAnswered, setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), startRetransmit200Timer(), toData(), transition(), and WarningLog.
{
switch (mState)
{
case ReceivedReinvite:
transition(Connected);
mDialog.makeResponse(*mInvite200, *mLastRemoteSessionModification, 200);
handleSessionTimerRequest(*mInvite200, *mLastRemoteSessionModification);
InviteSession::setOfferAnswer(*mInvite200, answer, 0);
mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer);
mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer;
InfoLog (<< "Sending " << mInvite200->brief());
DumHelper::setOutgoingEncryptionLevel(*mInvite200, mCurrentEncryptionLevel);
send(mInvite200);
startRetransmit200Timer();
break;
case ReceivedUpdate: // same as ReceivedReinvite case.
{
transition(Connected);
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, *mLastRemoteSessionModification, 200);
handleSessionTimerRequest(*response, *mLastRemoteSessionModification);
InviteSession::setOfferAnswer(*response, answer, 0);
mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer);
mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer;
InfoLog (<< "Sending " << response->brief());
DumHelper::setOutgoingEncryptionLevel(*response, mCurrentEncryptionLevel);
send(response);
break;
}
case SentReinviteAnswered:
transition(Connected);
sendAck(&answer);
mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer;
mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer);
break;
default:
WarningLog (<< "Incorrect state to provideAnswer: " << toData(mState));
throw DialogUsage::Exception("Can't provide an answer", __FILE__,__LINE__);
}
}

| void InviteSession::provideAnswerCommand | ( | const Contents & | answer | ) | [virtual] |
Definition at line 610 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionProvideAnswerCommand(*this, answer));
}

| void InviteSession::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.
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 504 of file InviteSession.cxx.
References mCurrentEncryptionLevel.
Referenced by provideProposedOffer().
{
return provideOffer(offer, mCurrentEncryptionLevel, 0);
}
| void InviteSession::provideOffer | ( | const Contents & | offer, |
| DialogUsageManager::EncryptionLevel | level, | ||
| const Contents * | alternative | ||
| ) | [virtual] |
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 415 of file InviteSession.cxx.
References Answered, Connected, handleSessionTimerRequest(), InfoLog, makeOfferAnswer(), resip::Dialog::makeRequest(), resip::Dialog::makeResponse(), mCurrentEncryptionLevel, resip::DialogUsage::mDialog, mInvite200, mLastLocalSessionModification, mLastRemoteSessionModification, mProposedEncryptionLevel, mProposedLocalOfferAnswer, mProposedRemoteOfferAnswer, mState, ReceivedReinviteNoOffer, ReceivedReinviteSentOffer, resip::DialogUsage::send(), SentReinvite, setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), setSessionTimerHeaders(), startRetransmit200Timer(), startStaleReInviteTimer(), toData(), transition(), UAS_WaitingToOffer, WaitingToOffer, and WarningLog.
{
switch (mState)
{
case Connected:
case WaitingToOffer:
case UAS_WaitingToOffer:
transition(SentReinvite);
mDialog.makeRequest(*mLastLocalSessionModification, INVITE);
startStaleReInviteTimer();
setSessionTimerHeaders(*mLastLocalSessionModification);
InfoLog (<< "Sending " << mLastLocalSessionModification->brief());
InviteSession::setOfferAnswer(*mLastLocalSessionModification, offer, alternative);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
mProposedEncryptionLevel = level;
DumHelper::setOutgoingEncryptionLevel(*mLastLocalSessionModification, mProposedEncryptionLevel);
// call send to give app an chance to adorn the message.
send(mLastLocalSessionModification);
break;
case Answered:
// queue the offer to be sent after the ACK is received
transition(WaitingToOffer);
mProposedEncryptionLevel = level;
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
break;
case ReceivedReinviteNoOffer:
assert(!mProposedRemoteOfferAnswer.get());
transition(ReceivedReinviteSentOffer);
mDialog.makeResponse(*mInvite200, *mLastRemoteSessionModification, 200);
handleSessionTimerRequest(*mInvite200, *mLastRemoteSessionModification);
InviteSession::setOfferAnswer(*mInvite200, offer, 0);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer);
InfoLog (<< "Sending " << mInvite200->brief());
DumHelper::setOutgoingEncryptionLevel(*mInvite200, mCurrentEncryptionLevel);
send(mInvite200);
startRetransmit200Timer();
break;
default:
WarningLog (<< "Incorrect state to provideOffer: " << toData(mState));
throw DialogUsage::Exception("Can't provide an offer", __FILE__,__LINE__);
}
}

| void InviteSession::provideOfferCommand | ( | const Contents & | offer | ) | [virtual] |
Provide asynchronous method access by using command.
Definition at line 533 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionProvideOfferCommand(*this, offer));
}

| void InviteSession::provideOfferCommand | ( | const Contents & | offer, |
| DialogUsageManager::EncryptionLevel | level, | ||
| const Contents * | alternative | ||
| ) | [virtual] |
Definition at line 498 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionProvideOfferExCommand(*this, offer, level, alternative));
}

| void InviteSession::provideProposedOffer | ( | ) | [protected] |
Definition at line 2800 of file InviteSession.cxx.
References mProposedEncryptionLevel, mProposedLocalOfferAnswer, and provideOffer().
Referenced by dispatch(), resip::ServerInviteSession::dispatchWaitingToOffer(), and dispatchWaitingToOffer().
{
MultipartAlternativeContents* mp_ans =
dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get());
if (mp_ans)
{
// .kw. can cast below ever be NULL? Need assert/throw?
provideOffer( *(dynamic_cast<Contents*>((mp_ans)->parts().back())),
mProposedEncryptionLevel,
dynamic_cast<Contents*>((mp_ans)->parts().front()));
}
else
{
// .kw. can cast below ever be NULL? Need assert/throw?
provideOffer(*(dynamic_cast<Contents*>(mProposedLocalOfferAnswer.get())), mProposedEncryptionLevel, 0);
}
}

| void InviteSession::refer | ( | const NameAddr & | referTo, |
| bool | referSub = true |
||
| ) | [virtual] |
sends a refer request
Definition at line 823 of file InviteSession.cxx.
Referenced by refer().
{
refer(referTo,std::auto_ptr<resip::Contents>(0),referSub);
}
| void InviteSession::refer | ( | const NameAddr & | referTo, |
| std::auto_ptr< resip::Contents > | contents, | ||
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 828 of file InviteSession.cxx.
References InfoLog, isConnected(), resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, mLastSentNITRequest, mNITQueue, mNitState, mReferSub, resip::DialogUsage::myAddr(), NitComplete, NitProceeding, resip::Symbols::NoReferSub, refer(), resip::DialogUsage::send(), and WarningLog.
{
if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
{
SharedPtr<SipMessage> refer(new SipMessage());
mDialog.makeRequest(*refer, REFER);
refer->header(h_ReferTo) = referTo;
refer->header(h_ReferredBy) = myAddr();
refer->header(h_ReferredBy).remove(p_tag); // tag-param not permitted in rfc3892; not the same as generic-param
refer->setContents(contents);
if (!referSub)
{
refer->header(h_ReferSub).value() = "false";
refer->header(h_Supporteds).push_back(Token(Symbols::NoReferSub));
}
if(mNitState == NitComplete)
{
mNitState = NitProceeding;
mReferSub = referSub;
mLastSentNITRequest = refer;
send(refer);
return;
}
mNITQueue.push(new QueuedNIT(refer,referSub));
InfoLog(<< "refer - queuing NIT:" << refer->brief());
return;
}
else
{
WarningLog (<< "Can't refer before Connected");
assert(0);
throw UsageUseException("REFER not allowed in this context", __FILE__, __LINE__);
}
}

| void InviteSession::refer | ( | const NameAddr & | referTo, |
| InviteSessionHandle | sessionToReplace, | ||
| bool | referSub = true |
||
| ) | [virtual] |
sends a refer request with a replaces header
Definition at line 921 of file InviteSession.cxx.
References refer().
{
refer(referTo,sessionToReplace,std::auto_ptr<resip::Contents>(0),referSub);
}

| void InviteSession::refer | ( | const NameAddr & | referTo, |
| InviteSessionHandle | sessionToReplace, | ||
| std::auto_ptr< resip::Contents > | contents, | ||
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 927 of file InviteSession.cxx.
References resip::Handle< T >::getId(), resip::Handle< T >::isValid(), resip::ParserCategory::param(), refer(), and resip::CallID::value().
{
if (!sessionToReplace.isValid())
{
throw UsageUseException("Attempted to make a refer w/ and invalid replacement target", __FILE__, __LINE__);
}
CallId replaces;
DialogId id = sessionToReplace->mDialog.getId();
replaces.value() = id.getCallId();
replaces.param(p_toTag) = id.getRemoteTag();
replaces.param(p_fromTag) = id.getLocalTag();
refer(referTo, replaces, contents, referSub);
}

| void InviteSession::refer | ( | const NameAddr & | referTo, |
| const CallId & | replaces, | ||
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 944 of file InviteSession.cxx.
References refer().
{
refer(referTo,replaces,std::auto_ptr<resip::Contents>(0),referSub);
}

| void InviteSession::refer | ( | const NameAddr & | referTo, |
| const CallId & | replaces, | ||
| std::auto_ptr< resip::Contents > | contents, | ||
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 950 of file InviteSession.cxx.
References InfoLog, isConnected(), resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, mLastSentNITRequest, mNITQueue, mNitState, mReferSub, resip::DialogUsage::myAddr(), NitComplete, NitProceeding, resip::Symbols::NoReferSub, refer(), resip::DialogUsage::send(), and WarningLog.
{
if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
{
SharedPtr<SipMessage> refer(new SipMessage());
mDialog.makeRequest(*refer, REFER);
refer->setContents(contents);
refer->header(h_ReferTo) = referTo;
refer->header(h_ReferredBy) = myAddr();
refer->header(h_ReferredBy).remove(p_tag);
refer->header(h_ReferTo).uri().embedded().header(h_Replaces) = replaces;
if (!referSub)
{
refer->header(h_ReferSub).value() = "false";
refer->header(h_Supporteds).push_back(Token(Symbols::NoReferSub));
}
if(mNitState == NitComplete)
{
mNitState = NitProceeding;
mReferSub = referSub;
mLastSentNITRequest = refer;
send(refer);
return;
}
mNITQueue.push(new QueuedNIT(refer,referSub));
InfoLog(<< "refer/replace - queuing NIT:" << refer->brief());
return;
}
else
{
WarningLog (<< "Can't refer before Connected");
assert(0);
throw UsageUseException("REFER not allowed in this context", __FILE__, __LINE__);
}
}

| void InviteSession::referCommand | ( | const NameAddr & | referTo, |
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 915 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionReferCommand(*this, referTo, referSub));
}

| void InviteSession::referCommand | ( | const NameAddr & | referTo, |
| InviteSessionHandle | sessionToReplace, | ||
| bool | referSub = true |
||
| ) | [virtual] |
Definition at line 1018 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionReferExCommand(*this, referTo, sessionToReplace, referSub));
}

| void InviteSession::referNoSub | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 3127 of file InviteSession.cxx.
References getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, mLastReferNoSubRequest, and resip::InviteSessionHandler::onReferNoSub().
Referenced by resip::Dialog::dispatch().
{
assert(msg.isRequest() && msg.header(h_CSeq).method()==REFER);
mLastReferNoSubRequest = msg;
mDum.mInviteSessionHandler->onReferNoSub(getSessionHandle(), mLastReferNoSubRequest);
}

| void InviteSession::reject | ( | int | statusCode, |
| WarningCategory * | warning = 0 |
||
| ) | [virtual] |
Rejects an offer at the SIP level.
Can also be used to send a 488 to a reINVITE or UPDATE
Reimplemented in resip::ServerInviteSession, and resip::ClientInviteSession.
Definition at line 740 of file InviteSession.cxx.
References Connected, InfoLog, resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, mLastRemoteSessionModification, mState, ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedUpdate, resip::DialogUsage::send(), sendAck(), SentReinviteAnswered, and transition().
{
switch (mState)
{
case ReceivedUpdate:
case ReceivedReinvite:
case ReceivedReinviteNoOffer:
{
transition(Connected);
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, *mLastRemoteSessionModification, statusCode);
if(warning)
{
response->header(h_Warnings).push_back(*warning);
}
InfoLog (<< "Sending " << response->brief());
send(response);
break;
}
// Sent a reINVITE no offer and received a 200-offer.
// Simply send an ACK without an answer and stay in Connected.
case SentReinviteAnswered:
{
InfoLog (<< "Not sending " << statusCode << " error since transaction"
"already completed, sending answer-less ACK");
transition(Connected);
sendAck();
break;
}
default:
assert(0);
break;
}
}

| void InviteSession::rejectCommand | ( | int | statusCode, |
| WarningCategory * | warning = 0 |
||
| ) | [virtual] |
Asynchronously rejects an offer at the SIP level.
Can also be used to send a 488 to a reINVITE or UPDATE
Definition at line 802 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionRejectCommand(*this, code, warning));
}

| void InviteSession::rejectNIT | ( | int | statusCode = 488 | ) | [virtual] |
rejects an INFO or MESSAGE request with an error status code
Definition at line 2233 of file InviteSession.cxx.
References resip::Helper::getResponseCodeReason(), h_StatusLine, mLastNitResponse, mServerNitState, NitComplete, NitProceeding, and resip::DialogUsage::send().
{
if (statusCode < 400)
{
throw UsageUseException("Must reject with a >= 4xx", __FILE__, __LINE__);
}
if (mServerNitState != NitProceeding )
{
throw UsageUseException("No transaction to reject", __FILE__, __LINE__);
}
mLastNitResponse->header(h_StatusLine).statusCode() = statusCode;
mLastNitResponse->setContents(0);
Helper::getResponseCodeReason(statusCode, mLastNitResponse->header(h_StatusLine).reason());
send(mLastNitResponse);
mServerNitState = NitComplete;
}

| void InviteSession::rejectNITCommand | ( | int | statusCode = 488 | ) | [virtual] |
Asynchronously rejects an INFO or MESSAGE request with an error status code.
Definition at line 2276 of file InviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new InviteSessionRejectNITCommand(*this, statusCode));
}

| void InviteSession::rejectReferNoSub | ( | int | responseCode | ) | [virtual] |
Definition at line 3151 of file InviteSession.cxx.
References resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, mLastReferNoSubRequest, and resip::DialogUsage::send().
{
if (responseCode < 400)
{
throw UsageUseException("Must reject with a >= 4xx", __FILE__, __LINE__);
}
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, mLastReferNoSubRequest, responseCode);
send(response);
}

| void InviteSession::requestOffer | ( | ) | [virtual] |
Called to request that the far end provide an offer.
This will cause a reinvite with no body to be sent.
Reimplemented in resip::ServerInviteSession.
Definition at line 383 of file InviteSession.cxx.
References Answered, Connected, InfoLog, resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, mLastLocalSessionModification, mState, resip::DialogUsage::send(), SentReinviteNoOffer, setSessionTimerHeaders(), startStaleReInviteTimer(), transition(), UAS_WaitingToRequestOffer, WaitingToRequestOffer, and WarningLog.
Referenced by dispatch(), and dispatchWaitingToRequestOffer().
{
switch (mState)
{
case Connected:
case WaitingToRequestOffer:
case UAS_WaitingToRequestOffer:
transition(SentReinviteNoOffer);
mDialog.makeRequest(*mLastLocalSessionModification, INVITE);
startStaleReInviteTimer();
mLastLocalSessionModification->setContents(0); // Clear the contents from the INVITE
setSessionTimerHeaders(*mLastLocalSessionModification);
InfoLog (<< "Sending " << mLastLocalSessionModification->brief());
// call send to give app an chance to adorn the message.
send(mLastLocalSessionModification);
break;
case Answered:
// queue the offer to be sent after the ACK is received
transition(WaitingToRequestOffer);
break;
// ?slg? Can we handle all of the states listed in isConnected() ???
default:
WarningLog (<< "Can't requestOffer when not in Connected state");
throw DialogUsage::Exception("Can't request an offer", __FILE__,__LINE__);
}
}

| void InviteSession::sendAck | ( | const Contents * | answer = 0 | ) | [protected] |
Definition at line 3004 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimerMs(), resip::DumTimeout::CanDiscardAck, resip::BaseUsage::getBaseHandle(), resip::DialogSet::getCreator(), resip::BaseCreator::getLastRequest(), InfoLog, mAcks, resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, resip::Dialog::mDialogSet, resip::BaseUsage::mDum, mLastLocalSessionModification, resip::DialogUsage::send(), setOfferAnswer(), and resip::Timer::TH.
Referenced by resip::ClientInviteSession::dispatchCancelled(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), resip::ClientInviteSession::dispatchQueuedUpdate(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchSentUpdateEarlyGlare(), resip::ClientInviteSession::dispatchStart(), dispatchWaitingToTerminate(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ClientInviteSession::reject(), and reject().
{
SharedPtr<SipMessage> ack(new SipMessage);
SharedPtr<SipMessage> source;
if (mLastLocalSessionModification->method() == UPDATE)
{
//.dcm. scary--we could make a special ClientInviteSession variable/sendAck
source = mDialog.mDialogSet.getCreator()->getLastRequest();
}
else
{
source = mLastLocalSessionModification;
}
assert(mAcks.count(source->getTransactionId()) == 0);
mDialog.makeRequest(*ack, ACK);
// Copy Authorization and Proxy Authorization headers from
// mLastLocalSessionModification; regardless of whether this was the original
// INVITE or not, this is the correct place to go for auth headers.
if(mLastLocalSessionModification->exists(h_Authorizations))
{
ack->header(h_Authorizations) = mLastLocalSessionModification->header(h_Authorizations);
}
if(mLastLocalSessionModification->exists(h_ProxyAuthorizations))
{
ack->header(h_ProxyAuthorizations) = mLastLocalSessionModification->header(h_ProxyAuthorizations);
}
// Copy CSeq from original INVITE
ack->header(h_CSeq).sequence() = source->header(h_CSeq).sequence();
if(answer != 0)
{
setOfferAnswer(*ack, *answer);
}
mAcks[source->getTransactionId()] = ack;
mDum.addTimerMs(DumTimeout::CanDiscardAck, Timer::TH, getBaseHandle(), ack->header(h_CSeq).sequence(), 0, source->getTransactionId());
InfoLog (<< "Sending " << ack->brief());
send(ack);
}

| SharedPtr< SipMessage > InviteSession::sendBye | ( | ) | [protected] |
Definition at line 3051 of file InviteSession.cxx.
References getEndReasonString(), InfoLog, resip::InviteSessionHandler::LocalBye, resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, mEndReason, resip::DialogUsage::myAddr(), NotSpecified, resip::DialogEventStateManager::onTerminated(), resip::ParserCategory::param(), and resip::DialogUsage::send().
Referenced by dispatch(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchAnswered(), dispatchCancel(), resip::ClientInviteSession::dispatchCancelled(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), dispatchPrack(), resip::ClientInviteSession::dispatchQueuedUpdate(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchStart(), dispatchUnhandledInvite(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), resip::ServerInviteSession::dispatchWaitingToRequestOffer(), dispatchWaitingToTerminate(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), end(), and resip::ClientInviteSession::reject().
{
SharedPtr<SipMessage> bye(new SipMessage());
mDialog.makeRequest(*bye, BYE);
Data txt;
if (mEndReason != NotSpecified)
{
Token reason("SIP");
txt = getEndReasonString(mEndReason);
reason.param(p_text) = txt;
bye->header(h_Reasons).push_back(reason);
}
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onTerminated(mDialog, *bye, InviteSessionHandler::LocalBye);
}
InfoLog (<< myAddr() << " Sending BYE " << txt);
send(bye);
return bye;
}

| void InviteSession::sessionRefresh | ( | ) | [protected] |
Definition at line 2396 of file InviteSession.cxx.
References InfoLog, makeOfferAnswer(), resip::Dialog::makeRequest(), mCurrentEncryptionLevel, mCurrentLocalOfferAnswer, resip::DialogUsage::mDialog, mLastLocalSessionModification, mProposedLocalOfferAnswer, mSessionRefreshReInvite, resip::DialogUsage::send(), SentReinvite, SentUpdate, setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), setSessionTimerHeaders(), startStaleReInviteTimer(), transition(), and updateMethodSupported().
Referenced by dispatch(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), and targetRefresh().
{
if (updateMethodSupported())
{
transition(SentUpdate);
mDialog.makeRequest(*mLastLocalSessionModification, UPDATE);
mLastLocalSessionModification->setContents(0); // Don't send SDP
}
else
{
transition(SentReinvite);
mDialog.makeRequest(*mLastLocalSessionModification, INVITE);
startStaleReInviteTimer();
InviteSession::setOfferAnswer(*mLastLocalSessionModification, mCurrentLocalOfferAnswer.get());
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(*mCurrentLocalOfferAnswer.get(), 0);
mSessionRefreshReInvite = true;
}
setSessionTimerHeaders(*mLastLocalSessionModification);
InfoLog (<< "sessionRefresh: Sending " << mLastLocalSessionModification->brief());
DumHelper::setOutgoingEncryptionLevel(*mLastLocalSessionModification, mCurrentEncryptionLevel);
send(mLastLocalSessionModification);
}

| void InviteSession::setCurrentLocalOfferAnswer | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 3092 of file InviteSession.cxx.
References resip::DialogUsageManager::Encrypt, getEncryptionLevel(), mCurrentLocalOfferAnswer, mProposedLocalOfferAnswer, and resip::DialogUsageManager::SignAndEncrypt.
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchEarly(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchStart(), and resip::ClientInviteSession::handleAnswer().
{
assert(mProposedLocalOfferAnswer.get());
if (dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))
{
if (DialogUsageManager::Encrypt == getEncryptionLevel(msg) || DialogUsageManager::SignAndEncrypt == getEncryptionLevel(msg))
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().back()->clone()));
}
else
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().front()->clone()));
}
}
else
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>(mProposedLocalOfferAnswer.get()->clone()));
}
mProposedLocalOfferAnswer.reset();
}

| void InviteSession::setOfferAnswer | ( | SipMessage & | msg, |
| const Contents & | offerAnswer, | ||
| const Contents * | alternative = 0 |
||
| ) | [static, protected] |
Definition at line 2773 of file InviteSession.cxx.
References resip::Contents::clone(), resip::MultipartMixedContents::parts(), and resip::SipMessage::setContents().
Referenced by resip::ClientInviteSession::dispatchQueuedUpdate(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::sendAccept(), sendAck(), resip::ClientInviteSession::sendPrack(), resip::ServerInviteSession::sendProvisional(), resip::ServerInviteSession::sendUpdate(), and sessionRefresh().
{
// !jf! should deal with multipart here
// This will clone the offerAnswer since the InviteSession also wants to keep its own
// copy of the offerAnswer around for the application to access
if (alternative)
{
MultipartAlternativeContents* mac = new MultipartAlternativeContents;
mac->parts().push_back(alternative->clone());
mac->parts().push_back(offerAnswer.clone());
msg.setContents(auto_ptr<Contents>(mac));
}
else
{
msg.setContents(&offerAnswer);
}
}

| void InviteSession::setOfferAnswer | ( | SipMessage & | msg, |
| const Contents * | offerAnswer | ||
| ) | [static, protected] |
Definition at line 2793 of file InviteSession.cxx.
References resip::SipMessage::setContents().
{
assert(offerAnswer);
msg.setContents(offerAnswer);
}

| void InviteSession::setSessionTimerHeaders | ( | SipMessage & | msg | ) | [protected] |
Definition at line 2373 of file InviteSession.cxx.
References resip::SipMessage::header(), resip::SipMessage::isRequest(), mMinSE, mSessionInterval, mSessionRefresher, and resip::SipMessage::remove().
Referenced by handleSessionTimerRequest(), provideOffer(), requestOffer(), and sessionRefresh().
{
if(mSessionInterval >= 90) // If mSessionInterval is 0 then SessionTimers are considered disabled
{
msg.header(h_SessionExpires).value() = mSessionInterval;
if(msg.isRequest())
{
msg.header(h_SessionExpires).param(p_refresher) = Data(mSessionRefresher ? "uac" : "uas");
}
else
{
msg.header(h_SessionExpires).param(p_refresher) = Data(mSessionRefresher ? "uas" : "uac");
}
msg.header(h_MinSE).value() = mMinSE;
}
else
{
msg.remove(h_SessionExpires);
msg.remove(h_MinSE);
}
}

| void InviteSession::setSessionTimerPreferences | ( | ) | [protected] |
Definition at line 2421 of file InviteSession.cxx.
References resip::DialogSet::getUserProfile(), resip::DialogUsage::mDialog, resip::Dialog::mDialogSet, mMinSE, mSessionInterval, mSessionRefresher, resip::Profile::PreferCalleeRefreshes, resip::Profile::PreferCallerRefreshes, resip::Profile::PreferLocalRefreshes, resip::Profile::PreferRemoteRefreshes, and resip::resipMax().
Referenced by handleSessionTimerRequest(), and handleSessionTimerResponse().
{
mSessionInterval = mDialog.mDialogSet.getUserProfile()->getDefaultSessionTime(); // Used only if remote doesn't request a time
if(mSessionInterval != 0)
{
// If session timers are no disabled then ensure interval is greater than or equal to MinSE
mSessionInterval = resipMax(mMinSE, mSessionInterval);
}
switch(mDialog.mDialogSet.getUserProfile()->getDefaultSessionTimerMode())
{
case Profile::PreferLocalRefreshes:
mSessionRefresher = true; // Default refresher is Local
break;
case Profile::PreferRemoteRefreshes:
mSessionRefresher = false; // Default refresher is Remote
break;
case Profile::PreferCalleeRefreshes:
mSessionRefresher = dynamic_cast<ServerInviteSession*>(this) != NULL; // Default refresher is callee
break;
case Profile::PreferCallerRefreshes:
mSessionRefresher = dynamic_cast<ClientInviteSession*>(this) != NULL; // Default refresher is caller
break;
}
}

| void InviteSession::start491Timer | ( | ) | [protected] |
Definition at line 2338 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimerMs(), DebugLog, resip::BaseUsage::getBaseHandle(), resip::Random::getRandom(), resip::DumTimeout::Glare, resip::BaseUsage::mDum, and mLastLocalSessionModification.
Referenced by dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), and resip::ClientInviteSession::dispatchSentUpdateEarly().
{
unsigned int seq = mLastLocalSessionModification->header(h_CSeq).sequence();
if (dynamic_cast<ClientInviteSession*>(this))
{
int timer = Random::getRandom() % (4000 - 2100);
timer += 2100;
timer -= timer % 10;
DebugLog(<< "491 timer value: " << timer << "ms" << endl);
mDum.addTimerMs(DumTimeout::Glare, timer, getBaseHandle(), seq);
}
else
{
int timer = Random::getRandom() % 2000;
timer -= timer % 10;
DebugLog(<< "491 timer value: " << timer << "ms" << endl);
mDum.addTimerMs(DumTimeout::Glare, timer, getBaseHandle(), seq);
}
}

| void InviteSession::startRetransmit200Timer | ( | ) | [protected] |
Definition at line 2322 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimerMs(), resip::BaseUsage::getBaseHandle(), mCurrentRetransmit200, resip::BaseUsage::mDum, mLastRemoteSessionModification, resip::DumTimeout::Retransmit200, resip::Timer::T1, resip::Timer::TH, and resip::DumTimeout::WaitForAck.
Referenced by provideAnswer(), provideOffer(), and resip::ServerInviteSession::sendAccept().
{
mCurrentRetransmit200 = Timer::T1;
unsigned int seq = mLastRemoteSessionModification->header(h_CSeq).sequence();
mDum.addTimerMs(DumTimeout::Retransmit200, mCurrentRetransmit200, getBaseHandle(), seq);
mDum.addTimerMs(DumTimeout::WaitForAck, Timer::TH, getBaseHandle(), seq);
}

| void InviteSession::startSessionTimer | ( | ) | [protected] |
Definition at line 2447 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimer(), resip::BaseUsage::getBaseHandle(), resip::BaseUsage::mDum, mSessionInterval, mSessionRefresher, mSessionTimerSeq, resip::resipMin(), resip::DumTimeout::SessionExpiration, and resip::DumTimeout::SessionRefresh.
Referenced by handleSessionTimerRequest(), and handleSessionTimerResponse().
{
if(mSessionInterval >= 90) // 90 is the absolute minimum - RFC4028
{
// Check if we are the refresher
if(mSessionRefresher)
{
// Start Session-Refresh Timer to mSessionInterval / 2 (recommended by RFC4028)
mDum.addTimer(DumTimeout::SessionRefresh, mSessionInterval / 2, getBaseHandle(), ++mSessionTimerSeq);
}
else
{
// Start Session-Expiration Timer to mSessionInterval - BYE should be sent a minimum of 32 and one third of the SessionInterval, seconds before the session expires (recommended by RFC4028)
mDum.addTimer(DumTimeout::SessionExpiration, mSessionInterval - resipMin((UInt32)32,mSessionInterval/3), getBaseHandle(), ++mSessionTimerSeq);
}
}
else // Session Interval less than 90 - consider timers disabled
{
++mSessionTimerSeq; // increment seq, incase old timers are running and now session timers are disabled
}
}

| void InviteSession::startStaleReInviteTimer | ( | ) | [protected] |
Definition at line 2361 of file InviteSession.cxx.
References resip::DialogUsageManager::addTimer(), resip::BaseUsage::getBaseHandle(), resip::DialogSet::getUserProfile(), InfoLog, resip::DialogUsage::mDialog, resip::Dialog::mDialogSet, resip::BaseUsage::mDum, mStaleReInviteTimerSeq, mState, resip::DumTimeout::StaleReInvite, and toData().
Referenced by dispatch(), provideOffer(), requestOffer(), and sessionRefresh().
{
InfoLog (<< toData(mState) << ": startStaleReInviteTimer");
unsigned long when = mDialog.mDialogSet.getUserProfile()->getDefaultStaleReInviteTime();
mDum.addTimer(DumTimeout::StaleReInvite,
when,
getBaseHandle(),
++mStaleReInviteTimerSeq);
}

| void InviteSession::storePeerCapabilities | ( | const SipMessage & | msg | ) | [protected] |
Definition at line 242 of file InviteSession.cxx.
References resip::SipMessage::exists(), h_AllowEvents, resip::SipMessage::header(), mPeerAllowedEvents, mPeerSupportedEncodings, mPeerSupportedLanguages, mPeerSupportedMethods, mPeerSupportedMimeTypes, mPeerSupportedOptionTags, and mPeerUserAgent.
Referenced by resip::ServerInviteSession::dispatchStart(), and resip::ClientInviteSession::handleFinalResponse().
{
if (msg.exists(h_Allows))
{
mPeerSupportedMethods = msg.header(h_Allows);
}
if (msg.exists(h_Supporteds))
{
mPeerSupportedOptionTags = msg.header(h_Supporteds);
}
if (msg.exists(h_AcceptEncodings))
{
mPeerSupportedEncodings = msg.header(h_AcceptEncodings);
}
if (msg.exists(h_AcceptLanguages))
{
mPeerSupportedLanguages = msg.header(h_AcceptLanguages);
}
if (msg.exists(h_AllowEvents))
{
mPeerAllowedEvents = msg.header(h_AllowEvents);
}
if (msg.exists(h_Accepts))
{
mPeerSupportedMimeTypes = msg.header(h_Accepts);
}
if (msg.exists(h_UserAgent))
{
mPeerUserAgent = msg.header(h_UserAgent).value();
}
}

| void InviteSession::targetRefresh | ( | const NameAddr & | localUri | ) | [virtual] |
will send a reINVITE (current offerAnswer) or UPDATE with new Contact header
Definition at line 808 of file InviteSession.cxx.
References isConnected(), resip::DialogUsage::mDialog, resip::Dialog::mLocalContact, sessionRefresh(), and WarningLog.
{
if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
{
mDialog.mLocalContact = localUri;
sessionRefresh();
}
else
{
WarningLog (<< "Can't targetRefresh before Connected");
throw UsageUseException("targetRefresh not allowed in this context", __FILE__, __LINE__);
}
}

Definition at line 2581 of file InviteSession.cxx.
References Answered, Connected, ReceivedReinvite, ReceivedReinviteNoOffer, ReceivedReinviteSentOffer, ReceivedUpdate, SentReinvite, SentReinviteAnswered, SentReinviteGlare, SentReinviteNoOffer, SentReinviteNoOfferGlare, SentUpdate, SentUpdateGlare, Terminated, UAC_Answered, UAC_Cancelled, UAC_Early, UAC_EarlyWithAnswer, UAC_EarlyWithOffer, UAC_QueuedUpdate, UAC_ReceivedUpdateEarly, UAC_SentAnswer, UAC_SentUpdateEarly, UAC_SentUpdateEarlyGlare, UAC_Start, UAS_Accepted, UAS_AcceptedWaitingAnswer, UAS_EarlyNoOffer, UAS_EarlyOffer, UAS_EarlyProvidedAnswer, UAS_EarlyProvidedOffer, UAS_FirstSentAnswerReliable, UAS_FirstSentOfferReliable, UAS_NegotiatedReliable, UAS_NoOffer, UAS_NoOfferReliable, UAS_Offer, UAS_OfferProvidedAnswer, UAS_ProvidedOffer, UAS_ReceivedOfferReliable, UAS_ReceivedUpdate, UAS_ReceivedUpdateWaitingAnswer, UAS_SentUpdate, UAS_SentUpdateAccepted, UAS_Start, UAS_WaitingToHangup, UAS_WaitingToOffer, UAS_WaitingToRequestOffer, UAS_WaitingToTerminate, Undefined, WaitingToHangup, WaitingToOffer, WaitingToRequestOffer, and WaitingToTerminate.
Referenced by resip::ServerInviteSession::accept(), resip::ClientInviteSession::cancel(), dispatchOthers(), dump(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), resip::ClientInviteSession::onForkAccepted(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), resip::ServerInviteSession::provisional(), resip::ServerInviteSession::redirect(), resip::ClientInviteSession::reject(), resip::ServerInviteSession::reject(), resip::ServerInviteSession::requestOffer(), resip::ClientInviteSession::startCancelTimer(), resip::ClientInviteSession::startStaleCallTimer(), startStaleReInviteTimer(), and transition().
{
switch (state)
{
case Undefined:
return "InviteSession::Undefined";
case Connected:
return "InviteSession::Connected";
case SentUpdate:
return "InviteSession::SentUpdate";
case SentUpdateGlare:
return "InviteSession::SentUpdateGlare";
case SentReinvite:
return "InviteSession::SentReinvite";
case SentReinviteGlare:
return "InviteSession::SentReinviteGlare";
case SentReinviteNoOffer:
return "InviteSession::SentReinviteNoOffer";
case SentReinviteAnswered:
return "InviteSession::SentReinviteAnswered";
case SentReinviteNoOfferGlare:
return "InviteSession::SentReinviteNoOfferGlare";
case ReceivedUpdate:
return "InviteSession::ReceivedUpdate";
case ReceivedReinvite:
return "InviteSession::ReceivedReinvite";
case ReceivedReinviteNoOffer:
return "InviteSession::ReceivedReinviteNoOffer";
case ReceivedReinviteSentOffer:
return "InviteSession::ReceivedReinviteSentOffer";
case Answered:
return "InviteSession::Answered";
case WaitingToOffer:
return "InviteSession::WaitingToOffer";
case WaitingToRequestOffer:
return "InviteSession::WaitingToRequestOffer";
case WaitingToTerminate:
return "InviteSession::WaitingToTerminate";
case WaitingToHangup:
return "InviteSession::WaitingToHangup";
case Terminated:
return "InviteSession::Terminated";
case UAC_Start:
return "UAC_Start";
case UAS_Offer:
return "UAS_Offer";
case UAS_OfferProvidedAnswer:
return "UAS_OfferProvidedAnswer";
case UAS_EarlyOffer:
return "UAS_EarlyOffer";
case UAS_EarlyProvidedAnswer:
return "UAS_EarlyProvidedAnswer";
case UAS_NoOffer:
return "UAS_NoOffer";
case UAS_ProvidedOffer:
return "UAS_ProvidedOffer";
case UAS_EarlyNoOffer:
return "UAS_EarlyNoOffer";
case UAS_EarlyProvidedOffer:
return "UAS_EarlyProvidedOffer";
case UAS_Accepted:
return "UAS_Accepted";
case UAS_WaitingToOffer:
return "UAS_WaitingToOffer";
case UAS_AcceptedWaitingAnswer:
return "UAS_AcceptedWaitingAnswer";
case UAC_Early:
return "UAC_Early";
case UAC_EarlyWithOffer:
return "UAC_EarlyWithOffer";
case UAC_EarlyWithAnswer:
return "UAC_EarlyWithAnswer";
case UAC_Answered:
return "UAC_Answered";
case UAC_SentUpdateEarly:
return "UAC_SentUpdateEarly";
case UAC_SentUpdateEarlyGlare:
return "UAC_SentUpdateEarlyGlare";
case UAC_ReceivedUpdateEarly:
return "UAC_ReceivedUpdateEarly";
case UAC_SentAnswer:
return "UAC_SentAnswer";
case UAC_QueuedUpdate:
return "UAC_QueuedUpdate";
case UAC_Cancelled:
return "UAC_Cancelled";
case UAS_Start:
return "UAS_Start";
case UAS_ReceivedOfferReliable:
return "UAS_ReceivedOfferReliable";
case UAS_NoOfferReliable:
return "UAS_NoOfferReliable";
case UAS_FirstSentOfferReliable:
return "UAS_FirstSentOfferReliable";
case UAS_FirstSentAnswerReliable:
return "UAS_FirstSentAnswerReliable";
case UAS_NegotiatedReliable:
return "UAS_NegotiatedReliable";
case UAS_SentUpdate:
return "UAS_SentUpdate";
case UAS_SentUpdateAccepted:
return "UAS_SentUpdateAccepted";
case UAS_ReceivedUpdate:
return "UAS_ReceivedUpdate";
case UAS_ReceivedUpdateWaitingAnswer:
return "UAS_ReceivedUpdateWaitingAnswer";
case UAS_WaitingToTerminate:
return "UAS_WaitingToTerminate";
case UAS_WaitingToHangup:
return "UAS_WaitingToHangup";
case UAS_WaitingToRequestOffer:
return "UAS_WaitingToRequestOffer";
}
assert(0);
return "Undefined";
}
| InviteSession::Event InviteSession::toEvent | ( | const SipMessage & | msg, |
| const Contents * | offeranswer | ||
| ) | [protected] |
Definition at line 2819 of file InviteSession.cxx.
References h_StatusLine, resip::SipMessage::header(), isReliable(), resip::SipMessage::isResponse(), resip::RequestLine::method(), mProposedLocalOfferAnswer, On1xx, On1xxAnswer, On1xxEarly, On1xxOffer, On200Bye, On200Cancel, On200Prack, On200Update, On2xx, On2xxAnswer, On2xxOffer, On422Invite, On422Update, On487Invite, On491Invite, On491Update, OnAck, OnAckAnswer, OnBye, OnCancel, OnCancelFailure, OnGeneralFailure, OnInvite, OnInviteFailure, OnInviteOffer, OnInviteReliable, OnInviteReliableOffer, OnPrack, OnRedirect, OnUpdate, OnUpdateOffer, OnUpdateRejected, and Unknown.
Referenced by resip::ServerInviteSession::dispatchAccepted(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchAnswered(), resip::ClientInviteSession::dispatchCancelled(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), resip::ServerInviteSession::dispatchOfferOrEarly(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), dispatchReceivedUpdateOrReinvite(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchSentUpdateEarlyGlare(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), and resip::ServerInviteSession::dispatchWaitingToRequestOffer().
{
MethodTypes method = msg.header(h_CSeq).method();
int code = msg.isResponse() ? msg.header(h_StatusLine).statusCode() : 0;
//.dcm. Treat an invite as reliable if UAS 100rel support is enabled. For
//responses, reiable provisionals should only be received if the invite was
//sent reliably. Spurious reliable provisional respnoses are dropped outside
//the state machine.
bool reliable = isReliable(msg);
bool sentOffer = mProposedLocalOfferAnswer.get();
if (code == 481 || code == 408)
{
return OnGeneralFailure;
}
else if (code >= 300 && code <= 399)
{
return OnRedirect;
}
else if (method == INVITE && code == 0)
{
if (offerAnswer)
{
if (reliable)
{
return OnInviteReliableOffer;
}
else
{
return OnInviteOffer;
}
}
else
{
if (reliable)
{
return OnInviteReliable;
}
else
{
return OnInvite;
}
}
}
else if (method == INVITE && code > 100 && code < 200)
{
if (reliable)
{
if (offerAnswer)
{
if (sentOffer)
{
return On1xxAnswer;
}
else
{
return On1xxOffer;
}
}
else
{
return On1xx;
}
}
else
{
if (offerAnswer)
{
return On1xxEarly;
}
else
{
return On1xx;
}
}
}
else if (method == INVITE && code >= 200 && code < 300)
{
if (offerAnswer)
{
if (sentOffer)
{
return On2xxAnswer;
}
else
{
return On2xxOffer;
}
}
else
{
return On2xx;
}
}
else if (method == INVITE && code == 422)
{
return On422Invite;
}
else if (method == INVITE && code == 487)
{
return On487Invite;
}
else if (method == INVITE && code == 491)
{
return On491Invite;
}
else if (method == INVITE && code >= 400)
{
return OnInviteFailure;
}
else if (method == ACK)
{
if (offerAnswer)
{
return OnAckAnswer;
}
else
{
return OnAck;
}
}
else if (method == CANCEL && code == 0)
{
return OnCancel;
}
else if (method == CANCEL && code / 200 == 1)
{
return On200Cancel;
}
else if (method == CANCEL && code >= 400)
{
return OnCancelFailure;
}
else if (method == BYE && code == 0)
{
return OnBye;
}
else if (method == BYE && code / 200 == 1)
{
return On200Bye;
}
else if (method == PRACK && code == 0)
{
return OnPrack;
}
else if (method == PRACK && code / 200 == 1)
{
return On200Prack;
}
else if (method == UPDATE && code == 0)
{
if (offerAnswer)
{
return OnUpdateOffer;
}
else
{
return OnUpdate;
}
}
else if (method == UPDATE && code / 200 == 1)
{
return On200Update;
}
else if (method == UPDATE && code == 422)
{
return On422Update;
}
else if (method == UPDATE && code == 491)
{
return On491Update;
}
else if (method == UPDATE && code >= 400)
{
return OnUpdateRejected;
}
else
{
//assert(0); // dispatchOthers will throw if the message type is really unknown
return Unknown;
}
}

| void InviteSession::transition | ( | State | target | ) | [protected] |
Definition at line 2702 of file InviteSession.cxx.
References InfoLog, mState, and toData().
Referenced by resip::ServerInviteSession::accept(), resip::ClientInviteSession::cancel(), resip::ClientInviteSession::dispatch(), dispatch(), resip::ServerInviteSession::dispatchAccepted(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchAnswered(), dispatchAnswered(), resip::ServerInviteSession::dispatchBye(), dispatchBye(), resip::ServerInviteSession::dispatchCancel(), dispatchCancel(), resip::ClientInviteSession::dispatchCancelled(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), dispatchPrack(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), resip::ClientInviteSession::dispatchSentAnswer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchSentUpdateEarlyGlare(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), dispatchUnhandledInvite(), resip::ServerInviteSession::dispatchUnknown(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), resip::ServerInviteSession::dispatchWaitingToRequestOffer(), dispatchWaitingToTerminate(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), end(), resip::ClientInviteSession::handleRedirect(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), resip::ServerInviteSession::provisional(), resip::ServerInviteSession::redirect(), resip::ClientInviteSession::reject(), resip::ServerInviteSession::reject(), reject(), resip::ServerInviteSession::requestOffer(), requestOffer(), and sessionRefresh().

| bool InviteSession::updateMethodSupported | ( | ) | const [protected] |
Definition at line 275 of file InviteSession.cxx.
References resip::ParserContainer< T >::find(), resip::DialogUsageManager::getMasterProfile(), resip::BaseUsage::mDum, and mPeerSupportedMethods.
Referenced by resip::ServerInviteSession::sendUpdate(), and sessionRefresh().
{
// Check if Update is supported locally
if(mDum.getMasterProfile()->isMethodSupported(UPDATE))
{
// Check if peer supports UPDATE
return mPeerSupportedMethods.find(Token("UPDATE"));
}
return false;
}

friend class Dialog [friend] |
Reimplemented in resip::ClientInviteSession, and resip::ServerInviteSession.
Definition at line 409 of file InviteSession.hxx.
friend class DialogUsageManager [friend] |
Reimplemented from resip::DialogUsage.
Definition at line 410 of file InviteSession.hxx.
AckMap resip::InviteSession::mAcks [protected] |
Definition at line 406 of file InviteSession.hxx.
Referenced by dispatch(), and sendAck().
Definition at line 396 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), resip::ClientInviteSession::handleAnswer(), resip::ClientInviteSession::handleOffer(), info(), message(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ClientInviteSession::provideOffer(), resip::ServerInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::sendAccept(), resip::ClientInviteSession::sendPrack(), and sessionRefresh().
std::auto_ptr<Contents> resip::InviteSession::mCurrentLocalOfferAnswer [protected] |
Definition at line 356 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::accept(), getLocalOfferAnswer(), getLocalSdp(), hasLocalOfferAnswer(), hasLocalSdp(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), resip::ServerInviteSession::sendProvisional(), sessionRefresh(), and setCurrentLocalOfferAnswer().
std::auto_ptr<Contents> resip::InviteSession::mCurrentRemoteOfferAnswer [protected] |
Definition at line 359 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::dispatchEarly(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ClientInviteSession::dispatchStart(), getRemoteOfferAnswer(), getRemoteSdp(), resip::ClientInviteSession::handleAnswer(), hasRemoteOfferAnswer(), hasRemoteSdp(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), and resip::ServerInviteSession::provideAnswer().
unsigned long resip::InviteSession::mCurrentRetransmit200 [protected] |
Definition at line 370 of file InviteSession.hxx.
Referenced by dispatch(), resip::ServerInviteSession::dispatchAccepted(), resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), dispatchAnswered(), dispatchConnected(), dispatchReceivedReinviteSentOffer(), resip::ServerInviteSession::dispatchWaitingToHangup(), dispatchWaitingToHangup(), resip::ServerInviteSession::dispatchWaitingToOffer(), dispatchWaitingToOffer(), resip::ServerInviteSession::dispatchWaitingToRequestOffer(), dispatchWaitingToRequestOffer(), resip::ServerInviteSession::end(), end(), and startRetransmit200Timer().
EndReason resip::InviteSession::mEndReason [protected] |
Definition at line 399 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::dispatchAcceptedWaitingAnswer(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), end(), and sendBye().
SharedPtr<SipMessage> resip::InviteSession::mInvite200 [protected] |
Definition at line 364 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::accept(), dispatch(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), provideOffer(), and resip::ServerInviteSession::sendAccept().
Definition at line 362 of file InviteSession.hxx.
Referenced by resip::ClientInviteSession::ClientInviteSession(), resip::ClientInviteSession::dispatch(), dispatch(), resip::ClientInviteSession::dispatchQueuedUpdate(), resip::ClientInviteSession::handleProvisional(), resip::ClientInviteSession::provideOffer(), provideOffer(), requestOffer(), sendAck(), resip::ServerInviteSession::sendUpdate(), sessionRefresh(), and start491Timer().
SharedPtr<SipMessage> resip::InviteSession::mLastNitResponse [protected] |
Definition at line 365 of file InviteSession.hxx.
Referenced by acceptNIT(), dispatchBye(), dispatchInfo(), dispatchMessage(), and rejectNIT().
Definition at line 368 of file InviteSession.hxx.
Referenced by acceptReferNoSub(), referNoSub(), and rejectReferNoSub().
Definition at line 363 of file InviteSession.hxx.
Referenced by dispatch(), dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), resip::ClientInviteSession::dispatchEarlyWithOffer(), dispatchReceivedReinviteSentOffer(), dispatchReceivedUpdateOrReinvite(), resip::ClientInviteSession::dispatchSentUpdateEarly(), resip::ServerInviteSession::dispatchStart(), end(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), provideOffer(), resip::ClientInviteSession::reject(), reject(), and startRetransmit200Timer().
SharedPtr<SipMessage> resip::InviteSession::mLastSentNITRequest [protected] |
Definition at line 394 of file InviteSession.hxx.
Referenced by getLastSentNITRequest(), info(), message(), nitComplete(), and refer().
UInt32 resip::InviteSession::mMinSE [protected] |
Definition at line 375 of file InviteSession.hxx.
Referenced by dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), handleSessionTimerRequest(), handleSessionTimerResponse(), setSessionTimerHeaders(), and setSessionTimerPreferences().
std::queue<QueuedNIT*> resip::InviteSession::mNITQueue [protected] |
Definition at line 391 of file InviteSession.hxx.
Referenced by info(), message(), nitComplete(), refer(), and ~InviteSession().
NitState resip::InviteSession::mNitState [protected] |
Definition at line 353 of file InviteSession.hxx.
Referenced by dispatchInfo(), dispatchMessage(), info(), message(), nitComplete(), and refer().
Tokens resip::InviteSession::mPeerAllowedEvents [protected] |
Definition at line 346 of file InviteSession.hxx.
Referenced by getPeerAllowedEvents(), and storePeerCapabilities().
Definition at line 348 of file InviteSession.hxx.
Referenced by getPeerPAssertedIdentities(), handleSessionTimerRequest(), and handleSessionTimerResponse().
Tokens resip::InviteSession::mPeerSupportedEncodings [protected] |
Definition at line 344 of file InviteSession.hxx.
Referenced by getPeerSupportedEncodings(), and storePeerCapabilities().
Tokens resip::InviteSession::mPeerSupportedLanguages [protected] |
Definition at line 345 of file InviteSession.hxx.
Referenced by getPeerSupportedLanguages(), and storePeerCapabilities().
Tokens resip::InviteSession::mPeerSupportedMethods [protected] |
Definition at line 341 of file InviteSession.hxx.
Referenced by getPeerSupportedMethods(), storePeerCapabilities(), and updateMethodSupported().
Mimes resip::InviteSession::mPeerSupportedMimeTypes [protected] |
Definition at line 343 of file InviteSession.hxx.
Referenced by getPeerSupportedMimeTypes(), and storePeerCapabilities().
Tokens resip::InviteSession::mPeerSupportedOptionTags [protected] |
Definition at line 342 of file InviteSession.hxx.
Referenced by getPeerSupportedOptionTags(), and storePeerCapabilities().
Data resip::InviteSession::mPeerUserAgent [protected] |
Definition at line 347 of file InviteSession.hxx.
Referenced by getPeerUserAgent(), and storePeerCapabilities().
Definition at line 397 of file InviteSession.hxx.
Referenced by resip::ClientInviteSession::ClientInviteSession(), dispatch(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), provideProposedOffer(), resip::ServerInviteSession::sendProvisional(), and resip::ServerInviteSession::sendUpdate().
std::auto_ptr<Contents> resip::InviteSession::mProposedLocalOfferAnswer [protected] |
Definition at line 357 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::accept(), resip::ClientInviteSession::ClientInviteSession(), dispatch(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchQueuedUpdate(), dispatchReceivedReinviteSentOffer(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchWaitingToOffer(), dispatchWaitingToOffer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), provideProposedOffer(), resip::ServerInviteSession::sendProvisional(), sessionRefresh(), setCurrentLocalOfferAnswer(), and toEvent().
std::auto_ptr<Contents> resip::InviteSession::mProposedRemoteOfferAnswer [protected] |
Definition at line 360 of file InviteSession.hxx.
Referenced by dispatchConnected(), resip::ClientInviteSession::dispatchEarly(), resip::ClientInviteSession::dispatchEarlyWithAnswer(), dispatchSentReinviteNoOffer(), resip::ClientInviteSession::dispatchStart(), resip::ServerInviteSession::dispatchStart(), getProposedRemoteOfferAnswer(), getProposedRemoteSdp(), resip::ClientInviteSession::handleOffer(), hasProposedRemoteOfferAnswer(), hasProposedRemoteSdp(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), and provideOffer().
bool resip::InviteSession::mReferSub [protected] |
Definition at line 393 of file InviteSession.hxx.
Referenced by resip::Dialog::dispatch(), nitComplete(), and refer().
NitState resip::InviteSession::mServerNitState [protected] |
Definition at line 354 of file InviteSession.hxx.
Referenced by acceptNIT(), dispatchBye(), dispatchInfo(), dispatchMessage(), and rejectNIT().
UInt32 resip::InviteSession::mSessionInterval [protected] |
Definition at line 374 of file InviteSession.hxx.
Referenced by dispatchSentReinvite(), dispatchSentReinviteNoOffer(), dispatchSentUpdate(), handleSessionTimerRequest(), handleSessionTimerResponse(), setSessionTimerHeaders(), setSessionTimerPreferences(), and startSessionTimer().
bool resip::InviteSession::mSessionRefresher [protected] |
Definition at line 376 of file InviteSession.hxx.
Referenced by handleSessionTimerRequest(), handleSessionTimerResponse(), setSessionTimerHeaders(), setSessionTimerPreferences(), and startSessionTimer().
bool resip::InviteSession::mSessionRefreshReInvite [protected] |
Definition at line 378 of file InviteSession.hxx.
Referenced by dispatchSentReinvite(), and sessionRefresh().
unsigned int resip::InviteSession::mSessionTimerSeq [protected] |
Definition at line 377 of file InviteSession.hxx.
Referenced by dispatch(), and startSessionTimer().
unsigned int resip::InviteSession::mStaleReInviteTimerSeq [protected] |
Definition at line 371 of file InviteSession.hxx.
Referenced by dispatch(), dispatchSentReinvite(), dispatchSentReinviteNoOffer(), and startStaleReInviteTimer().
State resip::InviteSession::mState [protected] |
Definition at line 352 of file InviteSession.hxx.
Referenced by resip::ServerInviteSession::accept(), resip::ClientInviteSession::cancel(), resip::ClientInviteSession::ClientInviteSession(), resip::ClientInviteSession::dispatch(), resip::ServerInviteSession::dispatch(), dispatch(), dispatchOthers(), dump(), resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), end(), isAccepted(), isConnected(), isEarly(), isTerminated(), resip::ClientInviteSession::onForkAccepted(), resip::ClientInviteSession::provideAnswer(), provideAnswer(), resip::ServerInviteSession::provideAnswer(), resip::ClientInviteSession::provideOffer(), provideOffer(), resip::ServerInviteSession::provideOffer(), resip::ServerInviteSession::provisional(), resip::ServerInviteSession::redirect(), resip::ClientInviteSession::reject(), resip::ServerInviteSession::reject(), reject(), resip::ServerInviteSession::requestOffer(), requestOffer(), resip::ServerInviteSession::sendProvisional(), resip::ClientInviteSession::sendSipFrag(), resip::ServerInviteSession::ServerInviteSession(), resip::ClientInviteSession::startCancelTimer(), resip::ClientInviteSession::startStaleCallTimer(), startStaleReInviteTimer(), and transition().
Data resip::InviteSession::mUserEndReason [protected] |
Definition at line 402 of file InviteSession.hxx.
Referenced by resip::ClientInviteSession::end(), resip::ServerInviteSession::end(), and end().
1.7.5.1