本文整理汇总了C++中sipmessage::Ptr::createLoggerData方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::createLoggerData方法的具体用法?C++ Ptr::createLoggerData怎么用?C++ Ptr::createLoggerData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sipmessage::Ptr
的用法示例。
在下文中一共展示了Ptr::createLoggerData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeMessage
void SIPTransaction::writeMessage(SIPMessage::Ptr pMsg)
{
OSS::mutex_lock lock(_mutex);
if (!_transport)
{
OSS_LOG_ERROR("SIPTransaction::writeMessage - Transport is NULL while attempting to send a request.");
return;
}
if (SIPXOR::isEnabled() && _isXOREncrypted)
{
pMsg->setProperty("xor", "1");
}
std::ostringstream logMsg;
logMsg << _logId << ">>> " << pMsg->startLine()
<< " LEN: " << pMsg->data().size()
<< " SRC: " << _transport->getLocalAddress().toIpPortString()
<< " DST: " << _transport->getRemoteAddress().toIpPortString()
<< " ENC: " << _isXOREncrypted
<< " PROT: " << _transport->getTransportScheme();
OSS::log_information(logMsg.str());
if (OSS::log_get_level() >= OSS::PRIO_DEBUG)
OSS::log_debug(pMsg->createLoggerData());
if (_fsm->onSendMessage(pMsg))
{
_transport->writeMessage(pMsg);
}
}
示例2: onReceivedMessage
void SIPTransaction::onReceivedMessage(SIPMessage::Ptr pMsg, SIPTransportSession::Ptr pTransport)
{
OSS::mutex_lock lock(_mutex);
bool isAck = pMsg->isRequest("ACK");
if (pMsg->isRequest() && !_pInitialRequest && !isAck)
_pInitialRequest = pMsg;
if (_logId.empty())
_logId = pMsg->createContextId(true);
if (!_transport)
_transport = pTransport;
if (!_localAddress.isValid())
_localAddress = pTransport->getLocalAddress();
if (!_remoteAddress.isValid())
_remoteAddress = pTransport->getRemoteAddress();
if (SIPXOR::isEnabled() && !_isXOREncrypted)
{
std::string isXOR;
_isXOREncrypted = pMsg->getProperty("xor", isXOR) && isXOR == "1";
}
if (isParent())
{
std::ostringstream logMsg;
logMsg << _logId << "<<< " << pMsg->startLine()
<< " LEN: " << pTransport->getLastReadCount()
<< " SRC: " << _remoteAddress.toIpPortString()
<< " DST: " << _localAddress.toIpPortString()
<< " EXT: " << "[" << pTransport->getExternalAddress() << "]"
<< " FURI: " << pMsg->hdrGet("from")
<< " ENC: " << _isXOREncrypted
<< " PROT: " << pTransport->getTransportScheme();
OSS::log_information(logMsg.str());
if (OSS::log_get_level() >= OSS::PRIO_DEBUG)
OSS::log_debug(pMsg->createLoggerData());
}
//
// If this is a request and is not an ACK, then the parent IST fsm must always handle it
//
if (isParent() && pMsg->isRequest() && !isAck)
{
_fsm->onReceivedMessage(pMsg, pTransport);
}
else if (!pMsg->isRequest() || isAck)
{
//
// This is a response or an ACK and the transaction could have branched out
//
if (!isParent())
{
_fsm->onReceivedMessage(pMsg, pTransport);
}
else
{
SIPTransaction::Ptr pBranch = findBranch(pMsg);
if (pBranch)
pBranch->onReceivedMessage(pMsg, pTransport);
else
_fsm->onReceivedMessage(pMsg, pTransport);
}
}
}