|
reSIProcate/DialogUsageManager
9694
|
#include <ServerInviteSession.hxx>


Public Types | |
| typedef Handle < ServerInviteSession > | ServerInviteSessionHandle |
Public Member Functions | |
| ServerInviteSessionHandle | getHandle () |
| void | redirect (const NameAddrs &contacts, int code=302) |
| send a 3xx | |
| void | provisional (int code=180, bool earlyFlag=true) |
| send a 1xx - provisional response. | |
| virtual void | provideOffer (const Contents &offer) |
| Called to set the offer that will be used in the next message that sends an offer. | |
| virtual void | provideOffer (const Contents &offer, DialogUsageManager::EncryptionLevel level, const Contents *alternative) |
| virtual void | requestOffer () |
| Called to request that the far end provide an offer. | |
| virtual void | provideAnswer (const Contents &answer) |
| Similar to provideOffer - called to set the answer to be signalled to the peer. | |
| virtual void | end (const Data &userReason) |
| Makes the specific dialog end. | |
| virtual void | end (EndReason reason) |
| virtual void | end () |
| virtual void | reject (int statusCode, WarningCategory *warning=0) |
| Rejects an offer at the SIP level. | |
| void | accept (int statusCode=200) |
| accept an initial invite (2xx) - this is only applicable to the UAS | |
| void | redirectCommand (const NameAddrs &contacts, int code=302) |
| Provide asynchronous method access by using command. | |
| void | provisionalCommand (int code=180) |
| void | acceptCommand (int statusCode=200) |
Private Member Functions | |
| virtual void | dispatch (const SipMessage &msg) |
| virtual void | dispatch (const DumTimeout &timer) |
| void | dispatchStart (const SipMessage &msg) |
| void | dispatchOfferOrEarly (const SipMessage &msg) |
| void | dispatchAccepted (const SipMessage &msg) |
| void | dispatchWaitingToOffer (const SipMessage &msg) |
| void | dispatchWaitingToRequestOffer (const SipMessage &msg) |
| void | dispatchAcceptedWaitingAnswer (const SipMessage &msg) |
| void | dispatchOfferReliable (const SipMessage &msg) |
| void | dispatchNoOfferReliable (const SipMessage &msg) |
| void | dispatchFirstSentOfferReliable (const SipMessage &msg) |
| void | dispatchFirstEarlyReliable (const SipMessage &msg) |
| void | dispatchEarlyReliable (const SipMessage &msg) |
| void | dispatchSentUpdate (const SipMessage &msg) |
| void | dispatchSentUpdateAccepted (const SipMessage &msg) |
| void | dispatchReceivedUpdate (const SipMessage &msg) |
| void | dispatchReceivedUpdateWaitingAnswer (const SipMessage &msg) |
| void | dispatchWaitingToTerminate (const SipMessage &msg) |
| void | dispatchWaitingToHangup (const SipMessage &msg) |
| void | dispatchCancel (const SipMessage &msg) |
| void | dispatchBye (const SipMessage &msg) |
| void | dispatchUnknown (const SipMessage &msg) |
| void | startRetransmit1xxTimer () |
| void | sendAccept (int code, Contents *offerAnswer) |
| void | sendProvisional (int code, bool earlyFlag) |
| void | sendUpdate (const Contents &offerAnswer) |
| ServerInviteSession (DialogUsageManager &dum, Dialog &dialog, const SipMessage &msg) | |
| ServerInviteSession (const ServerInviteSession &) | |
| ServerInviteSession & | operator= (const ServerInviteSession &) |
Private Attributes | |
| const SipMessage | mFirstRequest |
| SharedPtr< SipMessage > | m1xx |
| unsigned long | mCurrentRetransmit1xx |
Friends | |
| class | Dialog |
Definition at line 12 of file ServerInviteSession.hxx.
Definition at line 15 of file ServerInviteSession.hxx.
| ServerInviteSession::ServerInviteSession | ( | DialogUsageManager & | dum, |
| Dialog & | dialog, | ||
| const SipMessage & | msg | ||
| ) | [private] |
Definition at line 21 of file ServerInviteSession.cxx.
References resip::SipMessage::isRequest(), resip::InviteSession::mState, and resip::InviteSession::UAS_Start.
: InviteSession(dum, dialog), mFirstRequest(request), m1xx(new SipMessage), mCurrentRetransmit1xx(0) { assert(request.isRequest()); mState = UAS_Start; }

| resip::ServerInviteSession::ServerInviteSession | ( | const ServerInviteSession & | ) | [private] |
| void ServerInviteSession::accept | ( | int | statusCode = 200 | ) |
accept an initial invite (2xx) - this is only applicable to the UAS
Definition at line 518 of file ServerInviteSession.cxx.
References resip::InviteSession::Connected, resip::InviteSession::getSessionHandle(), resip::InviteSession::handleSessionTimerRequest(), InfoLog, resip::Dialog::makeResponse(), resip::InviteSession::mCurrentLocalOfferAnswer, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mFirstRequest, resip::InviteSession::mInvite200, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mProposedLocalOfferAnswer, resip::InviteSession::mState, resip::InviteSessionHandler::onConnected(), sendAccept(), resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_AcceptedWaitingAnswer, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
Referenced by resip::BasicClientCall::onOffer(), and resip::UserAgent::onOffer().
{
InfoLog (<< toData(mState) << ": accept(" << code << ")");
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
switch (mState)
{
case UAS_Offer:
case UAS_EarlyOffer:
assert(0);
break;
case UAS_OfferProvidedAnswer:
case UAS_EarlyProvidedAnswer:
transition(UAS_Accepted);
sendAccept(code, mCurrentLocalOfferAnswer.get());
handler->onConnected(getSessionHandle(), *mInvite200);
break;
case UAS_NoOffer:
case UAS_EarlyNoOffer:
assert(0);
break;
case UAS_ProvidedOffer:
case UAS_EarlyProvidedOffer:
transition(UAS_AcceptedWaitingAnswer);
sendAccept(code, mProposedLocalOfferAnswer.get());
break;
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
assert(0); // Already Accepted
break;
case UAS_FirstSentAnswerReliable:
// queue 2xx
// waiting for PRACK
transition(UAS_Accepted);
mDialog.makeResponse(*mInvite200, mFirstRequest, code);
handleSessionTimerRequest(*mInvite200, mFirstRequest);
break;
case UAS_NegotiatedReliable:
transition(Connected);
sendAccept(code, 0);
handler->onConnected(getSessionHandle(), *mInvite200);
break;
case UAS_SentUpdate:
transition(UAS_SentUpdateAccepted);
sendAccept(code, 0);
break;
case UAS_ReceivedUpdate:
transition(UAS_ReceivedUpdateWaitingAnswer);
mDialog.makeResponse(*mInvite200, mFirstRequest, code);// queue 2xx
handleSessionTimerRequest(*mInvite200, mFirstRequest);
break;
case UAS_FirstSentOfferReliable:
case UAS_NoOfferReliable:
case UAS_ReceivedOfferReliable:
case UAS_ReceivedUpdateWaitingAnswer:
case UAS_SentUpdateAccepted:
case UAS_Start:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
default:
assert(0);
break;
}
}

