コード例 #1
0
TaoStatus TaoPhoneComponentAdaptor::getExtSpeakerNominalVolume(TaoMessage& rMsg)
{
        int volume = 0;
        int groupType = atoi(rMsg.getArgList());

        mpPhoneTask->taoGetNominalVolume(volume, groupType);

        if (volume > 10)
                volume = 10;
        if (volume < 0)
                volume = 0;

    char buff[MAXIMUM_INTEGER_STRING_LENGTH];
    sprintf(buff, "%d", volume);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        rMsg.setArgCnt(1);
        rMsg.setArgList(buff);


        if (mpSvrTransport->postMessage(rMsg))
        {
                return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #2
0
int TaoClientTask::sendRequest(TaoMessage& rMsg, OsMutex* pMutex, const OsTime& rTimeout)
{
        if (mpTaoServerTask)
        {
                rMsg.setMsgQueueHandle((TaoObjHandle) this);
                mpTaoServerTask->postMessage(rMsg);
                return 1;
        }
        else
        {
                osPrintf("\n++++++ TaoClientTask::sendRequest mpTaoServerTask = 0x%p +++++\n", mpTaoServerTask);
                osPrintf("\n++++++ %d %d +++++\n", rMsg.getMsgSubType(), rMsg.getCmd());
        }

        osPrintf("\n++++++ TaoClientTask::sendRequest %p %s : %d+++++\n", mpConnectionSocket, mRemoteHost.data(), mRemotePort);
        if (!mpConnectionSocket)
        {
                mMutex.acquireWrite();
                mpConnectionSocket = new OsConnectionSocket(mRemotePort, mRemoteHost);
                if (mpAgent)
                {
                        delete mpAgent;
                }
                mpAgent = new TaoTransportAgent(mpConnectionSocket, this);
                mpAgent->start();
                mMutex.releaseWrite();
        }

        int recvd = 0;
        if (mpConnectionSocket && mpConnectionSocket->isOk())
        {
                unsigned int sent;
                mMutex.acquireWrite();

            UtlString buffer;
            ssize_t bufferLen;
            rMsg.getBytes(&buffer, &bufferLen);

                size_t iSendSize = bufferLen + (sizeof(uint32_t)*2) ;

                char* pBuf = new char[iSendSize] ;

                uint32_t cookie = 0x1234ABCD ;
                uint32_t length = bufferLen ;
                memcpy(&pBuf[0], &cookie, sizeof(uint32_t)) ;
                memcpy(&pBuf[sizeof(uint32_t)], &length, sizeof(uint32_t)) ;
                memcpy(&pBuf[sizeof(uint32_t)*2], buffer.data(), bufferLen) ;
                sent = mpConnectionSocket->write(pBuf, iSendSize) ;

                delete pBuf ;

                if (sent > sizeof(uint32_t)*2)
                        sent -= sizeof(uint32_t)*2 ;

                mMutex.releaseWrite();
        }

        return recvd;
}
コード例 #3
0
ファイル: TaoTransportAgent.cpp プロジェクト: mranga/sipxecs
int TaoTransportAgent::run(void* runArg)
{
        UtlString remoteHostName;
        UtlString viaProtocol;
    UtlString fromIpAddress;

        while (mpSocket && mpSocket->isOk() && !isShuttingDown())
        {
                char          buffer[DEF_TAO_MAX_SOCKET_SIZE];
                unsigned long bytesRead;
                unsigned long cookie ;
                unsigned long length ;

                memset(buffer, 0, (DEF_TAO_MAX_SOCKET_SIZE * sizeof(char)));

                // Look for our next message, it should start with a '1234ABCD' marker
                bytesRead = mpSocket->read((char*) &cookie, sizeof(unsigned long)) ;
                while ((bytesRead > 0) && (cookie != 0x1234ABCD)) {
                        osPrintf("<<**>> Invalid data read from socket, trying to resynchronize...\n") ;
                        bytesRead = readUntilDone(mpSocket, (char*) &cookie, sizeof(unsigned long)) ;
                }
                // Okay, now read length
                if (bytesRead > 0) {
                        bytesRead = readUntilDone(mpSocket, (char*) &length, sizeof(unsigned long)) ;
                }
                // Finally read data
                if (bytesRead > 0) {
                        bytesRead = readUntilDone(mpSocket, buffer, length) ;

                        if (bytesRead != length) {
                                osPrintf("<<**>> TaoTransportAgent READ MISMATCH %lu != %lu\n", bytesRead, length) ;
                                bytesRead = 0 ;
                        }
                }

                if(bytesRead > 0)
                {
                        TaoMessage msg = TaoMessage(UtlString(buffer));
                        msg.setSocket((TaoObjHandle)this);      //stores pointer to this class

                        mpServer->postMessage(msg);
                }
                else if(bytesRead <= 0 || !mpSocket->isOk())
                {
                        // The socket has gone sour close down the client
                        mpSocket->getRemoteHostName(&remoteHostName);
                        osPrintf("Shutting down TaoTransportAgent: %s due to failed socket\n",
                                remoteHostName.data());
                        break;
                }
        }

#ifdef TEST_PRINT
        osPrintf("TaoTransportAgent: %s/%s exiting\r\n", remoteHostName.data(),
                viaName.data());
#endif
        return(0);
}
コード例 #4
0
TaoStatus TaoPhoneComponentAdaptor::getDisplayColumns(TaoMessage& rMsg)
{
        if (rMsg.getArgList())
        {
                rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
                if (mpSvrTransport->postMessage(rMsg))
                        return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #5
0
TaoStatus TaoPhoneComponentAdaptor::getRingerInfo(TaoMessage& rMsg)
{
        if (rMsg.getArgCnt())
        {
                int index = atoi(rMsg.getArgList());

                PsMsg msg(PsMsg::RINGER_GET_INFO, this, index, 0);
                mpPhoneTask->postMessage(msg);

                return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #6
0
TaoStatus TaoPhoneComponentAdaptor::setRingerPattern(TaoMessage& rMsg)
{
        int index = atoi(rMsg.getArgList());

        PsMsg msg(PsMsg::RINGER_SET_PATTERN, this, index, 0);

        mpPhoneTask->postMessage(msg);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #7
0
TaoStatus TaoPhoneComponentAdaptor::activateGroup(TaoMessage& rMsg)
{
        int     argCnt = rMsg.getArgCnt();

        if (argCnt != 1)
                return TAO_FAILURE;

        mpPhoneTask->activateGroup((PsMsg&) rMsg);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

    return TAO_FAILURE;
}
コード例 #8
0
TaoStatus TaoPhoneComponentAdaptor::setRingerVolume(TaoMessage& rMsg)
{
        int volume = atoi(rMsg.getArgList());

        mpPhoneTask->taoSetVolume(volume, PtComponentGroup::RINGER);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);

        if (mpSvrTransport->postMessage(rMsg))
        {
                return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #9
0
TaoStatus TaoPhoneComponentAdaptor::setHookswState(TaoMessage& rMsg)
{
        if (rMsg.getArgCnt())
        {
                mHookswState = atoi(rMsg.getArgList());

                PsMsg hookswMsg(PsMsg::HOOKSW_STATE, this, mHookswState, mHookswState);
                mpPhoneTask->postMessage(hookswMsg);

                rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
                if (mpSvrTransport->postMessage(rMsg))
                        return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #10
0
TaoStatus TaoPhoneComponentAdaptor::setLampMode(TaoMessage& rMsg)
{
        TaoString arg(rMsg.getArgList(), TAOMESSAGE_DELIMITER);
        UtlString buttonInfo = arg[0];
        int mode = atoi(arg[1]);

        PsMsg msg(PsMsg::LAMP_SET_MODE, this, mode, 0);
        msg.setStringParam1(buttonInfo.data());

        mpPhoneTask->postMessage(msg);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #11
0
TaoStatus TaoPhoneComponentAdaptor::setMicGain(TaoMessage& rMsg)
{
        if (rMsg.getArgCnt() != 2)
                return TAO_FAILURE;

        TaoString arg(rMsg.getArgList(), TAOMESSAGE_DELIMITER);
        int groupType = atoi(arg[0]);
        int gain = atoi(arg[1]);

        mpPhoneTask->taoSetMicGain(groupType, gain);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #12
0
TaoStatus TaoPhoneComponentAdaptor::getButtonInfo(TaoMessage& rMsg)
{
        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #13
0
TaoStatus TaoListenerManager::removeEventListener(TaoMessage& rMsg)
{

        UtlString terminalName;
        TaoString str(rMsg.getArgList(), TAOMESSAGE_DELIMITER);
        terminalName = str[0];

        if (terminalName.isNull() || 0 == terminalName.compareTo("0.0.0.0"))
                terminalName = "127.0.0.1";

//    OsWriteLock lock(mListenerRWLock);

        if (mListenerCnt > 0)  // check if listener exists.
        {
                for (int i = 0; i < mListenerCnt; i++)
                {
                        if (mpListeners[i] && mpListeners[i]->mName.compareTo(terminalName) == 0)
                        {
                                mpListeners[i]->mRef--;
                                if (mpListeners[i]->mRef <= 0)
                                {
                                        osPrintf("*** TaoListenerManager::removeEventListener %s 0x%08x %d\n", terminalName.data(), (int)mpListeners[i], mpListeners[i]->mRef);
                                        if (mpListeners[i]->mpListenerPtr)
                                        {
                                                TaoEventListener* pListener = (TaoEventListener*) mpListeners[i]->mpListenerPtr;
                                                delete pListener;
                                        }
                                        delete mpListeners[i];
                                        mpListeners[i] = 0;
                                        mListenerCnt--;

                                        // find and delete the TaoTransportAgent
                                        TaoObjHandle object;
                                        if (TAO_SUCCESS == mpAgents->findValue(terminalName.data(), object))
                                        {
                                                if (object)
                                                {
                                                        osPrintf("TaoListenerManager removeEventListener TaoTransportAgent = %d\n", (int)object);
                                                        TaoTransportAgent *pAgent = (TaoTransportAgent *)object;
                                                        delete pAgent;
                                                }
                                        }
                                        else
                                                osPrintf("TaoListenerManager removeEventListener Failure! did not find socket %s\n", terminalName.data());

                                        if (TAO_SUCCESS == mpAgents->remove(terminalName.data()))
                                        {
                                                osPrintf(" **** TaoListenerManager removeEventListener socket removed %s ****\n", terminalName.data());
                                        }
                                        else
                                                osPrintf("TaoListenerManager removeEventListener Failure! did not remove socket %s\n", terminalName.data());
                                }
                        }
                }
        }

        return TAO_SUCCESS;
}
コード例 #14
0
TaoStatus TaoPhoneComponentAdaptor::getDisplayContrast(TaoMessage& rMsg)
{
        int     argCnt = rMsg.getArgCnt();

        if (argCnt != 1)
                return TAO_FAILURE;

#ifdef _VXWORKS
        int nominal = 0;

        if (OS_SUCCESS == MpCodec_getLCDContrastRange(mLCDLow, mLCDHigh, nominal))
        {
                mLCDContrast = MpCodec_getLCDContrast();
                mLCDOffset = mLCDLow - 1;
                osPrintf("--- get LCD contrast level %d ---\n", mLCDContrast);
        }

        UtlString arg;
    char buff[MAXIMUM_INTEGER_STRING_LENGTH];

        int level = mLCDContrast - mLCDOffset;
        if (level < 1)
                level = 1;

    sprintf(buff, "%d", level);
        arg = buff + TAOMESSAGE_DELIMITER;

    sprintf(buff, "%d", 1);
        arg += buff + TAOMESSAGE_DELIMITER;

    sprintf(buff, "%d", (mLCDHigh - mLCDOffset));
        arg += buff + TAOMESSAGE_DELIMITER;

    sprintf(buff, "%d", (nominal - mLCDOffset));
        arg += buff;

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        rMsg.setArgCnt(4);
        rMsg.setArgList(arg.data());
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;
#endif

    return TAO_FAILURE;
}
コード例 #15
0
TaoStatus TaoPhoneComponentAdaptor::buttonDown(TaoMessage& rMsg)
{
        mInfo = rMsg.getArgList();

        int keyIndex = mpButtonTask->getButtonIndex(mInfo.data());
        if (keyIndex >= 0)
        {
                mpButtonTask->postEvent(PsMsg::BUTTON_DOWN, this, keyIndex);
        }
        else
                rMsg.setObjHandle((TaoObjHandle)TAO_INVALID_ARGUMENT);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #16
0
TaoStatus TaoPhoneComponentAdaptor::getGroupComponents(TaoMessage& rMsg)
{
        int size = atoi(rMsg.getArgList());

        PsMsg msg(PsMsg::PHONEGROUP_GET_COMPONENTS, this, size, 0);
        mpPhoneTask->postMessage(msg);

        return TAO_SUCCESS;
}
コード例 #17
0
// get feedback from ps, return to client via transport, used
// by all get and set calls
TaoStatus TaoPhoneComponentAdaptor::returnResult(TaoMessage& rMsg)
{

        osPrintf("->>entering TaoPhoneComponentAdaptor:: returnResult<<-\n");
        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #18
0
TaoStatus TaoPhoneComponentAdaptor::getRingerVolume(TaoMessage& rMsg)
{
        int volume = 0;
        mpPhoneTask->taoGetVolume(volume, PtComponentGroup::RINGER);

    char buff[MAXIMUM_INTEGER_STRING_LENGTH];
    sprintf(buff, "%d", volume);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        rMsg.setArgCnt(1);
        rMsg.setArgList(buff);


        if (mpSvrTransport->postMessage(rMsg))
        {
                return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #19
0
TaoStatus TaoPhoneComponentAdaptor::setRingerInfo(TaoMessage& rMsg)
{
        TaoString arg(rMsg.getArgList(), TAOMESSAGE_DELIMITER);

        int index = atoi(arg[0]);
        UtlString info = arg[1];

        if (info)
        {
                PsMsg msg(PsMsg::RINGER_SET_INFO, this, index, 0);
                msg.setStringParam1(info.data());

                mpPhoneTask->postMessage(msg);

                rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
                if (mpSvrTransport->postMessage(rMsg))
                        return TAO_SUCCESS;
        }

        return TAO_FAILURE;
}
コード例 #20
0
TaoStatus TaoPhoneComponentAdaptor::getHookswCall(TaoMessage& rMsg)
{

        PsMsg hookswMsg(PsMsg::HOOKSW_GET_CALL, this, mHookswState, mHookswState);
        mpPhoneTask->postMessage(hookswMsg);

        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #21
0
TaoStatus TaoPhoneComponentAdaptor::setDisplayContrast(TaoMessage& rMsg)
{
        int     argCnt = rMsg.getArgCnt();

        if (argCnt != 2)
                return TAO_FAILURE;

#ifdef _VXWORKS
        TaoString arg(rMsg.getArgList(), TAOMESSAGE_DELIMITER);
        int level = atoi(arg[0]);

        if (!mLCDLow && !mLCDHigh)
        {
                int nominal;
                MpCodec_getLCDContrastRange(mLCDLow, mLCDHigh, nominal);
                mLCDOffset = mLCDLow - 1;
        }

        level += mLCDOffset;
        if (level < mLCDLow)
                level = mLCDLow;
        if (level > mLCDHigh)
                level = mLCDHigh;

        if (OS_SUCCESS == MpCodec_setLCDContrast(level))
        {
                osPrintf("--- set LCD contrast level %d -> %d ---\n", mLCDContrast, level);
                mLCDContrast = level;
                rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);

                if (mpSvrTransport->postMessage(rMsg))
                {
                        return TAO_SUCCESS;
                }
        }
#endif

        return TAO_FAILURE;
}
コード例 #22
0
TaoStatus TaoPhoneComponentAdaptor::getMicGain(TaoMessage& rMsg)
{
        if (rMsg.getArgCnt() != 1)
                return TAO_FAILURE;

        UtlString arg = rMsg.getArgList();
        int groupType = atoi(arg.data());

        int gain = mpPhoneTask->taoGetMicGain(groupType);

        char buf[32];
        sprintf(buf, "%d", gain);
        arg += TAOMESSAGE_DELIMITER + buf;

        rMsg.setArgCnt(2);
        rMsg.setArgList(arg);
        rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
        if (mpSvrTransport->postMessage(rMsg))
                return TAO_SUCCESS;

        return TAO_FAILURE;
}
コード例 #23
0
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;
        }
}
コード例 #24
0
TaoStatus TaoPhoneComponentAdaptor::getAssociatedPhoneLamp(TaoMessage& rMsg)
{
        //// need work
        
        if (mpLamp)
        {
                

                rMsg.setMsgSubType(TaoMessage::RESPONSE_PHONECOMPONENT);
                if (mpSvrTransport->postMessage(rMsg))
                        return TAO_SUCCESS;
        }

    return TAO_FAILURE;
}
コード例 #25
0
ファイル: TaoTransportAgent.cpp プロジェクト: mranga/sipxecs
int TaoTransportAgent::send(TaoMessage& rMsg)
{
        UtlString buffer;
        ssize_t bufferLen;
        rMsg.getBytes(&buffer, &bufferLen);

        // send the msg to the transport, receive the response
        size_t sent = 0;
        if (mpSocket->isOk() && (bufferLen > 0))
        {
                mWriteSem.acquire() ;

                size_t iSendSize = bufferLen + (sizeof(uint32_t)*2) ;

                char* pBuf = new char[iSendSize] ;

                uint32_t cookie = 0x1234ABCD ;
                uint32_t length = bufferLen ;
                memcpy(&pBuf[0], &cookie, sizeof(uint32_t)) ;
                memcpy(&pBuf[sizeof(uint32_t)], &length, sizeof(uint32_t)) ;
                memcpy(&pBuf[sizeof(uint32_t)*2], buffer.data(), bufferLen) ;
                sent = mpSocket->write(pBuf, iSendSize) ;

                delete pBuf ;

                if (sent > (sizeof(uint32_t)*2))
                        sent -= sizeof(uint32_t)*2 ;

                mWriteSem.release() ;

                if (sent != length) {
                        osPrintf("<<**>> TaoTransportAgent WRITE MISMATCH %zu != %u\n", sent, length) ;
                        sent = 0 ;
                }
        }

        return sent;
}
コード例 #26
0
int TaoTransportTask::send(TaoMessage& rMsg)
{
        unsigned int type = rMsg.getMsgSubType();
        unsigned int cmd = rMsg.getCmd();
        if ((TaoMessage::RESPONSE_PROVIDER == type) && (cmd == TaoMessage::SHUTDOWN))
        {
                TaoTransportAgent* pAgent = (TaoTransportAgent *) rMsg.getSocket();

                mpTaoListeningTask->shutdownAgent(pAgent);
                return 0;
        }

        // record this transaction in the transaction db
        rMsg.getMsgID();

        mpTransactionCnt->add();
        mpTransactionCnt->getRef();

        TaoObjHandle remoteServer = rMsg.getMsgQueueHandle();

        if (mClientHandle)
        {
                ((OsServerTask *) mClientHandle)->postMessage(rMsg);
                return 1;
        }
        else if (remoteServer)
        {
                ((OsServerTask *) remoteServer)->postMessage(rMsg);
                return 1;
        }

        // send the msg to the transport, receive the response
        int sent = 0;
        TaoTransportAgent* pAgent = (TaoTransportAgent *) rMsg.getSocket();
        if (pAgent && !pAgent->isShuttingDown())
        {
                sent = pAgent->send(rMsg);
        }

        return sent;
}
コード例 #27
0
ファイル: listener.cpp プロジェクト: mranga/sipxecs
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);
}
コード例 #28
0
UtlBoolean TaoPhoneComponentAdaptor::handleMessage(OsMsg& rMsg)
{
        UtlBoolean handled = FALSE;
        int msgType = ((TaoMessage&)rMsg).getMsgSubType();

        if( TaoMessage::REQUEST_PHONECOMPONENT == msgType)
        {
                switch (((TaoMessage&)rMsg).getCmd())
                {
                case TaoMessage::BUTTON_PRESS:
                        if (TAO_SUCCESS == buttonPress((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::BUTTON_UP:
                        if (TAO_SUCCESS == buttonUp((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::BUTTON_DOWN:
                        if (TAO_SUCCESS == buttonDown((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::BUTTON_GET_INFO:
                        if (TAO_SUCCESS == getButtonInfo((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::BUTTON_SET_INFO:
                        if (TAO_SUCCESS == setButtonInfo((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::BUTTON_GET_PHONELAMP:
                        if (TAO_SUCCESS == getAssociatedPhoneLamp((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::HOOKSWITCH_GET_STATE:
                        if (TAO_SUCCESS == getHookswState((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::HOOKSWITCH_SET_STATE:
                        if (TAO_SUCCESS == setHookswState((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::HOOKSWITCH_GET_CALL:
                        if (TAO_SUCCESS == getHookswCall((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::LAMP_GET_MODE:
                        if (TAO_SUCCESS == getHookswCall((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::LAMP_GET_SUPPORTED_MODES:
                        if (TAO_SUCCESS == getHookswCall((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::LAMP_GET_BUTTON:
                        if (TAO_SUCCESS == getHookswCall((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::LAMP_SET_MODE:
                        if (TAO_SUCCESS == setLampMode((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONEDISPALY --------------------------------- */
                case TaoMessage::DISPLAY_GET_DISPLAY:
                        if (TAO_SUCCESS == getDisplay((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::DISPLAY_GET_ROWS:
                        if (TAO_SUCCESS == getDisplayRows((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::DISPLAY_GET_COLS:
                        if (TAO_SUCCESS == getDisplayColumns((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::DISPLAY_SET_DISPLAY:
                        if (TAO_SUCCESS == setDisplay((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::DISPLAY_GET_CONTRAST:
                        if (TAO_SUCCESS == getDisplayContrast((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::DISPLAY_SET_CONTRAST:
                        if (TAO_SUCCESS == setDisplayContrast((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONEMIC --------------------------------- */
                case TaoMessage::MIC_GET_GAIN:
                        if (TAO_SUCCESS == getMicGain((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::MIC_SET_GAIN:
                        if (TAO_SUCCESS == setMicGain((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONERINGER --------------------------------- */
                case TaoMessage::RINGER_SET_INFO:
                        if (TAO_SUCCESS == setRingerInfo((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_SET_PATTERN:
                        if (TAO_SUCCESS == setRingerPattern((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_SET_VOLUME:
                        if (TAO_SUCCESS == setRingerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_GET_INFO:
                        if (TAO_SUCCESS == getRingerInfo((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_GET_PATTERN:
                        if (TAO_SUCCESS == getRingerPattern((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_GET_VOLUME:
                        if (TAO_SUCCESS == getRingerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_GET_MAX_PATTERN_INDEX:
                        if (TAO_SUCCESS == getMaxRingPatternIndex((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_GET_NUMBER_OF_RINGS:
                        if (TAO_SUCCESS == getNumberOfRings((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::RINGER_IS_ON:
                        if (TAO_SUCCESS == isRingerOn((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONESPEAKER --------------------------------- */
                case TaoMessage::SPEAKER_SET_VOLUME:
                        if (TAO_SUCCESS == setSpeakerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::SPEAKER_GET_VOLUME:
                        if (TAO_SUCCESS == getSpeakerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::SPEAKER_GET_NOMINAL_VOLUME:
                        if (TAO_SUCCESS == getSpeakerNominalVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONEEXTSPEAKER --------------------------------- */
                case TaoMessage::EXTSPEAKER_SET_VOLUME:
                        if (TAO_SUCCESS == setExtSpeakerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::EXTSPEAKER_GET_VOLUME:
                        if (TAO_SUCCESS == getExtSpeakerVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::EXTSPEAKER_GET_NOMINAL_VOLUME:
                        if (TAO_SUCCESS == getExtSpeakerNominalVolume((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
        /* ----------------------------- PHONEGROUP --------------------------------- */
                case TaoMessage::PHONEGROUP_ACTIVATE:
                        if (TAO_SUCCESS == activateGroup((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::PHONEGROUP_DEACTIVATE:
                        if (TAO_SUCCESS == deactivateGroup((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::PHONEGROUP_GET_COMPONENTS:
                        if (TAO_SUCCESS == getGroupComponents((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::PHONEGROUP_GET_DESCRIPTION:
                        if (TAO_SUCCESS == getGroupDescription((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::PHONEGROUP_GET_TYPE:
                        if (TAO_SUCCESS == getGroupType((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::PHONEGROUP_IS_ACTIVATED:
                        if (TAO_SUCCESS == isGroupActivated((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;
                case TaoMessage::COMPONENT_RESULT:
                        if (TAO_SUCCESS == returnResult((TaoMessage&)rMsg))
                        {
                                handled = TRUE;
                        }
                        break;

                default:
                  break;
                }
        }
        else if (TaoMessage::RESPONSE_PHONECOMPONENT == msgType)
        {
                if (TAO_SUCCESS == returnResult((TaoMessage&)rMsg))
                        handled = TRUE;
        }

        if (!handled)
        {
                TaoMessage*     pMsg = (TaoMessage*) &rMsg;

                pMsg->setArgCnt(1);
                pMsg->setArgList("-1");

                if (mpSvrTransport->postMessage(*pMsg))
                        handled = TRUE;
        }

        return handled;
}
コード例 #29
0
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);
            pDialog->setRemoteTarget(remoteTarget.toString());
               
            pDialog->setDuration(OsDateTime::getSecsSinceEpoch());
   
            pThisCall->insertDialog(pDialog);
   
            // Insert it into the active call list
            pThisCall->buildBody();

            // Send the content to the subscribe server
            if (!mpSipPublishContentMgr->publish(entity.data(), DIALOG_EVENT_TYPE, DIALOG_EVENT_TYPE, 1, (HttpBody**)&pThisCall, 1, numOldContents, oldContent))
            {
               pThisCall->getBytes(&dialogEvent, &length);
               OsSysLog::add(FAC_SIP, PRI_ERR, "DialogEventPublisher:: Call arrived - DialogEvent %s\n was not successfully published to the subscribe server",
                             dialogEvent.data());
            }
                        
            break;

         case PtEvent::CONNECTION_ESTABLISHED:
            if (localConnection) 
            {
               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, "Call connected: callId %s address %s with request %s",
                             callId.data(), address.data(), entity.data());

               if (entity.isNull())
               {
                  OsSysLog::add(FAC_SIP, PRI_WARNING, "DialogEventPublisher:: Call connected: callId %s address %s without requestUrl", 
                                callId.data(), address.data());
                  break;
               }
               else
               {
                  requestUrl = Url(entity);
                  requestUrl.getIdentity(entity);
               }
               
               pThisCall = (SipDialogEvent *) mCalls.findValue(&entity);
               if (pThisCall == NULL)
               {
                  pEntity = new UtlString(entity);
                  pThisCall = new SipDialogEvent(STATE, entity);
   
                  // Insert it into the active call list
                  mCalls.insertKeyAndValue(pEntity, pThisCall);
               }
               
               // Get the new callId because it might be changed
               sipDialog.getCallId(callId);

               pDialog = pThisCall->getDialog(callId);
               // Update the dialog content if exist
               if (pDialog)
               {
                  sipDialog.getLocalField(localIdentity);
                  localIdentity.getFieldParameter("tag", localTag);
   
                  sipDialog.getRemoteField(remoteIdentity);
                  remoteIdentity.getFieldParameter("tag", remoteTag);
               
                  pDialog->setTags(localTag, remoteTag);
   
                  sipDialog.getLocalContact(localTarget);
                  pDialog->setLocalTarget(localTarget.toString());
   
                  sipDialog.getRemoteContact(remoteTarget);
                  pDialog->setRemoteTarget(remoteTarget.toString());
   
                  pDialog->setState(STATE_CONFIRMED, NULL, NULL);
               }
               else
               {
                  // Create a new 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_CONFIRMED, 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);
                  pDialog->setRemoteTarget(remoteTarget.toString());
   
                  pDialog->setDuration(OsDateTime::getSecsSinceEpoch());
   
                  pThisCall->insertDialog(pDialog);
               }
                   
               pThisCall->buildBody();

               // Publish the content to the subscribe server
               if (!mpSipPublishContentMgr->publish(entity.data(), DIALOG_EVENT_TYPE, DIALOG_EVENT_TYPE, 1, (HttpBody**)&pThisCall, 1, numOldContents, oldContent))
               {
                  pThisCall->getBytes(&dialogEvent, &length);
                  OsSysLog::add(FAC_SIP, PRI_ERR, "DialogEventPublisher:: Call connected - DialogEvent %s\n was not successfully published to the subscribe server",
                                dialogEvent.data());
               }
            }

            break;
            
         case PtEvent::CONNECTION_DISCONNECTED:
            if (!localConnection) 
            {
               mpCallManager->getSipDialog(callId, address, sipDialog);
#ifdef DEBUGGING            
               sipDialog.toString(sipDialogContent);
               OsSysLog::add(FAC_SIP, PRI_DEBUG, "DialogEventPublisher:: sipDialog = %s", 
                             sipDialogContent.data());
#endif            
               sipDialog.getLocalContact(requestUrl);
               requestUrl.getIdentity(entity);

               OsSysLog::add(FAC_SIP, PRI_DEBUG, "Call dropped: %s address %s with entity %s",
                             callId.data(), address.data(), entity.data());

               if (entity.isNull())
               {
                  OsSysLog::add(FAC_SIP, PRI_WARNING, "DialogEventPublisher:: Call dropped: callId %s address %s without requestUrl", 
                                callId.data(), address.data());
                  break;
               }
               
               // Get the new callId because it might be changed
               sipDialog.getCallId(callId);

               // Remove the call from the pool and clean up the call
               pThisCall = (SipDialogEvent *) mCalls.findValue(&entity);
               if (pThisCall)
               {
                  pDialog = pThisCall->getDialog(callId);
                  if (pDialog)
                  {
                     pDialog->setState(STATE_TERMINATED, NULL, NULL);
                   
                     pThisCall->buildBody();

                     // Publish the content to the subscribe server
                     if (!mpSipPublishContentMgr->publish(entity.data(), DIALOG_EVENT_TYPE, DIALOG_EVENT_TYPE, 1, (HttpBody**)&pThisCall, 1, numOldContents, oldContent))
                     {
                        pThisCall->getBytes(&dialogEvent, &length);
                        OsSysLog::add(FAC_SIP, PRI_ERR, "DialogEventPublisher:: Call dropped - DialogEvent %s\n was not successfully published to the subscribe server",
                                      dialogEvent.data());
                     }
                       
                     // Remove the dialog from the dialog event package
                     pDialog = pThisCall->removeDialog(pDialog);
                     delete pDialog;
                  }
                  
                  if (pThisCall->isEmpty())
                  {
                     // Unpublisher the content from the subscribe server
                     if (!mpSipPublishContentMgr->unpublish(entity.data(), DIALOG_EVENT_TYPE, DIALOG_EVENT_TYPE, 1, numOldContents, oldContent))
                     {
                        pThisCall->getBytes(&dialogEvent, &length);
                        OsSysLog::add(FAC_SIP, PRI_ERR, "DialogEventPublisher:: Call dropped - DialogEvent %s\n was not successfully unpublished to the subscribe server",
                                      dialogEvent.data());
                     }
                     
                     UtlContainable *foundValue;
                     mCalls.removeKeyAndValue(pEntity, foundValue);
                     if (foundValue)
                     {
                        OsSysLog::add(FAC_SIP, PRI_DEBUG, "DialogEventPublisher:: remove DialogEvent object %p from the list",
                                      pThisCall);
                        pThisCall = (SipDialogEvent *) foundValue;
                        delete pThisCall;
                        delete pEntity;
                     }
                  }
               }
               else
               {
                  OsSysLog::add(FAC_SIP, PRI_ERR, "DialogEventPublisher:: Call dropped - no entity %s founded in the active call list",
                                entity.data());
               }
            }

            break;
            
         case PtEvent::CONNECTION_FAILED:
            OsSysLog::add(FAC_SIP, PRI_WARNING, "Connection failed on call: %s", callId.data());

            break;
      }
   }
   return(TRUE);
}
コード例 #30
-1
TaoStatus TaoListenerManager::addCallListener(TaoMessage& rMsg)
{
        TaoStatus ret = TAO_SUCCESS;
        UtlString terminalName;

        TaoString str(rMsg.getArgList(), TAOMESSAGE_DELIMITER);
        terminalName = str[0];

        if (terminalName.isNull() || 0 == terminalName.compareTo("0.0.0.0"))
        {
                if (mListenerCnt <= 0)
                {
                        terminalName = "127.0.0.1";
                        osPrintf("WARNING - TaoListenerManager::addCallListener: using invalid host, replaced with %s\n", terminalName.data());
                }
                else
                {
                        osPrintf("WARNING - TaoListenerManager::addCallListener: using invalid host %s, listener not added.\n", terminalName.data());
                        return TAO_FAILURE;
                }
        }

        mpCallMgr->addTaoListener(this);

        ret = addEventListener(terminalName.data(), TRUE);

        return ret;
}