当前位置: 首页>>代码示例>>C++>>正文


C++ UtlHashMap::removeReference方法代码示例

本文整理汇总了C++中UtlHashMap::removeReference方法的典型用法代码示例。如果您正苦于以下问题:C++ UtlHashMap::removeReference方法的具体用法?C++ UtlHashMap::removeReference怎么用?C++ UtlHashMap::removeReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UtlHashMap的用法示例。


在下文中一共展示了UtlHashMap::removeReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateCallState

OsStatus ACDCallManager::updateCallState(SIPX_CALLSTATE_INFO* pCallInfo)
{
   SIPX_CALL hCallHandle;
   SIPX_LINE hLineHandle;
   int       callEvent;
   int       callCause;
   OsStatus status = OS_FAILED ;

   mLock.acquire();

   // Extract the call handle and state info
   hCallHandle = pCallInfo->hCall;
   hLineHandle = pCallInfo->hLine;
   callEvent   = pCallInfo->event;
   callCause   = pCallInfo->cause;

   OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDCallManager::updateCallState hCall=%d  hLine=%d callEvent %d callCause %d associated callHandle %d remoteAddr %s",
                    hCallHandle, hLineHandle, callEvent, callCause, pCallInfo->hAssociatedCall, pCallInfo->remoteAddress);

   // Search for the call handle in the various maps

   // Inbound calls are in the mCallHandleMap
   char *which = "mCallHandleMap" ;
   UtlHashMap *map = &mCallHandleMap ;
   UtlInt callKey(hCallHandle);
   UtlContainable *pValue = NULL ;
   pValue = mCallHandleMap.findValue(&callKey) ;

   if (pValue == NULL) {
      // Calls to agents are in the mAgentCallHandleMap
      which = "mAgentCallHandleMap" ;
      map = &mAgentCallHandleMap ;
      pValue = mAgentCallHandleMap.findValue(&callKey) ;
   }

   if (pValue == NULL) {
      // In transfer mode, sometimes calls end up in the mTransferCallHandleMap
      which = "mTransferCallHandleMap" ;
      map = &mTransferCallHandleMap ;
      pValue = mTransferCallHandleMap.findValue(&callKey) ;
   }

   if (pValue == NULL) {
      which = "mDeadCallHandleMap" ;
      map = &mDeadCallHandleMap ;
      pValue = mDeadCallHandleMap.findValue(&callKey) ;
   }

   if (pValue != NULL)
   {
      if (callEvent == CALLSTATE_DESTROYED) {
         // If event is destroyed, then that is the last we will see of this
         // handle.  Remove it from whatever map we found it in.
         OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDCallManager::updateCallState - "
            "removing hCall=%d from %s", hCallHandle, which) ;
         map->removeReference(&callKey);
      }
      else
      {
         if (map != &mDeadCallHandleMap) {
            // Pass event along to the ACDCall we found
            ACDCall*  pCallRef = dynamic_cast<ACDCall*>(pValue);
            OsSysLog::add(FAC_ACD, gACD_DEBUG,
               "ACDCallManager::updateCallState - "
               "Found ACDCall Call(%d) hCall=%d Object(%p) using %s",
                  pCallRef->mhCallHandle, hCallHandle,
                  pCallRef, which) ;
            pCallRef->updateState(hCallHandle, callEvent, callCause);
         } else {
            OsSysLog::add(FAC_ACD, gACD_DEBUG,
              "ACDCallManager::updateCallState - ignoring dead hCall=%d events",
                 hCallHandle);
            // Kill the darn thing, just to make sure it goes away
            sipxCallDestroy(hCallHandle) ;
         }
      }
      status = OS_SUCCESS ;
   } else {
      OsSysLog::add(FAC_ACD, gACD_DEBUG,
         "ACDCallManager::updateCallState - did not find hCall=%d hLine=%d",
            hCallHandle, hLineHandle);
   }

   mLock.release();
   return status;
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:86,代码来源:ACDCallManager.cpp


注:本文中的UtlHashMap::removeReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。