| void ServerInviteSession::acceptCommand | ( | int | statusCode = 200 | ) |
Definition at line 616 of file ServerInviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new ServerInviteSessionAcceptCommand(*this, statusCode));
}

| void ServerInviteSession::dispatch | ( | const SipMessage & | msg | ) | [private, virtual] |
Reimplemented from resip::InviteSession.
Definition at line 622 of file ServerInviteSession.cxx.
References dispatchAccepted(), dispatchAcceptedWaitingAnswer(), dispatchEarlyReliable(), dispatchFirstEarlyReliable(), dispatchFirstSentOfferReliable(), resip::InviteSession::dispatchInfo(), resip::InviteSession::dispatchMessage(), dispatchNoOfferReliable(), dispatchOfferOrEarly(), dispatchOfferReliable(), dispatchReceivedUpdate(), dispatchReceivedUpdateWaitingAnswer(), dispatchSentUpdate(), dispatchSentUpdateAccepted(), dispatchStart(), dispatchWaitingToHangup(), dispatchWaitingToOffer(), dispatchWaitingToRequestOffer(), dispatchWaitingToTerminate(), h_RequestLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::RequestLine::method(), resip::InviteSession::mState, resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_AcceptedWaitingAnswer, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
Referenced by dispatch().
{
if (msg.isRequest())
{
if (msg.header(h_RequestLine).method() == INFO)
{
InviteSession::dispatchInfo(msg);
return;
}
if (msg.header(h_RequestLine).method() == MESSAGE)
{
InviteSession::dispatchMessage(msg);
return;
}
}
switch (mState)
{
case UAS_Start:
dispatchStart(msg);
break;
case UAS_Offer:
case UAS_EarlyOffer:
case UAS_EarlyProvidedAnswer:
case UAS_NoOffer:
case UAS_ProvidedOffer:
case UAS_EarlyNoOffer:
case UAS_EarlyProvidedOffer:
case UAS_OfferProvidedAnswer:
dispatchOfferOrEarly(msg);
break;
case UAS_Accepted:
dispatchAccepted(msg);
break;
case UAS_WaitingToOffer:
dispatchWaitingToOffer(msg);
break;
case UAS_WaitingToRequestOffer:
dispatchWaitingToRequestOffer(msg);
break;
case UAS_AcceptedWaitingAnswer:
dispatchAcceptedWaitingAnswer(msg);
break;
case UAS_NegotiatedReliable:
dispatchEarlyReliable(msg);
break;
case UAS_FirstSentAnswerReliable:
dispatchFirstEarlyReliable(msg);
break;
case UAS_FirstSentOfferReliable:
dispatchFirstSentOfferReliable(msg);
break;
case UAS_NoOfferReliable:
dispatchNoOfferReliable(msg);
break;
case UAS_ReceivedOfferReliable:
dispatchOfferReliable(msg);
break;
case UAS_ReceivedUpdate:
dispatchReceivedUpdate(msg);
break;
case UAS_ReceivedUpdateWaitingAnswer:
dispatchReceivedUpdateWaitingAnswer(msg);
break;
case UAS_SentUpdate:
dispatchSentUpdate(msg);
break;
case UAS_WaitingToHangup:
dispatchWaitingToHangup(msg);
break;
case UAS_WaitingToTerminate:
dispatchWaitingToTerminate(msg);
break;
case UAS_SentUpdateAccepted:
dispatchSentUpdateAccepted(msg);
break;
default:
InviteSession::dispatch(msg);
break;
}
}

| void ServerInviteSession::dispatch | ( | const DumTimeout & | timer | ) | [private, virtual] |
Reimplemented from resip::InviteSession.
Definition at line 706 of file ServerInviteSession.cxx.
References dispatch(), m1xx, mCurrentRetransmit1xx, resip::DumTimeout::Retransmit1xx, resip::DialogUsage::send(), resip::DumTimeout::seq(), startRetransmit1xxTimer(), and resip::DumTimeout::type().
{
if (timeout.type() == DumTimeout::Retransmit1xx)
{
if (mCurrentRetransmit1xx && m1xx->header(h_CSeq).sequence() == timeout.seq()) // If timer isn't stopped and this timer is for last 1xx sent, then resend
{
send(m1xx);
startRetransmit1xxTimer();
}
}
else
{
InviteSession::dispatch(timeout);
}
}

| void ServerInviteSession::dispatchAccepted | ( | const SipMessage & | msg | ) | [private] |
Definition at line 806 of file ServerInviteSession.cxx.
References resip::Message::brief(), resip::InviteSession::Connected, resip::DialogUsageManager::destroy(), dispatchUnknown(), resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::InviteSession::mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::OnAck, resip::InviteSession::OnAckAnswer, resip::InviteSession::OnBye, resip::InviteSession::OnCancel, resip::InviteSessionHandler::onConnectedConfirmed(), resip::InviteSession::OnInvite, resip::InviteSession::OnInviteOffer, resip::InviteSession::OnInviteReliable, resip::InviteSession::OnInviteReliableOffer, resip::InviteSessionHandler::onTerminated(), resip::InviteSession::OnUpdate, resip::InviteSession::OnUpdateOffer, resip::InviteSessionHandler::RemoteBye, resip::DialogUsage::send(), resip::InviteSession::Terminated, resip::InviteSession::toEvent(), and resip::InviteSession::transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchAccepted: " << msg.brief());
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 OnAck:
case OnAckAnswer: // .bwc. unsolicited body in ACK; it would probably make sense to just ignore.
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
transition(Connected);
handler->onConnectedConfirmed(getSessionHandle(), msg);
break;
}
case OnCancel:
{
// Cancel and 200 crossed
SharedPtr<SipMessage> c200(new SipMessage);
mDialog.makeResponse(*c200, msg, 200);
send(c200);
break;
}
case OnBye:
{
SharedPtr<SipMessage> b200(new SipMessage);
mDialog.makeResponse(*b200, msg, 200);
send(b200);
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteBye, &msg);
mDum.destroy(this);
break;
}
default:
if(msg.isRequest())
{
dispatchUnknown(msg);
}
break;
}
}

