|
@@ -235,20 +235,16 @@ CSIPEntity::CSIPEntity() : m_pCurrentSession(NULL), m_state(INIT),m_iPickupPhone
|
|
|
m_SipErrorCode = Error_Succeed;
|
|
|
m_eVideoRenderType = eGDI;
|
|
|
memset((void*)&m_stVideoParam,0,sizeof(stVideoParam));
|
|
|
- m_strStunServer = RVC_DEFAULT_STUNSERVER;
|
|
|
- m_strStunPort = RVC_DEFAULT_STUNPORT;
|
|
|
- m_iStunTimeOut = RVC_STUN_TIMEOUT;
|
|
|
- m_bStunFlag = FALSE;
|
|
|
- m_bAudioMgrInited = FALSE;
|
|
|
+ m_bAudioMgrInited = false;
|
|
|
m_pAudioMgr = NULL;
|
|
|
m_AudioStopType = 1;
|
|
|
m_iCapType = 1;
|
|
|
m_pSipphoneChannel = NULL;
|
|
|
- m_bConnectedAssist = FALSE;
|
|
|
+ m_bConnectedAssist = false;
|
|
|
m_strStartTime = RVC_START_TIME;
|
|
|
m_strEndTime = RVC_END_TIME;
|
|
|
m_itervalTime = RVC_INTERVAL_TIME;
|
|
|
- m_bStopAutoRestart = FALSE;
|
|
|
+ m_bStopAutoRestart = false;
|
|
|
m_iAudioDspUseCenter = 0;
|
|
|
}
|
|
|
|
|
@@ -263,14 +259,14 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
{
|
|
|
Sleep(810);
|
|
|
if (m_pSipphoneChannel != NULL){
|
|
|
- m_bConnectedAssist = FALSE;
|
|
|
+ m_bConnectedAssist = false;
|
|
|
m_pSipphoneChannel->GetFunction()->CloseSession();
|
|
|
m_pSipphoneChannel->SafeDelete();
|
|
|
m_pSipphoneChannel = NULL;
|
|
|
}
|
|
|
|
|
|
if (Error_Succeed == ConnectAssistChannel()) {
|
|
|
- m_bConnectedAssist = TRUE;
|
|
|
+ m_bConnectedAssist = true;
|
|
|
}
|
|
|
else {
|
|
|
GetFunction()->SetTimer(2, this, 3200);
|
|
@@ -566,8 +562,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();
|
|
@@ -579,7 +573,7 @@ void CSIPEntity::OnStarted()
|
|
|
|
|
|
m_pSipphoneChannel = new ChannelSipphoneClient(this);
|
|
|
if (Error_Succeed == ConnectAssistChannel()){
|
|
|
- m_bConnectedAssist = TRUE;
|
|
|
+ m_bConnectedAssist = true;
|
|
|
}
|
|
|
|
|
|
if (!m_pAudioMgr || !m_bAudioMgrInited){
|
|
@@ -618,6 +612,7 @@ void CSIPEntity::OnStarted()
|
|
|
}
|
|
|
|
|
|
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.");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -835,7 +830,7 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
t_callback.debug = &__audiomgrlog;
|
|
|
m_pAudioMgr = CreateAudioMgrObj(&t_callback);
|
|
|
if (0 == m_pAudioMgr->audio_mgr_initialize()) {
|
|
|
- m_bAudioMgrInited = TRUE;
|
|
|
+ m_bAudioMgrInited = true;
|
|
|
}
|
|
|
else {
|
|
|
LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SIPPHONE_AUDIOMGR_INITIAL_FAILED, "audio manager initialize failed!");
|
|
@@ -1230,19 +1225,26 @@ ErrorCodeEnum CSIPEntity::RvcGetAudioDeviceInfo()
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
if (NULL != m_pAudioMgr || !m_bAudioMgrInited) {
|
|
|
int icountmic = m_pAudioMgr->audio_get_device_count(true);
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("core audio input device(%d):", icountmic);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("core audio input device(%d):", icountmic);
|
|
|
int i = 0;
|
|
|
for (; i < icountmic; i++) {
|
|
|
char strname[MAX_PATH] = { 0 };
|
|
|
m_pAudioMgr->audio_get_device_name(strname, MAX_PATH, true, i);
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
|
|
|
+ }
|
|
|
+ if (icountmic < RVC_AUDIO_IN_DEVICE_COUNT) {
|
|
|
+ LogWarn(Severity_Middle, Error_AudioIN, ERROR_MOD_SIP_AUDIO_IN_COUNT, CSimpleString::Format("audio in device count is %d.", icountmic).GetData());
|
|
|
}
|
|
|
+
|
|
|
int icountspeaker = m_pAudioMgr->audio_get_device_count(false);
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("core audio output device(%d):", icountspeaker);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("core audio output device(%d):", icountspeaker);
|
|
|
for (i = 0; i < icountspeaker; i++) {
|
|
|
char strname[MAX_PATH] = { 0 };
|
|
|
m_pAudioMgr->audio_get_device_name(strname, MAX_PATH, false, i);
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
|
|
|
+ }
|
|
|
+ if (icountspeaker < RVC_AUDIO_IN_DEVICE_COUNT) {
|
|
|
+ LogWarn(Severity_Middle, Error_AudioOut, ERROR_MOD_SIP_AUDIO_OUT_COUNT, CSimpleString::Format("audio out device count is %d.", icountspeaker).GetData());
|
|
|
}
|
|
|
Error = Error_Succeed;
|
|
|
}
|
|
@@ -1633,13 +1635,13 @@ void CSIPEntity::OnTimeout(DWORD dwTimerID)
|
|
|
}
|
|
|
else if (2 == dwTimerID)
|
|
|
{
|
|
|
- if (FALSE == m_bConnectedAssist) {
|
|
|
+ if (!m_bConnectedAssist) {
|
|
|
if (Error_Succeed == ConnectAssistChannel()) {
|
|
|
- m_bConnectedAssist = TRUE;
|
|
|
+ m_bConnectedAssist = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (TRUE == m_bConnectedAssist){
|
|
|
+ if (m_bConnectedAssist){
|
|
|
GetFunction()->KillTimer(2);
|
|
|
}
|
|
|
}
|