本文整理汇总了C++中TaoMessage::getTaoObjHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ TaoMessage::getTaoObjHandle方法的具体用法?C++ TaoMessage::getTaoObjHandle怎么用?C++ TaoMessage::getTaoObjHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaoMessage
的用法示例。
在下文中一共展示了TaoMessage::getTaoObjHandle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: receiveMsg
UtlBoolean TaoClientTask::receiveMsg(TaoMessage& rMsg)
{
TaoObjHandle appHandle = 0;
appHandle = rMsg.getSocket(); // where the app pointer is stored
if (appHandle)
{
OsProtectedEvent* pEvent;
TaoObjHandle handle;
UtlString argList;
int data;
pEvent = (OsProtectedEvent *)appHandle;
handle = rMsg.getTaoObjHandle();
data = rMsg.getArgCnt();
argList = rMsg.getArgList();
pEvent->setIntData(data);
data = rMsg.getCmd();
pEvent->setIntData2(data);
pEvent->setStringData(argList);
// If the event has already been signalled, clean up
if(OS_ALREADY_SIGNALED == pEvent->signal(handle))
{
OsProtectEventMgr* eventMgr = OsProtectEventMgr::getEventMgr();
eventMgr->release(pEvent);
}
return TRUE;
}
else
{
osPrintf("<<<< TaoClientTask::receiveMsg: no appHandle!! >>>>\n");
return FALSE;
}
}
示例2: handleMessage
UtlBoolean DialogEventPublisher::handleMessage(OsMsg& rMsg)
{
SipDialog sipDialog;
UtlString sipDialogContent;
Url requestUrl;
UtlString entity;
UtlString* pEntity;
char dialogId[10];
SipDialogEvent* pThisCall;
Dialog* pDialog;
UtlString localTag, remoteTag;
Url localIdentity, remoteIdentity;
Url localTarget, remoteTarget;
UtlString identity, displayName;
OsTime receivedTime;
int numOldContents;
HttpBody* oldContent[1];
int length;
UtlString dialogEvent;
// React to telephony events
if(rMsg.getMsgSubType()== TaoMessage::EVENT)
{
TaoMessage* taoMessage = (TaoMessage*)&rMsg;
int taoEventId = taoMessage->getTaoObjHandle();
UtlString argList(taoMessage->getArgList());
TaoString arg(argList, TAOMESSAGE_DELIMITER);
#ifdef DEBUGGING
dumpTaoMessageArgs(taoEventId, arg) ;
#endif
UtlBoolean localConnection = atoi(arg[TAO_OFFER_PARAM_LOCAL_CONNECTION]);
UtlString callId = arg[TAO_OFFER_PARAM_CALLID] ;
UtlString address = arg[TAO_OFFER_PARAM_ADDRESS] ;
switch (taoEventId)
{
case PtEvent::CONNECTION_OFFERED:
mpCallManager->getSipDialog(callId, address, sipDialog);
#ifdef DEBUGGING
sipDialog.toString(sipDialogContent);
OsSysLog::add(FAC_SIP, PRI_DEBUG, "DialogEventPublisher:: sipDialog = %s",
sipDialogContent.data());
#endif
sipDialog.getRemoteRequestUri(entity);
OsSysLog::add(FAC_SIP, PRI_DEBUG, "DialogEventPublisher:: Call arrived: callId %s address %s requestUrl %s",
callId.data(), address.data(), entity.data());
if (entity.isNull())
{
OsSysLog::add(FAC_SIP, PRI_WARNING, "DialogEventPublisher:: Call arrived: callId %s address %s without requestUrl",
callId.data(), address.data());
break;
}
else
{
requestUrl = Url(entity);
requestUrl.getIdentity(entity);
}
// Create a dialog event if has not been created yet
pThisCall = (SipDialogEvent *) mCalls.findValue(&entity);
if (pThisCall == NULL)
{
pEntity = new UtlString(entity);
pThisCall = new SipDialogEvent(STATE, entity);
mCalls.insertKeyAndValue(pEntity, pThisCall);
OsSysLog::add(FAC_SIP, PRI_DEBUG, "DialogEventPublisher:: insert DialogEvent object %p to the list",
pThisCall);
}
// Create the dialog element
sipDialog.getLocalField(localIdentity);
localIdentity.getFieldParameter("tag", localTag);
sipDialog.getRemoteField(remoteIdentity);
remoteIdentity.getFieldParameter("tag", remoteTag);
sprintf(dialogId, "%ld", mDialogId);
mDialogId++;
pDialog = new Dialog(dialogId, callId, localTag, remoteTag, "recipient");
pDialog->setState(STATE_EARLY, NULL, NULL);
localIdentity.getIdentity(identity);
localIdentity.getDisplayName(displayName);
pDialog->setLocalIdentity(identity, displayName);
remoteIdentity.getIdentity(identity);
remoteIdentity.getDisplayName(displayName);
pDialog->setRemoteIdentity(identity, displayName);
sipDialog.getLocalContact(localTarget);
pDialog->setLocalTarget(localTarget.toString());
sipDialog.getRemoteContact(remoteTarget);
//.........这里部分代码省略.........
示例3: handleMessage
UtlBoolean Listener::handleMessage(OsMsg& rMsg)
{
// React to telephony events
if(rMsg.getMsgSubType()== TaoMessage::EVENT)
{
TaoMessage* taoMessage = (TaoMessage*)&rMsg;
TaoEventId taoEventId = taoMessage->getTaoObjHandle();
UtlString argList(taoMessage->getArgList());
TaoString arg(argList, TAOMESSAGE_DELIMITER);
#ifdef DEBUGGING
dumpTaoMessageArgs(taoEventId, arg) ;
#endif
UtlBoolean localConnection = atoi(arg[TAO_OFFER_PARAM_LOCAL_CONNECTION]);
UtlString callId = arg[TAO_OFFER_PARAM_CALLID] ;
UtlString address = arg[TAO_OFFER_PARAM_ADDRESS] ;
switch (taoEventId)
{
case PtEvent::CONNECTION_OFFERED:
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Call arrived: callId %s address %s\n",
callId.data(), address.data());
mpCallManager->acceptConnection(callId, address);
mpCallManager->answerTerminalConnection(callId, address, "*");
break;
case PtEvent::CONNECTION_ESTABLISHED:
if (localConnection)
{
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Call connected: callId %s\n", callId.data());
CallObject* pThisCall = new CallObject(mpCallManager, callId, mPlayfile);
// Create a player and start to play out the file
if (pThisCall->playAudio() == OS_SUCCESS)
{
// Put it in a sorted list
insertEntry(callId, pThisCall);
}
else
{
// Drop the call
mpCallManager->drop(callId);
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_WARNING, "Listener::handleMessage - drop callId %s due to failure of playing audio\n",
callId.data());
delete pThisCall;
}
}
break;
case PtEvent::CONNECTION_DISCONNECTED:
if (!localConnection)
{
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Call Dropped: %s\n", callId.data());
// Remove the call from the pool and clean up the call
CallObject* pDroppedCall = removeEntry(callId);
if (pDroppedCall)
{
pDroppedCall->cleanUp();
delete pDroppedCall;
// Drop the call
mpCallManager->drop(callId);
}
else
{
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Lisenter::handleMessage - no callId %s founded in the active call list\n",
callId.data());
}
}
break;
case PtEvent::CONNECTION_FAILED:
OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_WARNING, "Dropping call: %s\n", callId.data());
mpCallManager->drop(callId);
break;
}
}
return(TRUE);
}