本文整理汇总了C++中SipUserAgent::addSipOutputProcessor方法的典型用法代码示例。如果您正苦于以下问题:C++ SipUserAgent::addSipOutputProcessor方法的具体用法?C++ SipUserAgent::addSipOutputProcessor怎么用?C++ SipUserAgent::addSipOutputProcessor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SipUserAgent
的用法示例。
在下文中一共展示了SipUserAgent::addSipOutputProcessor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OsServerTask
// Constructor
SipXProxyCseObserver::SipXProxyCseObserver(SipUserAgent& sipUserAgent,
const UtlString& dnsName,
CallStateEventWriter* pWriter
) :
OsServerTask("SipXProxyCseObserver-%d", NULL, 2000),
SipOutputProcessor( CSE_AGENT_OUTPUT_PROC_PRIO ),
mpSipUserAgent(&sipUserAgent),
mpBuilder(NULL),
mpWriter(pWriter),
mSequenceNumber(0),
mFlushTimer(getMessageQueue(), 0),
mCallTransMutex(OsMutex::Q_FIFO)
{
OsTime timeNow;
OsDateTime::getCurTime(timeNow);
UtlString event;
if (mpWriter)
{
switch (pWriter->getLogType())
{
case CallStateEventWriter::CseLogFile:
mpBuilder = new CallStateEventBuilder_XML(dnsName);
break;
case CallStateEventWriter::CseLogDatabase:
mpBuilder = new CallStateEventBuilder_DB(dnsName);
break;
}
if (mpBuilder)
{
if (pWriter->openLog())
{
mpBuilder->observerEvent(mSequenceNumber, timeNow, CallStateEventBuilder::ObserverReset,
"SipXProxyCseObserver");
mpBuilder->finishElement(event);
if (!mpWriter->writeLog(event.data()))
{
Os::Logger::instance().log(FAC_SIP, PRI_ERR,
"SipXProxyCseObserver initial event log write failed - disabling writer");
mpWriter = NULL;
}
else
{
mpWriter->flush(); // try to ensure that at least the sequence restart gets to the file
}
}
else
{
Os::Logger::instance().log(FAC_SIP, PRI_ERR,
"SipXProxyCseObserver initial event log write failed - disabling writer");
mpWriter = NULL;
// Set correct state even if nothing is written
mpBuilder->observerEvent(mSequenceNumber, timeNow, CallStateEventBuilder::ObserverReset, "");
mpBuilder->finishElement(event);
}
}
}
// set up periodic timer to flush log file
mFlushTimer.periodicEvery(OsTime(), OsTime(SipXProxyCallStateFlushInterval, 0)) ;
// Register to get incoming requests
sipUserAgent.addMessageObserver(*getMessageQueue(),
SIP_BYE_METHOD,
TRUE, // Requests,
FALSE, //Responses,
TRUE, //Incoming,
FALSE, //OutGoing,
"", //eventName,
NULL, // any session
NULL // no observerData
);
sipUserAgent.addMessageObserver(*getMessageQueue(),
SIP_INVITE_METHOD,
TRUE, // Requests,
FALSE, //Responses,
TRUE, //Incoming,
FALSE, //OutGoing,
"", //eventName,
NULL, // any session
NULL // no observerData
);
sipUserAgent.addMessageObserver(*getMessageQueue(),
SIP_REFER_METHOD,
TRUE, // Requests,
FALSE, //Responses,
TRUE, //Incoming,
FALSE, //OutGoing,
"", //eventName,
NULL, // any session
NULL // no observerData
);
sipUserAgent.addSipOutputProcessor( this );
// set up periodic timer to cleanup dead calls in the CallTransMap
//.........这里部分代码省略.........