|
@@ -1,24 +1,22 @@
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
-#include "pthread.h"
|
|
|
#include "mod_sipphone.h"
|
|
|
+#include "y2k_time.h"
|
|
|
|
|
|
#include "../mod_agentip/sysvar.h"
|
|
|
#include "../mod_facetracking/sysvar.h"
|
|
|
+#include "../mod_interactivecontrol/Event.h"
|
|
|
+#include "../mod_mediacontroller/Event.h"
|
|
|
|
|
|
#include "sockutil.h"
|
|
|
|
|
|
#include "rvc_media_common.h"
|
|
|
|
|
|
-#include "../mod_interactivecontrol/Event.h"
|
|
|
-#include "../mod_mediacontroller/Event.h"
|
|
|
+
|
|
|
|
|
|
#include "audio_session.h"
|
|
|
#include "video_session.h"
|
|
|
|
|
|
-
|
|
|
-//#include "volumekeeper.h"
|
|
|
-
|
|
|
#define EVT_CONVERTER "EventConverter"
|
|
|
|
|
|
#define DEVICE_HANDFREE_OUT 0
|
|
@@ -38,7 +36,7 @@
|
|
|
#define RVC_MIN_VIDEO_FRESH_TIME 1
|
|
|
#endif // !RVC_MAX_VIDEO_FRESH_TIME
|
|
|
|
|
|
-extern BOOL g_IsExternalTerminalted;
|
|
|
+extern bool g_IsExternalTerminalted;
|
|
|
|
|
|
static void __on_video_box_move(int imessagetype, int ivideotype, int ileft, int ibottom, void *user_data)
|
|
|
{
|
|
@@ -77,7 +75,7 @@ static int __hangup_call(void *user_data)
|
|
|
|
|
|
static int __control_video(void *arg)
|
|
|
{
|
|
|
- ControlVideoCommand_t*pCmd = (ControlVideoCommand_t*)(arg);
|
|
|
+ ControlVideoCommand_t* pCmd = (ControlVideoCommand_t*)(arg);
|
|
|
pCmd->pSIPPhoneSession->control_video(pCmd);
|
|
|
delete pCmd;
|
|
|
return 0;
|
|
@@ -102,6 +100,23 @@ static int __release_call(void *user_data)
|
|
|
}
|
|
|
|
|
|
|
|
|
+static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
|
|
|
+{
|
|
|
+ int n = vsnprintf(NULL, 0,fmt, arg);
|
|
|
+ if (n >= 512) {
|
|
|
+ char* buf = (char*)malloc((size_t)(n + 1));
|
|
|
+ vsnprintf(buf, n + 1, fmt, arg);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", buf);
|
|
|
+ free(buf);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ char strlog[512] = { 0 };
|
|
|
+ vsnprintf(strlog, 512, fmt, arg);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", strlog);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static void __video_render_log(render_loglevel elevel, void* user_data, const char* fmt, va_list arg)
|
|
|
{
|
|
|
int n = vsnprintf(NULL, 0, fmt, arg);
|
|
@@ -153,14 +168,12 @@ static CSimpleStringA generateAudioInfoJson(const char* handfreeIn, const char*
|
|
|
handfreeIn, handfreeOut, pickupIn, pickupOut);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
static CSimpleStringA generateVolumeJson(int ihandfreeIn, int ihandfreeOut, int ipickupIn, int ipickupOut)
|
|
|
{
|
|
|
return CSimpleStringA::Format("{\"handfree_in_volume\":\"%d\",\"handfree_out_volume\":\"%d\",\"pickup_in_volume\":\"%d\",\"pickup_out_volume\":\"%d\"}",
|
|
|
ihandfreeIn, ihandfreeOut, ipickupIn, ipickupOut);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
static CSimpleStringA generateAudioDspFlags(endpoint_audiodsp_config_t conf)
|
|
|
{
|
|
|
int ipickup_in_agc = 0;
|
|
@@ -193,7 +206,16 @@ static CSimpleStringA generateAudioDspFlags(endpoint_audiodsp_config_t conf)
|
|
|
ihandfree_aec, ipickup_aec);
|
|
|
}
|
|
|
|
|
|
+static int countnum(uint32_t unum)
|
|
|
+{
|
|
|
+ int icount = 0;
|
|
|
+ while (unum){
|
|
|
+ unum &= (unum - 1);
|
|
|
+ icount++;
|
|
|
+ }
|
|
|
|
|
|
+ return icount;
|
|
|
+}
|
|
|
|
|
|
CSIPPhoneSession::CSIPPhoneSession(CSIPEntity* pEntity) : m_pEntity(pEntity), m_pCall(NULL), m_iLastState(0)
|
|
|
{
|
|
@@ -217,16 +239,21 @@ CSIPEntity::CSIPEntity() : m_pCurrentSession(NULL), m_state(INIT),m_iPickupPhone
|
|
|
m_ilocalvideo_freshtime = RVC_VIDEO_FRESH_TIME;
|
|
|
m_iremotevideo_freshtime = RVC_VIDEO_FRESH_TIME;
|
|
|
m_render = NULL;
|
|
|
+ m_strStartTime = RVC_START_TIME;
|
|
|
+ m_strEndTime = RVC_END_TIME;
|
|
|
+ m_itervalTime = RVC_INTERVAL_TIME;
|
|
|
+ m_bStopAutoRestart = false;
|
|
|
m_iAudioDspUseCenter = 0;
|
|
|
|
|
|
m_nCallType = NORMAL_CALLTYPE;
|
|
|
memset(m_localip, 0, RVC_MAX_IP_LEN);
|
|
|
+ m_bFirstLaunched = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
|
|
|
- const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
- const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext& pLinkInfo)
|
|
|
+ const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
+ const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
|
|
|
{
|
|
|
switch (dwUserCode)
|
|
|
{
|
|
@@ -236,6 +263,9 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
if (m_pSipphoneChannel != NULL){
|
|
|
m_bConnectedAssist = false;
|
|
|
m_pSipphoneChannel->GetFunction()->CloseSession();
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ m_pSipphoneChannel->SafeDelete();
|
|
|
+#endif
|
|
|
m_pSipphoneChannel = NULL;
|
|
|
}
|
|
|
|
|
@@ -294,7 +324,6 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
// 话筒模式开始远程双录连线
|
|
|
m_iPickupPhoneState = ePickupMicrophoneState_On;
|
|
|
}
|
|
|
-
|
|
|
if (old_state != m_iPickupPhoneState)
|
|
|
{
|
|
|
if (m_iPickupPhoneState == ePickupMicrophoneState_On)
|
|
@@ -478,6 +507,16 @@ void CSIPEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const ch
|
|
|
m_stVideoParam.iCameraSwitch = CAMERA_TYPE_AUTO;
|
|
|
}
|
|
|
}
|
|
|
+ if (_stricmp(pszKey, "UIState") == 0)
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UIState %s -> %s.", pszOldValue, pszValue);
|
|
|
+ if (pszOldValue[0] == 'X' && pszValue[0] == 'M')
|
|
|
+ {
|
|
|
+ if (false == m_bFirstLaunched) {
|
|
|
+ m_bFirstLaunched = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -497,8 +536,6 @@ void CSIPEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITr
|
|
|
|
|
|
void CSIPEntity::OnStarted()
|
|
|
{
|
|
|
- LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_ENTITY_STARTED, "sipphone entity started.");
|
|
|
-
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
m_pHMClient = new HealthManagerService_ClientBase(this);
|
|
|
Error = m_pHMClient->Connect();
|
|
@@ -522,46 +559,55 @@ void CSIPEntity::OnStarted()
|
|
|
LogWarn(Severity_Middle, Error_NetBroken, ERROR_MOD_SIP_GET_LOCAL_IP_FAILED, strErrMsg.GetData());
|
|
|
}
|
|
|
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_MOD_SIPPHONE_STARTED_SUCCESS, "sip phone started successfully.");
|
|
|
-}
|
|
|
-
|
|
|
-static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
|
|
|
-{
|
|
|
- int n = _vscprintf(fmt, arg);
|
|
|
- if (n >= 512) {
|
|
|
- char* buf = (char*)malloc((size_t)(n + 1));
|
|
|
- vsnprintf(buf, n + 1, fmt, arg);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", buf);
|
|
|
- free(buf);
|
|
|
- }
|
|
|
- else {
|
|
|
- char strlog[512] = { 0 };
|
|
|
- vsnprintf(strlog, 512, fmt, arg);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", strlog);
|
|
|
- }
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_MOD_SIPPHONE_STARTED_SUCCESS, "sipphone entity started successfully.");
|
|
|
+ LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_ENTITY_STARTED, "sipphone entity started.");
|
|
|
}
|
|
|
|
|
|
|
|
|
ErrorCodeEnum CSIPEntity::LoadEntityConfig()
|
|
|
{
|
|
|
SpIniMappingTable table;
|
|
|
+ int iTime = RVC_INTERVAL_TIME;
|
|
|
+ int iStopRestartFlag = 0;
|
|
|
+ CSimpleStringA strStartTime;
|
|
|
+ CSimpleStringA strEndTime;
|
|
|
int iAudioDspUseCenter = 0;
|
|
|
|
|
|
table.AddEntryInt("SipPhone", "AudioDspUseCenter", iAudioDspUseCenter, 0);
|
|
|
+ table.AddEntryInt("SipPhone", "ReStartInterVal", iTime, RVC_INTERVAL_TIME);
|
|
|
+ table.AddEntryInt("SipPhone", "StopAutoRestartFlag", iStopRestartFlag, 0);
|
|
|
+ table.AddEntryString("SipPhone", "StartTime", strStartTime, "$");
|
|
|
+ table.AddEntryString("SipPhone", "EndTime", strEndTime, "$");
|
|
|
+
|
|
|
|
|
|
CSmartPointer<IConfigInfo> spConfig;
|
|
|
ErrorCodeEnum Error = GetFunction()->OpenConfig(Config_CenterSetting, spConfig);
|
|
|
if (Error == Error_Succeed) {
|
|
|
Error = table.Load(spConfig);
|
|
|
- if (Error_Succeed == Error) {
|
|
|
+ if (Error_Succeed == Error){
|
|
|
m_iAudioDspUseCenter = iAudioDspUseCenter;
|
|
|
+
|
|
|
+ if (iTime >= RVC_INTERVAL_TIME/3){
|
|
|
+ m_itervalTime = iTime;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (1 == iStopRestartFlag){
|
|
|
+ m_bStopAutoRestart = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strStartTime.GetLength() > 1 && _stricmp(strStartTime.GetData(), RVC_START_TIME) >= 0) {
|
|
|
+ m_strStartTime = strStartTime;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strEndTime.GetLength() > 1 && _stricmp(strEndTime.GetData(), RVC_END_TIME) <= 0) {
|
|
|
+ m_strEndTime = strEndTime;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
ErrorCodeEnum CSIPEntity::ConnectAssistChannel()
|
|
|
{
|
|
|
if (NULL == m_pSipphoneChannel) {
|
|
@@ -614,10 +660,77 @@ ErrorCodeEnum CSIPEntity::ConnectAssistChannel()
|
|
|
}
|
|
|
|
|
|
|
|
|
+void CSIPEntity::HandleUSBAudioDeviceErrorEvent()
|
|
|
+{
|
|
|
+ struct tm* ptm = NULL;
|
|
|
+ time_t t = time(NULL);
|
|
|
+ ptm = localtime(&t);
|
|
|
+ char strNow[MAX_PATH] = { 0 };
|
|
|
+ char strTime[MAX_PATH] = { 0 };
|
|
|
+ _snprintf(strNow, MAX_PATH, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
|
|
+
|
|
|
+ unsigned int utime = y2k_time_now();
|
|
|
+ y2k_to_string(utime, strTime, MAX_PATH);
|
|
|
+ if (_stricmp(strNow, m_strStartTime.GetData()) < 0 || _stricmp(strNow, m_strEndTime.GetData()) >= 0) {
|
|
|
+ GetFunction()->SetTimer(RVC_ENTER_HOME_PAGE_TIMER, this, 1000);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ unsigned int ulasttime = 0;
|
|
|
+ LoadRestartRunConfig(ulasttime);
|
|
|
+ if (utime - ulasttime > m_itervalTime * 60) {
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_SIPPHONE_RETART_REQUEST, "请求重启机器");
|
|
|
+ if (Error_Succeed != SaveRestartRunConfig(utime)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Save Run Config Restart time[%s] failed.", strTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ LogEvent(Severity_High, EVENT_MOD_SIP_RESART, "LogEvent Restart Event!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//载入运行时配置
|
|
|
+ErrorCodeEnum CSIPEntity::LoadRestartRunConfig(unsigned int& utime)
|
|
|
+{
|
|
|
+ CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
+ CSmartPointer<IConfigInfo> spConfig;
|
|
|
+ ErrorCodeEnum Error = spFunction->OpenConfig(Config_Run, spConfig);
|
|
|
+ if (Error == Error_Succeed)
|
|
|
+ {
|
|
|
+ SpIniMappingTable table;
|
|
|
+ table.AddEntryUInt("AutoResart", "time", utime, 0);
|
|
|
+ Error = table.Load(spConfig);
|
|
|
+ if (Error != Error_Succeed){
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("failed to load run config.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("failed to open run config.");
|
|
|
+ }
|
|
|
+
|
|
|
+ return Error;
|
|
|
+}
|
|
|
+
|
|
|
+//保存运行时
|
|
|
+ErrorCodeEnum CSIPEntity::SaveRestartRunConfig(unsigned int utime)
|
|
|
+{
|
|
|
+ CSmartPointer<IEntityFunction> spFunction = GetFunction();;
|
|
|
+ CSmartPointer<IConfigInfo> spConfig;
|
|
|
+ ErrorCodeEnum Error = spFunction->OpenConfig(Config_Run, spConfig);
|
|
|
+ if (Error == Error_Succeed){
|
|
|
+ Error = spConfig->WriteConfigValueInt("AutoResart", "time", utime);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("AutoResart is fail , open sipphone.ini fail!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return Error;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
{
|
|
|
- ErrorCodeEnum Error;
|
|
|
- //MessageBoxA(0,0,0,0);
|
|
|
+ ErrorCodeEnum Error = Error_Succeed;
|
|
|
m_nCallType = NORMAL_CALLTYPE;
|
|
|
m_pSipphoneChannel = new ChannelSipphoneClient(this);
|
|
|
|
|
@@ -653,12 +766,31 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
Error = LoadConfig(&conf);
|
|
|
if (Error != Error_Succeed) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("load config failed!");
|
|
|
- return Error;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (IsPostAudioConfigInfo()) {
|
|
|
LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DEVICE_INFO, generateAudioInfoJson(conf.audio_handfree_in_dev, conf.audio_handfree_out_dev, conf.audio_pickup_in_dev, conf.audio_pickup_out_dev).GetData());
|
|
|
}
|
|
|
+ else {
|
|
|
+ //有配置为空的,进关门页
|
|
|
+ return Error_Param;
|
|
|
+ }
|
|
|
+
|
|
|
+ uint32_t uCheckRet = CheckAudioDevice();
|
|
|
+ if (RVC_AUDIO_NO_ERROR == uCheckRet) {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("no audio device config error.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("error audio device number is %d.", countnum(uCheckRet));
|
|
|
+ if (countnum(uCheckRet) >= 3) { //故障设备数大于3个或以上
|
|
|
+ return Error_Param;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (uCheckRet = RVC_AUDIO_HANDFREEIN_ERROR | RVC_AUDIO_HANDFREEOUT_ERROR) {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("can't find usb audio device.");
|
|
|
+ HandleUSBAudioDeviceErrorEvent();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
int nhandfreeout = 0;
|
|
|
int npickupout = 0;
|
|
@@ -687,12 +819,6 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
#ifdef RVC_OS_LINUX
|
|
|
RvcSetSaveAudioVolume();
|
|
|
#endif
|
|
|
-
|
|
|
- {
|
|
|
- CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
- Func->GetSystemStaticInfo(staticInfo);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
{
|
|
|
CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
@@ -819,48 +945,42 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ {
|
|
|
+ CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
+ CSimpleStringA strValue("");
|
|
|
+ Func->RegistSysVarEvent("UIState", this);
|
|
|
+ Func->GetSysVar("UIState", strValue);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UIState %s.", strValue.GetData());
|
|
|
+ }
|
|
|
+
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (m_kept_volume_in[DEV_HANDFREE]) {
|
|
|
m_pKeeperIn[DEV_HANDFREE] = volume_keeper_create(conf.audio_handfree_in_dev, 1, m_kept_volume_in[DEV_HANDFREE]);
|
|
|
- if (m_pKeeperIn[DEV_HANDFREE]) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("HANDFREE in volume keeper create ok! %d", m_kept_volume_in[DEV_HANDFREE]);
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (!m_pKeeperIn[DEV_HANDFREE]) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("HANDFREE in volume keeper create failed!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (m_kept_volume_out[DEV_HANDFREE]) {
|
|
|
m_pKeeperOut[DEV_HANDFREE] = volume_keeper_create(conf.audio_handfree_out_dev, 0, m_kept_volume_out[DEV_HANDFREE]);
|
|
|
- if (m_pKeeperOut[DEV_HANDFREE]) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("HANDFREE out volume keeper create ok! %d", m_kept_volume_out[DEV_HANDFREE]);
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (!m_pKeeperOut[DEV_HANDFREE]) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("HANDFREE out volume keeper create failed!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (m_kept_volume_in[DEV_PICKUP]&&(eStand2sType == m_eDeviceType)){
|
|
|
m_pKeeperIn[DEV_PICKUP] = volume_keeper_create(conf.audio_pickup_in_dev, 1, m_kept_volume_in[DEV_PICKUP]);
|
|
|
- if (m_pKeeperIn[DEV_PICKUP]) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PICKUP in volume keeper create ok! %d", m_kept_volume_in[DEV_PICKUP]);
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (!m_pKeeperIn[DEV_PICKUP]) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("PICKUP in volume keeper create failed!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (m_kept_volume_out[DEV_PICKUP]&&(eStand2sType == m_eDeviceType)){
|
|
|
m_pKeeperOut[DEV_PICKUP] = volume_keeper_create(conf.audio_pickup_out_dev, 0, m_kept_volume_out[DEV_PICKUP]);
|
|
|
- if (m_pKeeperOut[DEV_PICKUP]) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PICKUP out volume keeper create ok! %d", m_kept_volume_out[DEV_PICKUP]);
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (!m_pKeeperOut[DEV_PICKUP]) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("PICKUP out volume keeper create failed!");
|
|
|
}
|
|
|
}
|
|
|
-#else
|
|
|
-
|
|
|
#endif // RVC_OS_WIN
|
|
|
return Error_Succeed;
|
|
|
}
|
|
@@ -1096,6 +1216,7 @@ ErrorCodeEnum CSIPEntity::RvcGetAudioDeviceInfo()
|
|
|
ErrorCodeEnum CSIPEntity::RvcSetSaveAudioVolume()
|
|
|
{
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
+
|
|
|
if (m_pAudioMgr){
|
|
|
m_pAudioMgr->audio_set_device_volume(m_kept_volume_out[DEV_HANDFREE], conf.audio_handfree_out_dev, false);
|
|
|
m_pAudioMgr->audio_set_device_volume(m_kept_volume_in[DEV_HANDFREE], conf.audio_handfree_in_dev, true);
|
|
@@ -1502,7 +1623,8 @@ ErrorCodeEnum CSIPEntity::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
Func->UnregistSysVarEvent(SYSVAR_AGENTCAMERASWITCH);
|
|
|
Func->UnregistSysVarEvent(SYSVAR_ACTIVETRACKINGCAMERA);
|
|
|
Func->UnregistSysVarEvent(SYSVAR_CAMERASTATE);
|
|
|
-
|
|
|
+ Func->UnregistSysVarEvent("UIState");
|
|
|
+
|
|
|
for (i = 0; i < m_arrListener.GetCount(); ++i) {
|
|
|
Func->UnsubscribeLog(m_arrListener[i]);
|
|
|
}
|
|
@@ -1542,12 +1664,6 @@ void CSIPEntity::OnTimeout(DWORD dwTimerID)
|
|
|
{
|
|
|
if (dwTimerID == 1)
|
|
|
{
|
|
|
- //如果当前动态帧频不等于之前的帧频,发送当前帧频
|
|
|
- //if (g_nDynamicFps != m_nDownDynamicFps)
|
|
|
- //{
|
|
|
- // m_nDownDynamicFps = g_nDynamicFps;
|
|
|
- // SendDynamicFps(g_nDynamicFps);
|
|
|
- //}
|
|
|
GetFunction()->KillTimer(1);
|
|
|
m_stVideoParam.nUpDynamicFps = -1;
|
|
|
}
|
|
@@ -1563,6 +1679,18 @@ void CSIPEntity::OnTimeout(DWORD dwTimerID)
|
|
|
GetFunction()->KillTimer(2);
|
|
|
}
|
|
|
}
|
|
|
+ else if (RVC_ENTER_HOME_PAGE_TIMER == dwTimerID) {
|
|
|
+ if (m_bFirstLaunched) {
|
|
|
+ Sleep(2000);
|
|
|
+ UIMessageBox evt;
|
|
|
+ evt.uboxtype = 2;
|
|
|
+ evt.strtitle = CSimpleStringA2W("声卡识别故障");
|
|
|
+ evt.strmessage = CSimpleStringA2W("识别不到USB声卡,请尝试重启机器解决,多次无效后请联系厂商处理");
|
|
|
+ SpSendBroadcast(GetFunction(), SP_MSG_OF(UIMessageBox), SP_MSG_SIG_OF(UIMessageBox), evt);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SpSendBroadcast UIMessageBox.");
|
|
|
+ GetFunction()->KillTimer(RVC_ENTER_HOME_PAGE_TIMER);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2038,7 +2166,7 @@ void CSIPPhoneSession::Handle_ReleaseCall( SpReqAnsContext<PhoneService_ReleaseC
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
int rc = Error_Succeed;
|
|
|
- g_IsExternalTerminalted = TRUE;
|
|
|
+ g_IsExternalTerminalted = true;
|
|
|
endpoint_invoke(m_pEntity->GetEndpoint(), &__release_call, this, &rc);
|
|
|
if (NULL != m_pEntity->m_pEndpoint){
|
|
|
endpoint_destroy(m_pEntity->m_pEndpoint);
|
|
@@ -2065,9 +2193,9 @@ void CSIPPhoneSession::Handle_StartVideo( SpOnewayCallContext<PhoneService_Start
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
int rc;
|
|
|
- ControlVideoCommand_t *pCmd = new ControlVideoCommand_t();
|
|
|
+ ControlVideoCommand_t*pCmd = new ControlVideoCommand_t();
|
|
|
pCmd->pSIPPhoneSession = this;
|
|
|
- pCmd->start = TRUE;
|
|
|
+ pCmd->start = true;
|
|
|
pCmd->local_hwd_move = 0;
|
|
|
pCmd->remote_hwd_move = 0;
|
|
|
pCmd->local_ip = inet_addr(m_pEntity->m_localip);
|
|
@@ -2098,7 +2226,7 @@ void CSIPPhoneSession::Handle_StopVideo( SpOnewayCallContext<PhoneService_StopVi
|
|
|
int rc;
|
|
|
ControlVideoCommand_t *pCmd = new ControlVideoCommand_t();
|
|
|
pCmd->pSIPPhoneSession = this;
|
|
|
- pCmd->start = FALSE;
|
|
|
+ pCmd->start = false;
|
|
|
m_pEntity->GetFunction()->KillTimer(1);
|
|
|
if (NULL != m_pEntity->GetEndpoint()){
|
|
|
endpoint_invoke(m_pEntity->GetEndpoint(), &__control_video, pCmd, &rc);
|
|
@@ -2154,7 +2282,6 @@ void CSIPPhoneSession::Handle_GetHandfreeInVolume(SpReqAnsContext<PhoneService_G
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
ctx->Ans.Volume = m_pEntity->m_kept_volume_in[DEV_HANDFREE];
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get hand free in volume is %d.", ctx->Ans.Volume);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
@@ -2198,7 +2325,6 @@ void CSIPPhoneSession::Handle_GetPickupInVolume(SpReqAnsContext<PhoneService_Get
|
|
|
else {
|
|
|
ctx->Ans.Volume = 0;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get pick up in volume is %d.", ctx->Ans.Volume);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
@@ -2232,7 +2358,6 @@ void CSIPPhoneSession::Handle_GetHandfreeOutVolume(SpReqAnsContext<PhoneService_
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
ctx->Ans.Volume = m_pEntity->m_kept_volume_out[DEV_HANDFREE];
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get hand free out volume is %d.", ctx->Ans.Volume);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
@@ -2263,7 +2388,6 @@ void CSIPPhoneSession::Handle_GetPickupOutVolume(SpReqAnsContext<PhoneService_Ge
|
|
|
ctx->Ans.Volume = 0;
|
|
|
}
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get pickup out volume is %d.", ctx->Ans.Volume);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
@@ -2350,14 +2474,13 @@ int CSIPPhoneSession::make_call( MakeCallCommand_t *pCmd)
|
|
|
m_pCall = endpoint_call_create(m_pEntity->GetEndpoint(), &t_callparam, &cb);
|
|
|
if (m_pCall)
|
|
|
{
|
|
|
- g_IsExternalTerminalted = FALSE;
|
|
|
+ g_IsExternalTerminalted = false;
|
|
|
if (endpoint_call_start(m_pCall) == 0)
|
|
|
{
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start call failed! and endpoint destroy call.");
|
|
|
endpoint_call_destroy(m_pCall);
|
|
|
m_pCall = NULL;
|
|
|
return Error_Unexpect;
|
|
@@ -2365,8 +2488,7 @@ int CSIPPhoneSession::make_call( MakeCallCommand_t *pCmd)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- g_IsExternalTerminalted = TRUE;
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("g_IsExternalTerminalted = TRUE");
|
|
|
+ g_IsExternalTerminalted = true;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create call endpoint failed!");
|
|
|
m_pEntity->m_SipErrorCode = Error_InvalidState;
|
|
|
m_pEntity->RealSelfCheck();
|
|
@@ -2524,7 +2646,6 @@ int CSIPPhoneSession::on_video_box_move(int imessageType, int ivideotype, int il
|
|
|
evt.leftlowerx = ileft;
|
|
|
evt.leftlowery = ibottom;
|
|
|
iret = SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(VideoBoxStartMove), SP_MSG_SIG_OF(VideoBoxStartMove), evt);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("VideoBoxStartMove broadcast sent, video type is %d, left is %d, bottom is %d.", ivideotype, ileft, ibottom);
|
|
|
}
|
|
|
else{
|
|
|
VideoBoxStopMove evt;
|
|
@@ -2532,7 +2653,6 @@ int CSIPPhoneSession::on_video_box_move(int imessageType, int ivideotype, int il
|
|
|
evt.leftlowerx = ileft;
|
|
|
evt.leftlowery = ibottom;
|
|
|
iret = SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(VideoBoxStopMove), SP_MSG_SIG_OF(VideoBoxStopMove), evt);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("VideoBoxStopMove broadcast sent, video type is %d, left is %d, bottom is %d.", ivideotype, ileft, ibottom);
|
|
|
}
|
|
|
|
|
|
return iret;
|
|
@@ -2599,7 +2719,6 @@ void ChannelSipphoneClient::OnMessage( ErrorCodeEnum Error, ChannelService_Packe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
SP_BEGIN_ENTITY_MAP()
|
|
|
SP_ENTITY(CSIPEntity)
|
|
|
SP_END_ENTITY_MAP()
|