|
@@ -9,62 +9,65 @@
|
|
|
#include "CounterConnector_msg_g.h"
|
|
|
#include "../include/EventCode.h"
|
|
|
#include "y2k_time.h"
|
|
|
+
|
|
|
using namespace CounterConnector;
|
|
|
|
|
|
#define EVT_CONVERTER "EventConverter"
|
|
|
|
|
|
-
|
|
|
- void CCounterConnectorEntity ::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
- {
|
|
|
- ErrorCodeEnum Error = __OnStart(Error_Succeed);
|
|
|
- CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
- Error = spFunction->SubscribeBroadcast("LivenessDetection", NULL, this, m_uidlivenessListener);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- LOG_TRACE("subscribe LivenessDetection evt failed!");
|
|
|
- pTransactionContext->SendAnswer(Error);
|
|
|
- return;
|
|
|
- }
|
|
|
+void CCounterConnectorEntity ::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
+{
|
|
|
+ ErrorCodeEnum Error = __OnStart(Error_Succeed);
|
|
|
+ CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
+ Error = spFunction->SubscribeBroadcast("LivenessDetection", NULL, this, m_uidlivenessListener);
|
|
|
+ if (Error != Error_Succeed)
|
|
|
+ {
|
|
|
+ LOG_TRACE("subscribe LivenessDetection evt failed!");
|
|
|
pTransactionContext->SendAnswer(Error);
|
|
|
+ return;
|
|
|
}
|
|
|
- void CCounterConnectorEntity ::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
- {
|
|
|
- ErrorCodeEnum Error = __OnClose(Error_Succeed);
|
|
|
- pTransactionContext->SendAnswer(Error);
|
|
|
- }
|
|
|
- void CCounterConnectorEntity ::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
- {
|
|
|
- if (Test_ShakeHand == eTestType)
|
|
|
- {
|
|
|
- pTransactionContext->SendAnswer(Error_Succeed);
|
|
|
- }
|
|
|
- }
|
|
|
+ pTransactionContext->SendAnswer(Error);
|
|
|
+}
|
|
|
|
|
|
- ErrorCodeEnum CCounterConnectorEntity ::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
+
|
|
|
+void CCounterConnectorEntity ::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
+{
|
|
|
+ ErrorCodeEnum Error = __OnClose(Error_Succeed);
|
|
|
+ pTransactionContext->SendAnswer(Error);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void CCounterConnectorEntity ::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
+{
|
|
|
+ if (Test_ShakeHand == eTestType)
|
|
|
{
|
|
|
- if (preOperationError != Error_Succeed)
|
|
|
- return preOperationError;
|
|
|
- //MessageBoxA(0, 0, 0, 0);
|
|
|
- //is Pad Version
|
|
|
- m_pCurrentSession = NULL;
|
|
|
- m_bIsSalesRecord = FALSE;
|
|
|
- m_bIsRemoteRecord = FALSE;
|
|
|
- m_bHasLaunched = FALSE;
|
|
|
- CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
- CSystemStaticInfo stStaticinfo;
|
|
|
- spFunction->GetSystemStaticInfo(stStaticinfo);
|
|
|
- if (stricmp(stStaticinfo.strMachineType,"RVC.PAD")==0)
|
|
|
- {
|
|
|
- m_bIsPadType = TRUE;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- m_bIsPadType = FALSE;
|
|
|
- }
|
|
|
- m_IsStand2SType = TRUE;
|
|
|
- if (stricmp(stStaticinfo.strMachineType,"RVC.Stand2S")!=0){
|
|
|
- m_IsStand2SType = FALSE;
|
|
|
- }
|
|
|
+ pTransactionContext->SendAnswer(Error_Succeed);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ErrorCodeEnum CCounterConnectorEntity ::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
+{
|
|
|
+ if (preOperationError != Error_Succeed)
|
|
|
+ return preOperationError;
|
|
|
+ //MessageBoxA(0, 0, 0, 0);
|
|
|
+ //is Pad Version
|
|
|
+ m_pCurrentSession = NULL;
|
|
|
+ m_bIsSalesRecord = FALSE;
|
|
|
+ m_bIsRemoteRecord = FALSE;
|
|
|
+ m_bHasLaunched = FALSE;
|
|
|
+ CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
+ CSystemStaticInfo stStaticinfo;
|
|
|
+ spFunction->GetSystemStaticInfo(stStaticinfo);
|
|
|
+ if (stricmp(stStaticinfo.strMachineType,"RVC.PAD")==0){
|
|
|
+ m_bIsPadType = TRUE;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ m_bIsPadType = FALSE;
|
|
|
+ }
|
|
|
+ m_IsStand2SType = TRUE;
|
|
|
+ if (stricmp(stStaticinfo.strMachineType,"RVC.Stand2S")!=0){
|
|
|
+ m_IsStand2SType = FALSE;
|
|
|
+ }
|
|
|
|
|
|
ErrorCodeEnum Error;
|
|
|
m_pCounterConnectorChannel = new ChannelCounterConnectorClient(this);
|
|
@@ -75,164 +78,161 @@ using namespace CounterConnector;
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
+ {
|
|
|
+ ChannelService_BeginState_Sub Sub;
|
|
|
+ Error = m_pCounterConnectorChannel->BeginState(Sub);
|
|
|
+ if (Error != Error_Succeed)
|
|
|
{
|
|
|
- ChannelService_BeginState_Sub Sub;
|
|
|
- Error = m_pCounterConnectorChannel->BeginState(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- LOG_TRACE("BeginState biz channel failed!");
|
|
|
- m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
- m_pCounterConnectorChannel = NULL;
|
|
|
- return Error;
|
|
|
- }
|
|
|
+ LOG_TRACE("BeginState biz channel failed!");
|
|
|
+ m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
+ m_pCounterConnectorChannel = NULL;
|
|
|
+ return Error;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ {
|
|
|
+ ChannelService_BeginRecv_Sub Sub;
|
|
|
+ Sub.type = ACM_TYPE_DEVICE;
|
|
|
+ Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed)
|
|
|
{
|
|
|
- ChannelService_BeginRecv_Sub Sub;
|
|
|
- Sub.type = ACM_TYPE_DEVICE;
|
|
|
- Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- Dbg("Begin BeginRecv ACM_TYPE_DEVICE failed!");
|
|
|
- m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
- m_pCounterConnectorChannel = NULL;
|
|
|
- return Error;
|
|
|
- }
|
|
|
+ Dbg("Begin BeginRecv ACM_TYPE_DEVICE failed!");
|
|
|
+ m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
+ m_pCounterConnectorChannel = NULL;
|
|
|
+ return Error;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ {
|
|
|
+ ChannelService_BeginRecv_Sub Sub;
|
|
|
+ Sub.type = ACM_TYPE_AGENTVIDEOTYPE;
|
|
|
+ Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed)
|
|
|
{
|
|
|
- ChannelService_BeginRecv_Sub Sub;
|
|
|
- Sub.type = ACM_TYPE_AGENTVIDEOTYPE;
|
|
|
- Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- Dbg("Begin BeginRecv ACM_TYPE_AGENTVIDEOTYPE failed!");
|
|
|
- m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
- m_pCounterConnectorChannel = NULL;
|
|
|
- return Error;
|
|
|
- }
|
|
|
+ Dbg("Begin BeginRecv ACM_TYPE_AGENTVIDEOTYPE failed!");
|
|
|
+ m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
+ m_pCounterConnectorChannel = NULL;
|
|
|
+ return Error;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ {
|
|
|
+ ChannelService_BeginRecv_Sub Sub;
|
|
|
+ Sub.type = ACM_TYPE_CALLTRANS;
|
|
|
+ Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed)
|
|
|
{
|
|
|
- ChannelService_BeginRecv_Sub Sub;
|
|
|
- Sub.type = ACM_TYPE_CALLTRANS;
|
|
|
- Error = m_pCounterConnectorChannel->BeginRecv(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- Dbg("Begin BeginRecv ACM_TYPE_CALLTRANS failed!");
|
|
|
- m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
- m_pCounterConnectorChannel = NULL;
|
|
|
- return Error;
|
|
|
- }
|
|
|
+ Dbg("Begin BeginRecv ACM_TYPE_CALLTRANS failed!");
|
|
|
+ m_pCounterConnectorChannel->GetFunction()->CloseSession();
|
|
|
+ m_pCounterConnectorChannel = NULL;
|
|
|
+ return Error;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- m_fsm.Init(this);
|
|
|
- int i = 0;
|
|
|
- m_arrListener.Init(24);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_CALL,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_CALL,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_TO_PICKUP);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_TO_HANDFREE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP_BY_CONNECTING);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP_BY_AGENT);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_GPIO_PICKUP);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_GPIO_HANDFREE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_AGENT_HANDFREE_PICKUP);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_AGENT_PICKUP_HANDFREE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_SIPPHONE_IDLE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORD,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPRECORD,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_RETURNMENU,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTPHOTOGRAPH,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_DISTRIBUTE_ASSISTANTCHANNEL_IDLE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_DISTRIBUTE_SIPPHONE_IDLE);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_STOP_RECORD_BROADCAST,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_BEGAIN_RECORD_CALL,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTREMOTERECORD,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPREMOTERECORD,NULL,false);
|
|
|
- spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORDPREVIEW,NULL,false);
|
|
|
+ m_fsm.Init(this);
|
|
|
+ int i = 0;
|
|
|
+ m_arrListener.Init(24);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_CALL,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_CALL,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_TO_PICKUP);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_TO_HANDFREE);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP_BY_CONNECTING);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANNUP_BY_AGENT);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_GPIO_PICKUP);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_GPIO_HANDFREE);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_AGENT_HANDFREE_PICKUP);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_AGENT_PICKUP_HANDFREE);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_SIPPHONE_IDLE);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORD,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPRECORD,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_RETURNMENU,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTPHOTOGRAPH,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_STOP_RECORD_BROADCAST,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_BEGAIN_RECORD_CALL,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTREMOTERECORD,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPREMOTERECORD,NULL,false);
|
|
|
+ spFunction->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORDPREVIEW,NULL,false);
|
|
|
|
|
|
- spFunction->RegistSysVarEvent("UIState", this);
|
|
|
+ spFunction->RegistSysVarEvent("UIState", this);
|
|
|
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
+ return Error_Succeed;
|
|
|
+}
|
|
|
|
|
|
- void CCounterConnectorEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
|
|
|
+void CCounterConnectorEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
|
|
|
+{
|
|
|
+ if (_stricmp(pszKey, "UIState") == 0)
|
|
|
{
|
|
|
- if (_stricmp(pszKey, "UIState") == 0)
|
|
|
+ Dbg("Current UIState is %s.", pszValue);
|
|
|
+ if (pszValue[0] == 'M')
|
|
|
{
|
|
|
- Dbg("Current UIState is %s.", pszValue);
|
|
|
- if (pszValue[0] == 'M')
|
|
|
- {
|
|
|
- if (FALSE == m_bHasLaunched){
|
|
|
- m_bHasLaunched = TRUE;
|
|
|
- Dbg("UI has launched success.");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (FALSE == m_bHasLaunched){
|
|
|
+ m_bHasLaunched = TRUE;
|
|
|
+ Dbg("UI has launched success.");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- ErrorCodeEnum CCounterConnectorEntity ::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
- {
|
|
|
- if (preOperationError != Error_Succeed)
|
|
|
- return preOperationError;
|
|
|
- int i;
|
|
|
- CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
- for (i = 0; i < m_arrListener.GetCount(); ++i) {
|
|
|
- spFunction->UnsubscribeLog(m_arrListener[i]);
|
|
|
- }
|
|
|
-
|
|
|
- spFunction->UnregistSysVarEvent("UIState");
|
|
|
-
|
|
|
- m_arrListener.Clear();
|
|
|
- m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_EXIT));
|
|
|
- return Error_Succeed;
|
|
|
+ErrorCodeEnum CCounterConnectorEntity ::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
+{
|
|
|
+ if (preOperationError != Error_Succeed)
|
|
|
+ return preOperationError;
|
|
|
+ int i;
|
|
|
+ CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
+ for (i = 0; i < m_arrListener.GetCount(); ++i) {
|
|
|
+ spFunction->UnsubscribeLog(m_arrListener[i]);
|
|
|
}
|
|
|
|
|
|
- void CCounterConnectorEntity ::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)
|
|
|
+ spFunction->UnregistSysVarEvent("UIState");
|
|
|
+ m_arrListener.Clear();
|
|
|
+ m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_EXIT));
|
|
|
+ return Error_Succeed;
|
|
|
+}
|
|
|
+
|
|
|
+void CCounterConnectorEntity ::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)
|
|
|
+{
|
|
|
+ LOG_TRACE("user_code = 0x%08x", dwUserCode);
|
|
|
+ switch (dwUserCode)
|
|
|
{
|
|
|
- LOG_TRACE("user_code = 0x%08x", dwUserCode);
|
|
|
- switch (dwUserCode)
|
|
|
- {
|
|
|
case EVENT_MOD_CONNECT_GPIO_PICKUP:
|
|
|
+ {
|
|
|
+ m_fsm.m_bHandFree = FALSE;
|
|
|
+ if (!m_fsm.m_bIsAgentControl)
|
|
|
{
|
|
|
- m_fsm.m_bHandFree = FALSE;
|
|
|
- if (!m_fsm.m_bIsAgentControl)
|
|
|
- {
|
|
|
- m_fsm.m_bAgentHandFree = FALSE;
|
|
|
- }
|
|
|
- CSimpleStringA strValue;
|
|
|
- GetFunction()->GetSysVar("CallState", strValue);
|
|
|
- Dbg("摘机,and CallState is %s.", strValue.GetData());
|
|
|
+ m_fsm.m_bAgentHandFree = FALSE;
|
|
|
}
|
|
|
- break;
|
|
|
+ CSimpleStringA strValue;
|
|
|
+ GetFunction()->GetSysVar("CallState", strValue);
|
|
|
+ Dbg("摘机,and CallState is %s.", strValue.GetData());
|
|
|
+ }
|
|
|
+ break;
|
|
|
case EVENT_MOD_CONNECT_GPIO_HANDFREE:
|
|
|
+ {
|
|
|
+ m_fsm.m_bHandFree = TRUE;
|
|
|
+ if (!m_fsm.m_bIsAgentControl)
|
|
|
{
|
|
|
- m_fsm.m_bHandFree = TRUE;
|
|
|
- if (!m_fsm.m_bIsAgentControl)
|
|
|
- {
|
|
|
- m_fsm.m_bAgentHandFree = TRUE;
|
|
|
- }
|
|
|
- CSimpleStringA strValue;
|
|
|
- GetFunction()->GetSysVar("CallState", strValue);
|
|
|
- Dbg("挂机,and CallState is %s.", strValue.GetData());
|
|
|
+ m_fsm.m_bAgentHandFree = TRUE;
|
|
|
}
|
|
|
- break;
|
|
|
+ CSimpleStringA strValue;
|
|
|
+ GetFunction()->GetSysVar("CallState", strValue);
|
|
|
+ Dbg("挂机,and CallState is %s.", strValue.GetData());
|
|
|
+ }
|
|
|
+ break;
|
|
|
case EVENT_MOD_CONNECT_PICKUP_CALL: // 提机呼叫
|
|
|
- {
|
|
|
- if (m_bHasLaunched){
|
|
|
- Dbg("提机呼叫");
|
|
|
- m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_PICKUP_CALL));
|
|
|
- }
|
|
|
- else{
|
|
|
- Dbg("UI has not launched, ignore it.");
|
|
|
- }
|
|
|
+ {
|
|
|
+ if (m_bHasLaunched){
|
|
|
+ Dbg("提机呼叫");
|
|
|
+ m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_PICKUP_CALL));
|
|
|
}
|
|
|
- break;
|
|
|
+ else{
|
|
|
+ Dbg("UI has not launched, ignore it.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
case EVENT_MOD_CONNECT_HANDFREE_CALL: // 免提呼叫
|
|
|
if (m_fsm.m_bHandFree)
|
|
|
{
|
|
@@ -346,7 +346,6 @@ using namespace CounterConnector;
|
|
|
case EVENT_MOD_CONNECT_HANNUP_BY_AGENT: // 授权操作
|
|
|
m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_AGENT_WRITABLE));
|
|
|
|
|
|
- case LOG_EVT_DISTRIBUTE_ASSISTANTCHANNEL_IDLE:
|
|
|
case LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE: //若assistchannel重启
|
|
|
Dbg("user_code = %08x", dwUserCode);
|
|
|
m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_ASSISTCHAN_IDEL));
|
|
@@ -468,27 +467,23 @@ using namespace CounterConnector;
|
|
|
Dbg("offline state,ignore UI_STARTPHOTOGRAPH hangup event");
|
|
|
}
|
|
|
break;
|
|
|
- case LOG_EVT_DISTRIBUTE_SIPPHONE_IDLE: //sip话机状态重置
|
|
|
- Dbg("recv LOG_EVT_DISTRIBUTE_SIPPHONE_IDLE");
|
|
|
- m_fsm.PostEventFIFO(new FSMEvent(USER_EVT_SIPPHONE_IDEL));
|
|
|
- break;
|
|
|
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CServerSessionBase*CCounterConnectorEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char* /*pszClass*/)
|
|
|
- {
|
|
|
- LOG_FUNCTION();
|
|
|
- m_pCurrentSession = new CCounterConnectorSession(this);
|
|
|
- return m_pCurrentSession;
|
|
|
- }
|
|
|
+CServerSessionBase*CCounterConnectorEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char* /*pszClass*/)
|
|
|
+{
|
|
|
+ LOG_FUNCTION();
|
|
|
+ m_pCurrentSession = new CCounterConnectorSession(this);
|
|
|
+ return m_pCurrentSession;
|
|
|
+}
|
|
|
|
|
|
- bool CCounterConnectorEntity ::IsService() const
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+bool CCounterConnectorEntity ::IsService() const
|
|
|
+{
|
|
|
+ return true;
|
|
|
+}
|
|
|
|
|
|
//change audio device message
|
|
|
void CCounterConnectorEntity ::OnReceivePkt(int type, int sub_type, const char *buffer, int size)
|
|
@@ -589,82 +584,82 @@ using namespace CounterConnector;
|
|
|
m_bIsRemoteRecordStopSpeakerCapture = FALSE;
|
|
|
}
|
|
|
|
|
|
- void CCounterConnectorEntity::StopRemoteRecordSpeakerAudioCapture()
|
|
|
- {
|
|
|
- if(DOUBLERECORD_CALLTYPE == m_fsm.m_CallingParam.nCallType){
|
|
|
- if (TRUE == m_IsStand2SType){
|
|
|
- if (FALSE == m_bIsRemoteRecordStopSpeakerCapture){
|
|
|
- if (Error_Succeed == m_fsm.StopSpeakerAudioCapture()){
|
|
|
- m_bIsRemoteRecordStopSpeakerCapture = TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
- else{
|
|
|
- Dbg("remote record has stop speaker capture.");
|
|
|
+void CCounterConnectorEntity::StopRemoteRecordSpeakerAudioCapture()
|
|
|
+{
|
|
|
+ if(DOUBLERECORD_CALLTYPE == m_fsm.m_CallingParam.nCallType){
|
|
|
+ if (TRUE == m_IsStand2SType){
|
|
|
+ if (FALSE == m_bIsRemoteRecordStopSpeakerCapture){
|
|
|
+ if (Error_Succeed == m_fsm.StopSpeakerAudioCapture()){
|
|
|
+ m_bIsRemoteRecordStopSpeakerCapture = TRUE;
|
|
|
}
|
|
|
}
|
|
|
+ else{
|
|
|
+ Dbg("remote record has stop speaker capture.");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- void CCounterConnectorEntity::Handle_StartRecordPreview(const char* pszMessage)
|
|
|
- {
|
|
|
- CSimpleStringA strMsg = pszMessage;
|
|
|
- if (strMsg.IsStartWith("ews|",true)){
|
|
|
- strMsg = strMsg.SubString(4,strMsg.GetLength()-4);
|
|
|
- }
|
|
|
-
|
|
|
- CSimpleStringA strVideo;
|
|
|
- strVideo = ConstructVideoRenderParam(strMsg, false);
|
|
|
- m_fsm.PostEventFIFO(new ShowLocalVideoEvent(strVideo)); // 非连坐席双录
|
|
|
- m_bIsSalesRecord = TRUE;
|
|
|
+void CCounterConnectorEntity::Handle_StartRecordPreview(const char* pszMessage)
|
|
|
+{
|
|
|
+ CSimpleStringA strMsg = pszMessage;
|
|
|
+ if (strMsg.IsStartWith("ews|",true)){
|
|
|
+ strMsg = strMsg.SubString(4,strMsg.GetLength()-4);
|
|
|
}
|
|
|
|
|
|
- //send cur audio device to agent
|
|
|
- void CCounterConnectorEntity ::SendCurAudioDevice()
|
|
|
+ CSimpleStringA strVideo;
|
|
|
+ strVideo = ConstructVideoRenderParam(strMsg, false);
|
|
|
+ m_fsm.PostEventFIFO(new ShowLocalVideoEvent(strVideo)); // 非连坐席双录
|
|
|
+ m_bIsSalesRecord = TRUE;
|
|
|
+}
|
|
|
+
|
|
|
+//send cur audio device to agent
|
|
|
+void CCounterConnectorEntity ::SendCurAudioDevice()
|
|
|
+{
|
|
|
+ if (m_fsm.m_nSysCallType == 0)
|
|
|
{
|
|
|
- if (m_fsm.m_nSysCallType == 0)
|
|
|
+ ChannelService_Send_Info Info;
|
|
|
+ Info.compress = false;
|
|
|
+ Info.encrypt = false;
|
|
|
+ Info.type = ACM_TYPE_DEVICE;
|
|
|
+ Info.id = 0;
|
|
|
+ Info.sub_type = ACM_AUDIO_DEVICE;
|
|
|
+ Info.data.Alloc(sizeof(int));
|
|
|
+ SpBuffer buf;
|
|
|
+ buf.OpenWrite();
|
|
|
+ int nDevice = 0;
|
|
|
+ if (m_fsm.m_bIsAgentControl)
|
|
|
{
|
|
|
- ChannelService_Send_Info Info;
|
|
|
- Info.compress = false;
|
|
|
- Info.encrypt = false;
|
|
|
- Info.type = ACM_TYPE_DEVICE;
|
|
|
- Info.id = 0;
|
|
|
- Info.sub_type = ACM_AUDIO_DEVICE;
|
|
|
- Info.data.Alloc(sizeof(int));
|
|
|
- SpBuffer buf;
|
|
|
- buf.OpenWrite();
|
|
|
- int nDevice = 0;
|
|
|
- if (m_fsm.m_bIsAgentControl)
|
|
|
+ if (m_fsm.m_bAgentHandFree)
|
|
|
{
|
|
|
- if (m_fsm.m_bAgentHandFree)
|
|
|
- {
|
|
|
- nDevice = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- nDevice = 1;
|
|
|
- }
|
|
|
- }
|
|
|
+ nDevice = 0;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
- if (m_fsm.m_bHandFree)
|
|
|
- {
|
|
|
- nDevice = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- nDevice = 1;
|
|
|
- }
|
|
|
+ nDevice = 1;
|
|
|
}
|
|
|
- buf & nDevice;
|
|
|
- Info.data = buf.ToBlob();
|
|
|
- m_pCounterConnectorChannel->Send(Info);
|
|
|
- Dbg("send cur Audio device = %d",nDevice);
|
|
|
- }
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
- Dbg("cur call type cannot send pkt");
|
|
|
+ if (m_fsm.m_bHandFree)
|
|
|
+ {
|
|
|
+ nDevice = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ nDevice = 1;
|
|
|
+ }
|
|
|
}
|
|
|
+ buf & nDevice;
|
|
|
+ Info.data = buf.ToBlob();
|
|
|
+ m_pCounterConnectorChannel->Send(Info);
|
|
|
+ Dbg("send cur Audio device = %d",nDevice);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Dbg("cur call type cannot send pkt");
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
void CCounterConnectorEntity::SetCallType(CallingTypeEnum eType)
|
|
|
{
|