|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
#include "Event.h"
|
|
|
#include "callrouter.h"
|
|
|
+#include "../include/EventCode.h"
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
#include "resource.h"
|
|
@@ -36,10 +37,6 @@ using namespace CounterConnector;
|
|
|
#include "../mod_interactioncontext/InteractionContext_def_g.h"
|
|
|
using namespace InteractionContext;
|
|
|
|
|
|
-#include "../mod_livenessdetection/LivenessDetection_client_g.h"
|
|
|
-#include "../mod_livenessdetection/LivenessDetection_msg_g.h"
|
|
|
-using namespace LivenessDetection;
|
|
|
-
|
|
|
#include <vector>
|
|
|
#include <string>
|
|
|
|
|
@@ -267,6 +264,17 @@ public:
|
|
|
FSM_RULE_ENTRY_ANY(s62, s63, USER_EVT_SIP_STATE_IDLE)
|
|
|
FSM_RULE_ENTRY_ANY(s62, s63, USER_EVT_JMP_FAIL)
|
|
|
FSM_RULE_ENTRY_ANY(s63, s0, EVT_TIMER)
|
|
|
+ //assitchannel重启后,状态跳转到Offline
|
|
|
+ FSM_RULE_ENTRY_ANY(s3, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s4, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s50, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s51, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s52, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s53, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s60, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s61, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s62, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
+ FSM_RULE_ENTRY_ANY(s63, s0, USER_EVT_ASSISTCHAN_IDEL)
|
|
|
//sipphone重启后,所有状态跳转到Offline
|
|
|
FSM_RULE_ENTRY_ANY(s8, s0, USER_EVT_SIPPHONE_IDEL)
|
|
|
FSM_RULE_ENTRY_ANY(s10, s0, USER_EVT_SIPPHONE_IDEL)
|
|
@@ -383,14 +391,19 @@ public:
|
|
|
void s63_on_entry();
|
|
|
void s63_on_exit();
|
|
|
unsigned int s63_on_event(FSMEvent* event);
|
|
|
+
|
|
|
BOOL m_bHangup;
|
|
|
//sip呼叫失败次数,连续10次SIP呼叫失败触发自检重启SIPPHONE
|
|
|
unsigned int m_nSipErrorNum;
|
|
|
unsigned int m_nLiveDetctionTime;
|
|
|
|
|
|
+ BOOL ReConnectionAssistchan();
|
|
|
+ BOOL ReConnectionSipphone();
|
|
|
+ BOOL ReConnectionSyncService();
|
|
|
+
|
|
|
ErrorCodeEnum StartVideo(const char *param)
|
|
|
{
|
|
|
- Dbg("Start Video");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Video");
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
PhoneService_StartVideo_Info Info;
|
|
@@ -400,22 +413,22 @@ public:
|
|
|
Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy);
|
|
|
Info.local_hwd_move = 0;
|
|
|
Info.remote_hwd_move = 1;
|
|
|
- Dbg("start video, remote width:%d, remote height:%d, local(%d,%d,%d,%d),remote(%d,%d,%d,%d), remote_fps:%d",
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start video, remote width:%d, remote height:%d, local(%d,%d,%d,%d),remote(%d,%d,%d,%d), remote_fps:%d",
|
|
|
Info.remote_width, Info.remote_height,
|
|
|
Info.local_view_x, Info.local_view_y, Info.local_view_cx, Info.local_view_cy,
|
|
|
- Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy,Info.remote_fps);
|
|
|
+ Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy, Info.remote_fps);
|
|
|
if (Error == Error_Succeed) {
|
|
|
Error = m_pPhoneClient->StartVideo(Info);
|
|
|
}
|
|
|
else {
|
|
|
- Dbg("parse video desc failed!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse video desc failed!");
|
|
|
}
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum StopVideo()
|
|
|
{
|
|
|
- Dbg("Stop Video");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Video");
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
return m_pPhoneClient->StopVideo();
|
|
@@ -454,7 +467,7 @@ public:
|
|
|
|
|
|
ErrorCodeEnum RealSipErrorCheck()
|
|
|
{
|
|
|
- Dbg("Sip connect Fail 6 times,RealSipErrorCheck!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Sip connect Fail 6 times,RealSipErrorCheck!");
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
return m_pPhoneClient->RealErrorCheck();
|
|
@@ -465,7 +478,7 @@ public:
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
|
|
|
- Dbg("SetCallingType = %d.", eType);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetCallingType = %d.", eType);
|
|
|
|
|
|
PhoneService_SetCallingParam_Info info;
|
|
|
info.CallType = eType;
|
|
@@ -483,11 +496,11 @@ public:
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("MSClient connected success!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("MSClient connected success!");
|
|
|
rc = pMSClient->StopSpeakerRender();
|
|
|
- Dbg("pMSClient->StopSpeakerRender rc:0x%08x",rc);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pMSClient StopSpeakerRender rc:0x%08x",rc);
|
|
|
if(rc != Error_Succeed){
|
|
|
- Dbg("Stop Speaker Render failed return 0x%08x", rc);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Speaker Render failed return 0x%08x", rc);
|
|
|
}
|
|
|
|
|
|
pMSClient->GetFunction()->CloseSession();
|
|
@@ -496,34 +509,6 @@ public:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
- ErrorCodeEnum GetLivenessDetectionStatus()
|
|
|
- {
|
|
|
- ErrorCodeEnum rc = Error_InvalidState;
|
|
|
- LivenessDetectionService_ClientBase* pLDClient = new LivenessDetectionService_ClientBase(m_pEntity);
|
|
|
- if(pLDClient->Connect() != Error_Succeed)
|
|
|
- {
|
|
|
- pLDClient->SafeDelete();
|
|
|
- pLDClient = NULL;
|
|
|
- }
|
|
|
- else{
|
|
|
- rc = Error_Succeed;
|
|
|
- Dbg("connect liveness detection entity success!");
|
|
|
- pLDClient->GetFunction()->CloseSession();
|
|
|
- pLDClient = NULL;
|
|
|
- }
|
|
|
- return rc;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- ErrorCodeEnum StopLivenessDetection()
|
|
|
- {
|
|
|
- Dbg("stop liveness detection.");
|
|
|
- LogEvent(Severity_Middle,LOG_EVT_STOPLIVEDETECTNOTICEDISPLAY,"stop live detection notice display.");
|
|
|
- LogEvent(Severity_Middle,LOG_EVT_STOPLIVEDETECTDISPLAY,"stop live detection");
|
|
|
- PostEventFIFO(new FSMEvent(USER_EVT_STOPVIDEODISPLAY));
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
-
|
|
|
private:
|
|
|
|
|
|
int TranslateState(int innerState);
|
|
@@ -554,7 +539,7 @@ private:
|
|
|
ErrorCodeEnum GetLocalIP(char *buff, size_t ulen)
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- char tmp[256];
|
|
|
+ char tmp[MAX_PATH] = {0};
|
|
|
gethostname(tmp, sizeof(tmp));
|
|
|
hostent *ent = gethostbyname(tmp);
|
|
|
if (ent) {
|
|
@@ -567,7 +552,7 @@ private:
|
|
|
if(strstr(p,"198.168.") == NULL)
|
|
|
{
|
|
|
strcpy(buff, p);
|
|
|
- Dbg("local ip == %s", buff);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("local ip == %s", buff);
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
}
|
|
@@ -671,7 +656,7 @@ private:
|
|
|
info.connect_ip = callingparam.connect_ip;
|
|
|
info.connect_port = callingparam.connect_port;
|
|
|
m_pPhoneClient->SetCallingParam(info);
|
|
|
- Dbg("Make Distribute Call CallType = %d, to_uri:%s", info.CallType, Req.to_uri.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Make Distribute Call CallType = %d, to_uri:%s", info.CallType, Req.to_uri.GetData());
|
|
|
|
|
|
ErrorCodeEnum Error = m_pPhoneClient->MakeCall(Req, Ans, 10000);
|
|
|
return Error;
|
|
@@ -700,7 +685,7 @@ private:
|
|
|
}
|
|
|
m_pPhoneClient->SetCallingParam(info);
|
|
|
|
|
|
- Dbg("before make call, call type is %d, to_uri:%s", info.CallType, Req.to_uri.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("before make call, call type is %d, to_uri:%s", info.CallType, Req.to_uri.GetData());
|
|
|
ErrorCodeEnum Error = m_pPhoneClient->MakeCall(Req, Ans, 10000);
|
|
|
return Error;
|
|
|
}
|
|
@@ -724,7 +709,7 @@ private:
|
|
|
info.connect_ip = callingparam.connect_ip;
|
|
|
info.connect_port = callingparam.connect_port;
|
|
|
m_pPhoneClient->SetCallingParam(info);
|
|
|
- Dbg("before make call, call type is %d, to_uri:%s, from_uri:%s, call_id:%s", info.CallType, to_uri, from_uri, call_id);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("before make call, call type is %d, to_uri:%s, from_uri:%s, call_id:%s", info.CallType, to_uri, from_uri, call_id);
|
|
|
|
|
|
ErrorCodeEnum Error = m_pPhoneClient->MakeCall(Req, Ans, 10000);
|
|
|
return Error;
|
|
@@ -732,7 +717,7 @@ private:
|
|
|
|
|
|
ErrorCodeEnum HangupCall()
|
|
|
{
|
|
|
- Dbg("Hangup Call!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Hangup Call!");
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
PhoneService_HangupCall_Req Req;
|
|
@@ -740,12 +725,12 @@ private:
|
|
|
if (!m_SessionParam.connect_session.IsNullOrEmpty())
|
|
|
{
|
|
|
Req.session_num = m_SessionParam.connect_session;
|
|
|
- Dbg("Hangup Call connect_session = %s", m_SessionParam.connect_session.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Hangup Call connect_session = %s", m_SessionParam.connect_session.GetData());
|
|
|
}
|
|
|
if (!m_SessionParam.connect_ip.IsNullOrEmpty())
|
|
|
{
|
|
|
Req.branch_server_ip = m_SessionParam.connect_ip;
|
|
|
- Dbg("Hangup Call connect_ip = %s", m_SessionParam.connect_ip.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Hangup Call connect_ip = %s", m_SessionParam.connect_ip.GetData());
|
|
|
}
|
|
|
if (m_SessionParam.event_port)
|
|
|
{
|
|
@@ -773,7 +758,6 @@ private:
|
|
|
{
|
|
|
return Error_Param;
|
|
|
}
|
|
|
- Dbg("nChanServer = %d, ChanProxyIP[%s], ChanCallNum[%s], ChanProxyPort[%d]", nChanServer, m_strChanProxyIP[nChanServer].GetData(), m_strChanCallNum[nChanServer].GetData(), m_iChanProxyPort[nChanServer]);
|
|
|
ChannelService_Connect_Req Req;
|
|
|
ChannelService_Connect_Ans Ans;
|
|
|
Req.callno = m_strChanCallNum[nChanServer];
|
|
@@ -842,7 +826,7 @@ private:
|
|
|
|
|
|
ErrorCodeEnum StopChannel()
|
|
|
{
|
|
|
- Dbg("stop channel");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop channel");
|
|
|
if (!m_pPhoneClient)
|
|
|
return Error_NetBroken;
|
|
|
|
|
@@ -931,7 +915,7 @@ private:
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
else {
|
|
|
- Dbg("play sound failed!%d", GetLastError());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play sound failed!%d", GetLastError());
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
#else
|
|
@@ -977,13 +961,11 @@ private:
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
|
- BOOL ReConnectionAssistchan();
|
|
|
- BOOL ReConnectionSipphone();
|
|
|
int GetDelayTime();
|
|
|
void SetDelayTime();
|
|
|
int ParseDefaultServer(const char* strServer);
|
|
|
int GetFailedErrorCode(int iSrcState);
|
|
|
-
|
|
|
+ int LogFailedWarns(int iFailedCode, const char* strmsg);
|
|
|
public:
|
|
|
BOOL m_bHandFree;
|
|
|
//坐席控制话筒的当前状态
|
|
@@ -1001,6 +983,9 @@ public:
|
|
|
SessionParam m_SessionParam;
|
|
|
int m_nSysCallType;//0:普通模式,1:p2p模式
|
|
|
int m_iFailedLastState;
|
|
|
+ BOOL m_bIsPadDevice;
|
|
|
+ BOOL m_bConAssist;
|
|
|
+ BOOL m_bConSipphone;
|
|
|
|
|
|
private:
|
|
|
DWORD m_nStarttime;
|