| void ServerInviteSession::dispatchAcceptedWaitingAnswer | ( | const SipMessage & | msg | ) | [private] |
Definition at line 1005 of file ServerInviteSession.cxx.
References resip::InviteSession::Connected, dispatchUnknown(), resip::InviteSessionHandler::Error, resip::InviteSession::getEncryptionLevel(), resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), resip::InviteSession::IllegalNegotiation, resip::SipMessage::isRequest(), resip::InviteSession::isTerminated(), resip::InviteSession::makeOfferAnswer(), resip::Dialog::makeResponse(), resip::InviteSession::mCurrentEncryptionLevel, resip::InviteSession::mCurrentRemoteOfferAnswer, resip::InviteSession::mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::InviteSession::mEndReason, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::OnAck, resip::InviteSession::OnAckAnswer, resip::InviteSessionHandler::onAnswer(), resip::InviteSession::OnCancel, resip::InviteSessionHandler::onConnected(), resip::InviteSession::OnInvite, resip::InviteSession::OnInviteOffer, resip::InviteSession::OnInviteReliable, resip::InviteSession::OnInviteReliableOffer, resip::InviteSession::OnPrack, resip::InviteSessionHandler::onTerminated(), resip::InviteSession::OnUpdate, resip::InviteSession::OnUpdateOffer, resip::DialogUsage::send(), sendAccept(), resip::InviteSession::sendBye(), resip::InviteSession::setCurrentLocalOfferAnswer(), resip::InviteSession::Terminated, resip::InviteSession::toEvent(), and resip::InviteSession::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:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
transition(Connected);
setCurrentLocalOfferAnswer(msg);
mCurrentEncryptionLevel = getEncryptionLevel(msg);
mCurrentRemoteOfferAnswer = InviteSession::makeOfferAnswer(*offerAnswer);
handler->onAnswer(getSessionHandle(), msg, *offerAnswer);
if(!isTerminated()) // onAnswer callback may call end() or reject()
{
handler->onConnected(getSessionHandle(), msg);
}
break;
}
case OnAck:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
mEndReason = IllegalNegotiation;
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
}
case OnCancel:
{
// no transition
SharedPtr<SipMessage> c200(new SipMessage);
mDialog.makeResponse(*c200, msg, 200);
send(c200);
break;
}
case OnPrack: // broken
{
// no transition
SharedPtr<SipMessage> p200(new SipMessage);
mDialog.makeResponse(*p200, msg, 200);
send(p200);
sendAccept(200, 0);
break;
}
default:
if(msg.isRequest())
{
dispatchUnknown(msg);
}
break;
}
}

| void ServerInviteSession::dispatchBye | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 1178 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::destroy(), resip::InviteSession::getSessionHandle(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mFirstRequest, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::RemoteBye, resip::DialogUsage::send(), resip::InviteSession::Terminated, and resip::InviteSession::transition().
Referenced by dispatchOfferOrEarly().
{
SharedPtr<SipMessage> b200(new SipMessage);
mDialog.makeResponse(*b200, msg, 200);
send(b200);
// !dcm! -- pretty sure we shouldn't 487 after the BYE/200
SharedPtr<SipMessage> i487(new SipMessage);
mDialog.makeResponse(*i487, mFirstRequest, 487);
send(i487);
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteBye, &msg);
mDum.destroy(this);
}

| void ServerInviteSession::dispatchCancel | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 1156 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::destroy(), resip::InviteSession::getSessionHandle(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, mFirstRequest, resip::DialogUsageManager::mInviteSessionHandler, resip::DialogEventStateManager::onTerminated(), resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::RemoteCancel, resip::DialogUsage::send(), resip::InviteSession::Terminated, and resip::InviteSession::transition().
Referenced by dispatchOfferOrEarly().
{
SharedPtr<SipMessage> c200(new SipMessage);
mDialog.makeResponse(*c200, msg, 200);
send(c200);
SharedPtr<SipMessage> i487(new SipMessage);
mDialog.makeResponse(*i487, mFirstRequest, 487);
send(i487);
transition(Terminated);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onTerminated(mDialog, msg, InviteSessionHandler::RemoteCancel);
}
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteCancel, &msg);
mDum.destroy(this);
}

| void ServerInviteSession::dispatchEarlyReliable | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchFirstEarlyReliable | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchFirstSentOfferReliable | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchNoOfferReliable | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchOfferOrEarly | ( | const SipMessage & | msg | ) | [private] |
Definition at line 787 of file ServerInviteSession.cxx.
References dispatchBye(), dispatchCancel(), dispatchUnknown(), resip::InviteSession::getOfferAnswer(), resip::SipMessage::isRequest(), resip::InviteSession::OnBye, resip::InviteSession::OnCancel, and resip::InviteSession::toEvent().
Referenced by dispatch().
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnCancel:
dispatchCancel(msg);
break;
case OnBye:
dispatchBye(msg);
break;
default:
assert(msg.isRequest());
dispatchUnknown(msg);
break;
}
}

