⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phonestateringing.cpp

📁 基于sipfoundy 公司开发的sipx协议API
💻 CPP
字号:
//// Copyright (C) 2004, 2005 Pingtel Corp.// //// $$////////////////////////////////////////////////////////////////////////// SYSTEM INCLUDES// APPLICATION INCLUDES#include "../stdwx.h"#include "../sipXmgr.h"#include "../sipXezPhoneApp.h"#include "PhoneStateIdle.h"#include "PhoneStateDialing.h"#include "PhoneStateRinging.h"#include "PhoneStateAccepted.h"#include "../sipXezPhoneSettings.h"// EXTERNAL FUNCTIONS// EXTERNAL VARIABLESextern sipXezPhoneApp* thePhoneApp;// CONSTANTS// STATIC VARIABLE INITIALIZATIONS// MACRO CALLSPhoneStateRinging::PhoneStateRinging(SIPX_CALL hCall) :     mbPlayingTone(false){   mhCall = hCall;}PhoneStateRinging::~PhoneStateRinging(void){#ifdef VOICE_ENGINE    if (mbPlayingTone)        sipxCallPlayFileStop(sipXmgr::getInstance().getCurrentCall());#else    if (mbPlayingTone)        sipxCallStopTone(mhCall);#endif}PhoneState* PhoneStateRinging::OnFlashButton(){    return (new PhoneStateAccepted(mhCall));}PhoneState* PhoneStateRinging::Execute(){    sipXmgr::getInstance().setCurrentCall(mhCall);         char szIncomingNumber[256];    sipxCallGetRemoteID(mhCall, szIncomingNumber, 256);    wxString incomingNumber(szIncomingNumber);    thePhoneApp->setStatusMessage(incomingNumber);#ifdef VOICE_ENGINE    if (SIPX_RESULT_SUCCESS == sipxCallPlayFileStart(sipXmgr::getInstance().getCurrentCall(), "res/ringTone.raw", true, true, false))    {        mbPlayingTone  = true;    }#else    SIPX_RESULT result;    result = sipxCallStartTone(sipXmgr::getInstance().getCurrentCall(), ID_TONE_RINGTONE, true, false);     if (SIPX_RESULT_SUCCESS == result)    {        mbPlayingTone = true;    }    else    {        mbPlayingTone = false;    }#endif    if (sipXezPhoneSettings::getInstance().getAutoAnswer() == true)    {        // if in Auto Answer mode, go ahead and answer        sipxCallAnswer(sipXmgr::getInstance().getCurrentCall());    }    return this;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -