本文整理汇总了C++中sipmessage::Ptr::is2xx方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::is2xx方法的具体用法?C++ Ptr::is2xx怎么用?C++ Ptr::is2xx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sipmessage::Ptr
的用法示例。
在下文中一共展示了Ptr::is2xx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onReceivedMessage
void SIPNict::onReceivedMessage(SIPMessage::Ptr pMsg, SIPTransportSession::Ptr pTransport)
{
SIPTransaction::Ptr pTransaction = static_cast<SIPTransaction::WeakPtr*>(_owner)->lock();
if (!pTransaction)
return;
int state = pTransaction->getState();
if (!pMsg->isResponse() || state == SIPTransaction::TRN_STATE_TERMINATED || state == COMPLETED)
return;
bool is2xx = pMsg->is2xx();
SIPTransaction::Ptr pParent = pTransaction->getParent();
switch (pTransaction->getState())
{
case SIPTransaction::TRN_STATE_IDLE:
case TRYING:
if (pMsg->is1xx())
{
pTransaction->setState(PROCEEDING);
if (!pTransaction->isParent() && pParent && pParent->getState() < PROCEEDING)
pParent->setState(PROCEEDING);
pTransaction->informTU(pMsg, pTransport);
}
else
{
if (pTransaction->isParent() && !is2xx)
{
//
// If we are the parent or this is and error response
// cancel e and f timers
//
cancelTimerE();
cancelTimerF();
}
else if (!pTransaction->isParent() && is2xx)
{
//
// If this is a branch and it is a 2xx reponse,
// then cancel both parents timers as sell
//
cancelTimerE();
cancelTimerF();
if (pParent)
{
pParent->fsm()->cancelTimerE();
pParent->fsm()->cancelTimerF();
pParent->setState(COMPLETED);
}
}
else if (!pTransaction->isParent() && !is2xx)
{
//
// If this is a branch and it is an error reponse,
// then cancel both parent timers as well if there
// is only one branch
//
cancelTimerE();
cancelTimerF();
if (pParent && pParent->getBranchCount() == 1)
{
pParent->fsm()->cancelTimerE();
pParent->fsm()->cancelTimerF();
pParent->setState(COMPLETED);
}
}
pTransaction->setState(COMPLETED);
pTransaction->informTU(pMsg, pTransport);
if (!pTransport->isReliableTransport())
{
//
// Start the longest time we want to handle retransmissions of 200 OK
//
startTimerK();
}
else
{
pTransaction->setState(SIPTransaction::TRN_STATE_TERMINATED);
if (is2xx || pTransaction->allBranchesCompleted())
{
if (pParent)
pParent->setState(SIPTransaction::TRN_STATE_TERMINATED);
}
}
}
break;
case PROCEEDING:
if (pMsg->is1xx())
{
pTransaction->informTU(pMsg, pTransport);
}
else
{
//.........这里部分代码省略.........