| void ServerInviteSession::dispatchOfferReliable | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchReceivedUpdate | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchReceivedUpdateWaitingAnswer | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchSentUpdate | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 1107 of file ServerInviteSession.cxx.
Referenced by dispatch().
{
}
| void ServerInviteSession::dispatchSentUpdateAccepted | ( | const SipMessage & | msg | ) | [private] |
| void ServerInviteSession::dispatchStart | ( | const SipMessage & | msg | ) | [private] |
Definition at line 723 of file ServerInviteSession.cxx.
References resip::InviteSession::getEncryptionLevel(), getHandle(), resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::InviteSession::isTerminated(), resip::InviteSession::makeOfferAnswer(), resip::InviteSession::mCurrentEncryptionLevel, resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, resip::RequestLine::method(), resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mLastRemoteSessionModification, resip::InviteSession::mProposedRemoteOfferAnswer, resip::InviteSession::None, resip::InviteSession::Offer, resip::InviteSession::OnInvite, resip::InviteSession::OnInviteOffer, resip::InviteSession::OnInviteReliable, resip::InviteSession::OnInviteReliableOffer, resip::DialogEventStateManager::onTryingUas(), resip::InviteSession::storePeerCapabilities(), resip::InviteSession::toEvent(), resip::InviteSession::transition(), resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, and resip::InviteSession::UAS_ReceivedOfferReliable.
Referenced by dispatch().
{
assert(msg.isRequest());
assert(msg.header(h_CSeq).method() == INVITE);
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
storePeerCapabilities(msg);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onTryingUas(mDialog, msg);
}
switch (toEvent(msg, offerAnswer.get()))
{
case OnInviteOffer:
*mLastRemoteSessionModification = msg;
transition(UAS_Offer);
mProposedRemoteOfferAnswer = InviteSession::makeOfferAnswer(*offerAnswer);
mCurrentEncryptionLevel = getEncryptionLevel(msg);
handler->onNewSession(getHandle(), InviteSession::Offer, msg);
if(!isTerminated())
{
handler->onOffer(getSessionHandle(), msg, *offerAnswer);
}
break;
case OnInvite:
*mLastRemoteSessionModification = msg;
transition(UAS_NoOffer);
handler->onNewSession(getHandle(), InviteSession::None, msg);
if(!isTerminated())
{
handler->onOfferRequired(getSessionHandle(), msg);
}
break;
case OnInviteReliableOffer:
*mLastRemoteSessionModification = msg;
transition(UAS_ReceivedOfferReliable);
mProposedRemoteOfferAnswer = InviteSession::makeOfferAnswer(*offerAnswer);
mCurrentEncryptionLevel = getEncryptionLevel(msg);
handler->onNewSession(getHandle(), InviteSession::Offer, msg);
if(!isTerminated())
{
handler->onOffer(getSessionHandle(), msg, *offerAnswer);
}
break;
case OnInviteReliable:
*mLastRemoteSessionModification = msg;
transition(UAS_NoOfferReliable);
handler->onNewSession(getHandle(), InviteSession::None, msg);
if(!isTerminated())
{
handler->onOfferRequired(getSessionHandle(), msg);
}
break;
default:
assert(0);
break;
}
}

| void ServerInviteSession::dispatchUnknown | ( | const SipMessage & | msg | ) | [private] |
Definition at line 1195 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::destroy(), resip::InviteSessionHandler::Error, resip::InviteSession::getSessionHandle(), resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mFirstRequest, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSessionHandler::onTerminated(), resip::DialogUsage::send(), resip::InviteSession::Terminated, and resip::InviteSession::transition().
Referenced by dispatchAccepted(), dispatchAcceptedWaitingAnswer(), dispatchOfferOrEarly(), dispatchWaitingToOffer(), and dispatchWaitingToRequestOffer().
{
SharedPtr<SipMessage> r481(new SipMessage); // !jf! what should we send here?
mDialog.makeResponse(*r481, msg, 481);
send(r481);
SharedPtr<SipMessage> i400(new SipMessage);
mDialog.makeResponse(*i400, mFirstRequest, 400);
send(i400);
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
mDum.destroy(this);
}

| void ServerInviteSession::dispatchWaitingToHangup | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 1132 of file ServerInviteSession.cxx.
References resip::SharedPtr< T >::get(), resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), resip::InviteSessionHandler::LocalBye, resip::InviteSession::mCurrentRetransmit200, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::OnAck, resip::InviteSession::OnAckAnswer, resip::InviteSession::OnPrack, resip::InviteSessionHandler::onTerminated(), resip::InviteSession::sendBye(), resip::InviteSession::Terminated, resip::InviteSession::toEvent(), and resip::InviteSession::transition().
Referenced by dispatch().
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnPrack:
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 ServerInviteSession::dispatchWaitingToOffer | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 868 of file ServerInviteSession.cxx.
References resip::Message::brief(), resip::DialogUsageManager::destroy(), dispatchUnknown(), resip::InviteSessionHandler::Error, resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::InviteSession::mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mProposedLocalOfferAnswer, resip::InviteSession::OnAck, resip::InviteSession::OnAckAnswer, resip::InviteSession::OnBye, resip::InviteSession::OnCancel, resip::InviteSession::OnInvite, resip::InviteSession::OnInviteOffer, resip::InviteSession::OnInviteReliable, resip::InviteSession::OnInviteReliableOffer, resip::InviteSessionHandler::onTerminated(), resip::InviteSession::OnUpdate, resip::InviteSession::OnUpdateOffer, resip::InviteSession::provideProposedOffer(), resip::InviteSessionHandler::RemoteBye, resip::DialogUsage::send(), resip::InviteSession::sendBye(), resip::InviteSession::Terminated, resip::InviteSession::toEvent(), and resip::InviteSession::transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchWaitingToOffer: " << msg.brief());
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 OnAck:
{
assert(mProposedLocalOfferAnswer.get());
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
provideProposedOffer();
break;
}
case OnAckAnswer:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
}
case OnCancel:
{
// Cancel and 200 crossed
SharedPtr<SipMessage> c200(new SipMessage);
mDialog.makeResponse(*c200, msg, 200);
send(c200);
break;
}
case OnBye:
{
SharedPtr<SipMessage> b200(new SipMessage);
mDialog.makeResponse(*b200, msg, 200);
send(b200);
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteBye, &msg);
mDum.destroy(this);
break;
}
default:
if(msg.isRequest())
{
dispatchUnknown(msg);
}
break;
}
}

| void ServerInviteSession::dispatchWaitingToRequestOffer | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 937 of file ServerInviteSession.cxx.
References resip::Message::brief(), resip::DialogUsageManager::destroy(), dispatchUnknown(), resip::InviteSessionHandler::Error, resip::InviteSession::getOfferAnswer(), resip::InviteSession::getSessionHandle(), InfoLog, resip::SipMessage::isRequest(), resip::Dialog::makeResponse(), resip::InviteSession::mCurrentRetransmit200, resip::DialogUsage::mDialog, resip::BaseUsage::mDum, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::OnAck, resip::InviteSession::OnAckAnswer, resip::InviteSession::OnBye, resip::InviteSession::OnCancel, resip::InviteSession::OnInvite, resip::InviteSession::OnInviteOffer, resip::InviteSession::OnInviteReliable, resip::InviteSession::OnInviteReliableOffer, resip::InviteSessionHandler::onTerminated(), resip::InviteSession::OnUpdate, resip::InviteSession::OnUpdateOffer, resip::InviteSessionHandler::RemoteBye, requestOffer(), resip::DialogUsage::send(), resip::InviteSession::sendBye(), resip::InviteSession::Terminated, resip::InviteSession::toEvent(), and resip::InviteSession::transition().
Referenced by dispatch().
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchWaitingToRequestOffer: " << msg.brief());
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 OnAck:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
requestOffer();
break;
}
case OnAckAnswer:
{
mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
sendBye();
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::Error, &msg);
break;
}
case OnCancel:
{
// Cancel and 200 crossed
SharedPtr<SipMessage> c200(new SipMessage);
mDialog.makeResponse(*c200, msg, 200);
send(c200);
break;
}
case OnBye:
{
SharedPtr<SipMessage> b200(new SipMessage);
mDialog.makeResponse(*b200, msg, 200);
send(b200);
transition(Terminated);
handler->onTerminated(getSessionHandle(), InviteSessionHandler::RemoteBye, &msg);
mDum.destroy(this);
break;
}
default:
if(msg.isRequest())
{
dispatchUnknown(msg);
}
break;
}
}

| void ServerInviteSession::dispatchWaitingToTerminate | ( | const SipMessage & | msg | ) | [private] |
Reimplemented from resip::InviteSession.
Definition at line 1127 of file ServerInviteSession.cxx.
Referenced by dispatch().
{
}
| void ServerInviteSession::end | ( | const Data & | userReason | ) | [virtual] |
Makes the specific dialog end.
Will send a 480.
Reimplemented from resip::InviteSession.
Definition at line 387 of file ServerInviteSession.cxx.
References end(), resip::InviteSession::mUserEndReason, and resip::InviteSession::UserSpecified.
{
mUserEndReason = userReason;
end(InviteSession::UserSpecified);
}

| void ServerInviteSession::end | ( | EndReason | reason | ) | [virtual] |
Reimplemented from resip::InviteSession.
Definition at line 394 of file ServerInviteSession.cxx.
References end(), resip::SharedPtr< T >::get(), resip::InviteSession::getSessionHandle(), InfoLog, resip::InviteSessionHandler::LocalBye, resip::InviteSession::mCurrentRetransmit200, resip::BaseUsage::mDum, resip::InviteSession::mEndReason, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mState, resip::InviteSession::NotSpecified, resip::InviteSessionHandler::onTerminated(), reject(), resip::InviteSession::sendBye(), resip::InviteSession::Terminated, resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_AcceptedWaitingAnswer, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
{
InfoLog (<< toData(mState) << ": end");
if (mEndReason == NotSpecified)
{
mEndReason = reason;
}
switch (mState)
{
case UAS_EarlyNoOffer:
case UAS_EarlyOffer:
case UAS_EarlyProvidedAnswer:
case UAS_EarlyProvidedOffer:
case UAS_NoOffer:
case UAS_Offer:
case UAS_OfferProvidedAnswer:
case UAS_ProvidedOffer:
reject(480);
break;
case UAS_ReceivedOfferReliable:
case UAS_NegotiatedReliable:
case UAS_FirstSentOfferReliable:
case UAS_FirstSentAnswerReliable:
case UAS_NoOfferReliable:
case UAS_ReceivedUpdate: // !slg! todo: send 488U
case UAS_ReceivedUpdateWaitingAnswer: // !slg! todo: send 488U
case UAS_SentUpdate:
case UAS_WaitingToTerminate:
reject(480);
break;
case UAS_Start:
assert(0);
break;
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
case UAS_SentUpdateAccepted:
case UAS_AcceptedWaitingAnswer:
if(mCurrentRetransmit200) // If retransmit200 timer is active then ACK is not received yet - wait for it
{
transition(UAS_WaitingToHangup);
}
else
{
// ACK has likely timedout - hangup immediately
SharedPtr<SipMessage> msg = sendBye();
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::LocalBye, msg.get());
}
break;
case UAS_WaitingToHangup: // This can happen if we are waiting for an ACK to hangup and the ACK timesout
break;
default:
InviteSession::end(reason);
break;
}
}

| void ServerInviteSession::end | ( | ) | [virtual] |
Reimplemented from resip::InviteSession.
Definition at line 381 of file ServerInviteSession.cxx.
References resip::InviteSession::NotSpecified.
Referenced by end().
{
end(NotSpecified);
}
| ServerInviteSessionHandle ServerInviteSession::getHandle | ( | ) |
Definition at line 32 of file ServerInviteSession.cxx.
References resip::BaseUsage::getBaseHandle(), and resip::BaseUsage::mDum.
Referenced by dispatchStart().
{
return ServerInviteSessionHandle(mDum, getBaseHandle().getId());
}

| ServerInviteSession& resip::ServerInviteSession::operator= | ( | const ServerInviteSession & | ) | [private] |
| void ServerInviteSession::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 from resip::InviteSession.
Definition at line 318 of file ServerInviteSession.cxx.
References resip::InviteSession::Connected, resip::InviteSession::getSessionHandle(), InfoLog, resip::InviteSession::makeOfferAnswer(), resip::InviteSession::mCurrentLocalOfferAnswer, resip::InviteSession::mCurrentRemoteOfferAnswer, resip::BaseUsage::mDum, resip::InviteSession::mInvite200, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mProposedRemoteOfferAnswer, resip::InviteSession::mState, resip::InviteSessionHandler::onConnected(), resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_AcceptedWaitingAnswer, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
InfoLog (<< toData(mState) << ": provideAnswer");
switch (mState)
{
case UAS_Offer:
transition(UAS_OfferProvidedAnswer);
mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer;
mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer);
break;
case UAS_EarlyOffer:
transition(UAS_EarlyProvidedAnswer);
mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer;
mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer);
break;
case UAS_ReceivedOfferReliable:
// send1XX-answer, timer::1xx
transition(UAS_FirstSentAnswerReliable);
break;
case UAS_ReceivedUpdate:
// send::200U-answer
transition(UAS_NegotiatedReliable);
break;
case UAS_ReceivedUpdateWaitingAnswer:
// send::2XXU-answer
// send::2XXI
transition(Connected);
handler->onConnected(getSessionHandle(), *mInvite200);
break;
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
case UAS_EarlyNoOffer:
case UAS_EarlyProvidedAnswer:
case UAS_EarlyProvidedOffer:
case UAS_NegotiatedReliable:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_NoOffer:
case UAS_NoOfferReliable:
case UAS_OfferProvidedAnswer:
case UAS_ProvidedOffer:
case UAS_SentUpdate:
case UAS_SentUpdateAccepted:
case UAS_Start:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
case UAS_AcceptedWaitingAnswer:
assert(0);
break;
default:
InviteSession::provideAnswer(answer);
break;
}
}

| void ServerInviteSession::provideOffer | ( | const Contents & | offer | ) | [virtual] |
Called to set the offer that will be used in the next message that sends an offer.
If possible, this will synchronously send the appropriate request or response. In some cases, the UAS might have to call accept in order to cause the message to be sent.
Reimplemented from resip::InviteSession.
Definition at line 290 of file ServerInviteSession.cxx.
References resip::InviteSession::mCurrentEncryptionLevel.
Referenced by provideOffer().
{
this->provideOffer(offer, mCurrentEncryptionLevel, 0);
}
| void ServerInviteSession::provideOffer | ( | const Contents & | offer, |
| DialogUsageManager::EncryptionLevel | level, | ||
| const Contents * | alternative | ||
| ) | [virtual] |
Reimplemented from resip::InviteSession.
Definition at line 219 of file ServerInviteSession.cxx.
References InfoLog, resip::InviteSession::makeOfferAnswer(), resip::InviteSession::mProposedEncryptionLevel, resip::InviteSession::mProposedLocalOfferAnswer, resip::InviteSession::mState, provideOffer(), sendUpdate(), resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_AcceptedWaitingAnswer, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
{
InfoLog (<< toData(mState) << ": provideOffer");
switch (mState)
{
case UAS_NoOffer:
transition(UAS_ProvidedOffer);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
mProposedEncryptionLevel = level;
break;
case UAS_EarlyNoOffer:
transition(UAS_EarlyProvidedOffer);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
mProposedEncryptionLevel = level;
break;
case UAS_NoOfferReliable:
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
mProposedEncryptionLevel = level;
// !jf! transition ?
break;
case UAS_NegotiatedReliable:
// queue offer
transition(UAS_SentUpdate);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer, alternative);
mProposedEncryptionLevel = level;
sendUpdate(offer);
break;
case UAS_Accepted:
// queue the offer to be sent after the ACK is received
transition(UAS_WaitingToOffer);
mProposedLocalOfferAnswer = InviteSession::makeOfferAnswer(offer);
mProposedEncryptionLevel = level;
break;
case UAS_WaitingToOffer:
InviteSession::provideOffer(offer, level, alternative);
break;
case UAS_EarlyProvidedAnswer:
case UAS_EarlyProvidedOffer:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_Offer:
case UAS_EarlyOffer:
case UAS_ReceivedOfferReliable:
case UAS_OfferProvidedAnswer:
case UAS_ProvidedOffer:
case UAS_ReceivedUpdate:
case UAS_ReceivedUpdateWaitingAnswer:
case UAS_SentUpdate:
case UAS_SentUpdateAccepted:
case UAS_Start:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
case UAS_WaitingToRequestOffer:
case UAS_AcceptedWaitingAnswer:
assert(0);
break;
default:
InviteSession::provideOffer(offer, level, alternative);
break;
}
}

| void ServerInviteSession::provisional | ( | int | code = 180, |
| bool | earlyFlag = true |
||
| ) |
send a 1xx - provisional response.
If you set earlyFlag to true, and have provided an answer, then DUM will attach the answer to the provisional response, as an early media indication
Definition at line 129 of file ServerInviteSession.cxx.
References InfoLog, resip::InviteSession::mState, sendProvisional(), resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
{
InfoLog (<< toData(mState) << ": provisional(" << code << ")");
switch (mState)
{
case UAS_Offer:
transition(UAS_EarlyOffer);
sendProvisional(code, earlyFlag);
break;
case UAS_OfferProvidedAnswer:
case UAS_EarlyProvidedAnswer:
transition(UAS_EarlyProvidedAnswer);
sendProvisional(code, earlyFlag);
break;
case UAS_ProvidedOffer:
case UAS_EarlyProvidedOffer:
transition(UAS_EarlyProvidedOffer);
sendProvisional(code, earlyFlag);
break;
case UAS_EarlyOffer:
transition(UAS_EarlyOffer);
sendProvisional(code, earlyFlag);
break;
case UAS_NoOffer:
case UAS_EarlyNoOffer:
transition(UAS_EarlyNoOffer);
sendProvisional(code, earlyFlag);
break;
case UAS_NoOfferReliable:
case UAS_NegotiatedReliable:
// TBD
assert(0);
break;
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_ReceivedOfferReliable:
case UAS_ReceivedUpdate:
case UAS_ReceivedUpdateWaitingAnswer:
case UAS_SentUpdate:
case UAS_SentUpdateAccepted:
case UAS_Start:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
default:
assert(0);
break;
}
}

| void ServerInviteSession::provisionalCommand | ( | int | code = 180 | ) |
Definition at line 213 of file ServerInviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new ServerInviteSessionProvisionalCommand(*this, statusCode));
}

| void ServerInviteSession::redirect | ( | const NameAddrs & | contacts, |
| int | code = 302 |
||
| ) |
send a 3xx
Definition at line 38 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::destroy(), resip::InviteSession::getSessionHandle(), InfoLog, resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, mFirstRequest, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mState, resip::DialogEventStateManager::onTerminated(), resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::Referred, resip::InviteSessionHandler::Rejected, resip::DialogUsage::send(), resip::InviteSession::Terminated, resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
{
InfoLog (<< toData(mState) << ": redirect(" << code << ")"); // -> " << contacts);
switch (mState)
{
case UAS_EarlyNoOffer:
case UAS_EarlyOffer:
case UAS_EarlyProvidedAnswer:
case UAS_EarlyProvidedOffer:
case UAS_NegotiatedReliable:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_NoOffer:
case UAS_NoOfferReliable:
case UAS_Offer:
case UAS_OfferProvidedAnswer:
case UAS_ReceivedOfferReliable:
case UAS_ProvidedOffer:
case UAS_ReceivedUpdate:
case UAS_ReceivedUpdateWaitingAnswer:
case UAS_SentUpdate:
{
// !jf! the cleanup for 3xx may be a bit strange if we are in the middle of
// an offer/answer exchange with PRACK.
// e.g. we sent 183 reliably and then 302 before PRACK was received. Ideally,
// we should send 200PRACK
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, mFirstRequest, code);
response->header(h_Contacts) = contacts;
send(response);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onTerminated(mDialog, *response, InviteSessionHandler::Rejected);
}
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::Referred);
mDum.destroy(this);
break;
}
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
case UAS_SentUpdateAccepted:
case UAS_Start:
default:
assert(0);
throw UsageUseException("Can't redirect after accepted", __FILE__, __LINE__);
break;
}
}

| void ServerInviteSession::redirectCommand | ( | const NameAddrs & | contacts, |
| int | code = 302 |
||
| ) |
Provide asynchronous method access by using command.
Definition at line 123 of file ServerInviteSession.cxx.
References resip::BaseUsage::mDum, and resip::TransactionUser::post().
{
mDum.post(new ServerInviteSessionRedirectCommand(*this, contacts, code));
}

| void ServerInviteSession::reject | ( | int | statusCode, |
| WarningCategory * | warning = 0 |
||
| ) | [virtual] |
Rejects an offer at the SIP level.
So this can send a 488 to a reINVITE or UPDATE
Reimplemented from resip::InviteSession.
Definition at line 459 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::destroy(), resip::InviteSession::getSessionHandle(), InfoLog, resip::Dialog::makeResponse(), resip::DialogUsage::mDialog, resip::BaseUsage::mDum, mFirstRequest, resip::DialogUsageManager::mInviteSessionHandler, resip::InviteSession::mState, resip::InviteSessionHandler::onTerminated(), resip::InviteSessionHandler::Rejected, resip::DialogUsage::send(), resip::InviteSession::Terminated, resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, resip::InviteSession::UAS_EarlyNoOffer, resip::InviteSession::UAS_EarlyOffer, resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_FirstSentAnswerReliable, resip::InviteSession::UAS_FirstSentOfferReliable, resip::InviteSession::UAS_NegotiatedReliable, resip::InviteSession::UAS_NoOffer, resip::InviteSession::UAS_NoOfferReliable, resip::InviteSession::UAS_Offer, resip::InviteSession::UAS_OfferProvidedAnswer, resip::InviteSession::UAS_ProvidedOffer, resip::InviteSession::UAS_ReceivedOfferReliable, resip::InviteSession::UAS_ReceivedUpdate, resip::InviteSession::UAS_ReceivedUpdateWaitingAnswer, resip::InviteSession::UAS_SentUpdate, resip::InviteSession::UAS_SentUpdateAccepted, resip::InviteSession::UAS_Start, resip::InviteSession::UAS_WaitingToHangup, resip::InviteSession::UAS_WaitingToOffer, resip::InviteSession::UAS_WaitingToRequestOffer, and resip::InviteSession::UAS_WaitingToTerminate.
Referenced by end().
{
InfoLog (<< toData(mState) << ": reject(" << code << ")");
switch (mState)
{
case UAS_EarlyNoOffer:
case UAS_EarlyOffer:
case UAS_EarlyProvidedAnswer:
case UAS_EarlyProvidedOffer:
case UAS_NoOffer:
case UAS_Offer:
case UAS_OfferProvidedAnswer:
case UAS_ProvidedOffer:
case UAS_NegotiatedReliable:
case UAS_FirstSentAnswerReliable:
case UAS_FirstSentOfferReliable:
case UAS_NoOfferReliable:
case UAS_ReceivedOfferReliable:
case UAS_ReceivedUpdate:
case UAS_SentUpdate:
{
// !jf! the cleanup for 3xx may be a bit strange if we are in the middle of
// an offer/answer exchange with PRACK.
// e.g. we sent 183 reliably and then 302 before PRACK was received. Ideally,
// we should send 200PRACK
SharedPtr<SipMessage> response(new SipMessage);
mDialog.makeResponse(*response, mFirstRequest, code);
if(warning)
{
response->header(h_Warnings).push_back(*warning);
}
send(response);
transition(Terminated);
mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), InviteSessionHandler::Rejected);
mDum.destroy(this);
break;
}
case UAS_Accepted:
case UAS_WaitingToOffer:
case UAS_WaitingToRequestOffer:
case UAS_ReceivedUpdateWaitingAnswer:
case UAS_SentUpdateAccepted:
case UAS_Start:
case UAS_WaitingToHangup:
case UAS_WaitingToTerminate:
assert(0);
break;
default:
InviteSession::reject(code);
break;
}
}

| void ServerInviteSession::requestOffer | ( | ) | [virtual] |
Called to request that the far end provide an offer.
This will cause a reinvite with no body to be sent.
Reimplemented from resip::InviteSession.
Definition at line 297 of file ServerInviteSession.cxx.
References InfoLog, resip::InviteSession::mState, resip::InviteSession::toData(), resip::InviteSession::transition(), resip::InviteSession::UAS_Accepted, and resip::InviteSession::UAS_WaitingToRequestOffer.
Referenced by dispatchWaitingToRequestOffer().
{
InfoLog (<< toData(mState) << ": requestOffer");
switch (mState)
{
case UAS_Accepted:
// queue the request to be sent after the ACK is received
transition(UAS_WaitingToRequestOffer);
break;
case UAS_WaitingToRequestOffer:
InviteSession::requestOffer();
break;
default:
InviteSession::requestOffer();
break;
}
}

| void ServerInviteSession::sendAccept | ( | int | code, |
| Contents * | offerAnswer | ||
| ) | [private] |
Definition at line 1265 of file ServerInviteSession.cxx.
References resip::InviteSession::getSessionHandle(), resip::InviteSession::handleSessionTimerRequest(), resip::Dialog::makeResponse(), resip::InviteSession::mCurrentEncryptionLevel, mCurrentRetransmit1xx, resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, mFirstRequest, resip::InviteSession::mInvite200, resip::DialogEventStateManager::onConfirmed(), resip::DialogUsage::send(), resip::InviteSession::setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), and resip::InviteSession::startRetransmit200Timer().
Referenced by accept(), and dispatchAcceptedWaitingAnswer().
{
mDialog.makeResponse(*mInvite200, mFirstRequest, code);
handleSessionTimerRequest(*mInvite200, mFirstRequest);
if (offerAnswer)
{
setOfferAnswer(*mInvite200, offerAnswer);
}
mCurrentRetransmit1xx = 0; // Stop the 1xx timer
startRetransmit200Timer(); // 2xx timer
DumHelper::setOutgoingEncryptionLevel(*mInvite200, mCurrentEncryptionLevel);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onConfirmed(mDialog, getSessionHandle());
}
send(mInvite200);
}

| void ServerInviteSession::sendProvisional | ( | int | code, |
| bool | earlyFlag | ||
| ) | [private] |
Definition at line 1223 of file ServerInviteSession.cxx.
References resip::InviteSession::getSessionHandle(), m1xx, resip::Dialog::makeResponse(), resip::InviteSession::mCurrentLocalOfferAnswer, resip::DialogUsage::mDialog, resip::DialogUsageManager::mDialogEventStateManager, resip::BaseUsage::mDum, mFirstRequest, resip::InviteSession::mProposedEncryptionLevel, resip::InviteSession::mProposedLocalOfferAnswer, resip::InviteSession::mState, resip::DialogEventStateManager::onEarly(), resip::DialogUsage::send(), resip::InviteSession::setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), startRetransmit1xxTimer(), resip::InviteSession::UAS_EarlyProvidedAnswer, resip::InviteSession::UAS_EarlyProvidedOffer, resip::InviteSession::UAS_OfferProvidedAnswer, and resip::InviteSession::UAS_ProvidedOffer.
Referenced by provisional().
{
mDialog.makeResponse(*m1xx, mFirstRequest, code);
if(!earlyFlag)
{
m1xx->setContents(0); // clear contents if present
}
else
{
switch (mState)
{
case UAS_OfferProvidedAnswer:
case UAS_EarlyProvidedAnswer:
if (mCurrentLocalOfferAnswer.get()) // early media
{
setOfferAnswer(*m1xx, mCurrentLocalOfferAnswer.get());
}
break;
case UAS_ProvidedOffer:
case UAS_EarlyProvidedOffer:
if (mProposedLocalOfferAnswer.get())
{
setOfferAnswer(*m1xx, mProposedLocalOfferAnswer.get());
}
break;
default:
break;
}
}
startRetransmit1xxTimer();
DumHelper::setOutgoingEncryptionLevel(*m1xx, mProposedEncryptionLevel);
if (mDum.mDialogEventStateManager)
{
mDum.mDialogEventStateManager->onEarly(mDialog, getSessionHandle());
}
send(m1xx);
}

| void ServerInviteSession::sendUpdate | ( | const Contents & | offerAnswer | ) | [private] |
Definition at line 1286 of file ServerInviteSession.cxx.
References resip::Dialog::makeRequest(), resip::DialogUsage::mDialog, resip::InviteSession::mLastLocalSessionModification, resip::InviteSession::mProposedEncryptionLevel, resip::DialogUsage::send(), resip::InviteSession::setOfferAnswer(), resip::DumHelper::setOutgoingEncryptionLevel(), and resip::InviteSession::updateMethodSupported().
Referenced by provideOffer().
{
if (updateMethodSupported())
{
mDialog.makeRequest(*mLastLocalSessionModification, UPDATE);
InviteSession::setOfferAnswer(*mLastLocalSessionModification, offerAnswer);
DumHelper::setOutgoingEncryptionLevel(*mLastLocalSessionModification, mProposedEncryptionLevel);
send(mLastLocalSessionModification);
}
else
{
throw UsageUseException("Can't send UPDATE to peer", __FILE__, __LINE__);
}
}

| void ServerInviteSession::startRetransmit1xxTimer | ( | ) | [private] |
Definition at line 1211 of file ServerInviteSession.cxx.
References resip::DialogUsageManager::addTimer(), resip::BaseUsage::getBaseHandle(), resip::DialogSet::getUserProfile(), m1xx, mCurrentRetransmit1xx, resip::DialogUsage::mDialog, resip::Dialog::mDialogSet, resip::BaseUsage::mDum, and resip::DumTimeout::Retransmit1xx.
Referenced by dispatch(), and sendProvisional().
{
// RFC3261 13.3.1 says the UAS must send a non-100 provisional response every minute, to handle the possiblity of lost provisional responses
mCurrentRetransmit1xx = mDialog.mDialogSet.getUserProfile()->get1xxRetransmissionTime();
if(mCurrentRetransmit1xx > 0)
{
unsigned int seq = m1xx->header(h_CSeq).sequence();
mDum.addTimer(DumTimeout::Retransmit1xx, mCurrentRetransmit1xx, getBaseHandle(), seq);
}
}

friend class Dialog [friend] |
Reimplemented from resip::InviteSession.
Definition at line 62 of file ServerInviteSession.hxx.
SharedPtr<SipMessage> resip::ServerInviteSession::m1xx [private] |
Definition at line 103 of file ServerInviteSession.hxx.
Referenced by dispatch(), sendProvisional(), and startRetransmit1xxTimer().
unsigned long resip::ServerInviteSession::mCurrentRetransmit1xx [private] |
Definition at line 104 of file ServerInviteSession.hxx.
Referenced by dispatch(), sendAccept(), and startRetransmit1xxTimer().
const SipMessage resip::ServerInviteSession::mFirstRequest [private] |
Definition at line 102 of file ServerInviteSession.hxx.
Referenced by accept(), dispatchBye(), dispatchCancel(), dispatchUnknown(), redirect(), reject(), sendAccept(), and sendProvisional().
1.7.5.1