Пример #1
0
int UCPublicProxy::GetContactStatus(const std::string& _uri, int& _status)
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(_uri);
	
	if (_uri.empty())
	{
		ERROR_LOG() << "_uri is empty.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_InvalidParam;
	}

	if (NULL == m_pUCClient)
	{
		ERROR_LOG() << "m_pUCClient is null.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_NullPoint;
	}

	if (NULL == m_pUCClient->ContactSubManager)
	{
		ERROR_LOG() << "m_pUCClient->ContactSubManager is null.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_NullPoint;
	}

	_status = m_pUCClient->ContactSubManager->GetContactStatus(_uri);
	INFO_PARAM1(_status);

	DEBUG_LOG() << "--- LEAVE";
	return UCSDK_Succ;
}
Пример #2
0
int UCSDK_CALL CanMoveToGroup(const UCContact* member, const UCGroup* _src, const UCGroup* _target)
{
	DEBUG_LOG() << "--- ENTER";
	CHECK_POINTER(member, false);
	CHECK_POINTER(_src, false);
	CHECK_POINTER(_target, false);

	UCContactMgrAbsProxy* pUCContactMgrAbsProxy = UCContactMgrAbsProxy::GetInstance();
	CHECK_POINTER(pUCContactMgrAbsProxy, false);
	
	UCSDKContact contact;
	UCSDKGroup srcgroup;
	UCSDKGroup targetgroup;
	UCStructCopy::Copy_UCSDKContact(contact, *member);
	UCStructCopy::Copy_UCSDKGroup(srcgroup, *_src);
	UCStructCopy::Copy_UCSDKGroup(targetgroup, *_target);

	bool bRet = pUCContactMgrAbsProxy->CanMoveToGroup(contact, srcgroup, targetgroup);
	INFO_PARAM1(bRet);

	int iRet = UC_Fail;
	if (bRet)
	{
		iRet = UC_Succ;
	}

	DEBUG_LOG() << "--- LEAVE";
	return iRet;
}
Пример #3
0
bool __UPGRADE_VERSION_CALL Upgrade_SetServerUrl(const char* pchServerUrl)
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(pchServerUrl);

	if (NULL == pchServerUrl)
	{
		ERROR_LOG() << "pchServerUrl is NULL pointer.";
		return false;
	}
	//获取升级模块实例
	UpdateVersion *pUpdateVersion = UpdateVersion::GetUpdateVersion();
	if (NULL == pUpdateVersion)
	{
		ERROR_LOG() << "pUpdateVersion is NULL pointer.";
		return false;
	}
	//设置server url
	std::string strUrl = pchServerUrl;
	bool bRet = pUpdateVersion->SetServerUrl(strUrl);
	if (!bRet)
	{
		ERROR_LOG() << "Set server url fail.";
	}
	else
	{
		DEBUG_LOG() << "Set server url success.";
	}
	
	DEBUG_LOG() << "--- LEAVE";
	return bRet;
}
//设置当前视频设备
int UCDeviceMgr::SetCurrentVideoDev(int index)
{
	if (NULL == m_pDevMgr)
	{
		ERROR_LOG() << "m_pDevMgr is null pointer";
		return UC_SDK_NullPtr;
	}
	if (index < 0 || index >= (int)m_pDevMgr->videodevlist.size())
	{
		return UC_SDK_InvalidPara;
	}
	if (!m_pDevMgr->SetVideoCaptureDev((unsigned int)index))
	{
		INFO_PARAM1(index);
		ERROR_LOG() << "SetVideoCaptureDev failed.";
		return UC_SDK_Failed;
	}

	if(NULL == UCRegManager::Instance().m_pSelf)
	{
		ERROR_LOG() << "m_pSelf is NULL.";
		return UC_SDK_NullPtr;
	}
	UCRegManager::Instance().m_pSelf->simplecfg_.SaveUserConfig(SETTING_MEDIA_VIDEODEVICE,m_pDevMgr->videodevlist[(unsigned int)index]->name);

	return UC_SDK_Success;
}
Пример #5
0
VOID WINAPI ControlHandler(DWORD dwControl)
{
	LOG_TRACE();
	INFO_PARAM1(dwControl);
	switch (dwControl)
	{
	case SERVICE_CONTROL_STOP:
		{
			g_svc_status.dwCurrentState = SERVICE_STOP_PENDING;
			SetServiceStatus(g_hSvcCtrl, &g_svc_status);
			SSL_Socket::Instance().m_bStopSvc = true;
		}
		break;
	case SERVICE_CONTROL_SHUTDOWN:
		{
			g_svc_status.dwCurrentState = SERVICE_STOP_PENDING;
			SetServiceStatus(g_hSvcCtrl, &g_svc_status);
			SSL_Socket::Instance().m_bStopSvc = true;
		}
		break;
	default:
		{
			LOG_RUN_ERROR("Invalid service control.");
		}
		break;
	}
}
void UCEventMgr::EventAgent::NotifyCallIncoming() const
{
	if (NULL == UCCallManager::OnAVSessAddedCB)
	{
		WARN_LOG() << "OnAVSessAddedCB is null";
		return;
	}

	INFO_PARAM1(m_EventPara);
	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string callerUri;
	xmlStr["callerUri"] >> callerUri;
	std::string video;
	xmlStr["video"] >> video;
	std::string callmode;
	xmlStr["callmode"] >> callmode;
	std::string accountType;
	xmlStr["accounttype"] >> accountType;

	STAudioVideoParam item = {0};
	item.isvideo_ = 0;
	item.callMode = 0;
	item.AccountType = 0;
	Contact ctact;
	if(eSDKTool::IsValidUri(callerUri))
	{
		if(UC_SDK_Success == UCContactMgr::Instance().getContactByUri(callerUri,ctact))
		{
			ctk::MemSet(item.ucAcc,0,STRING_LENGTH);
			ctk::MemCopy(item.ucAcc,ctact.ucAcc_.c_str(),(ctact.ucAcc_.size()<(STRING_LENGTH)) ? (ctact.ucAcc_.size()) : (STRING_LENGTH-1));
		}
		else
		{
			ctk::MemSet(item.ucAcc,0,STRING_LENGTH);
			ctk::MemCopy(item.ucAcc,callerUri.c_str(),(callerUri.size()<(STRING_LENGTH)) ? (callerUri.size()) : (STRING_LENGTH-1));
		}
	}
	else
	{
		ctk::MemSet(item.ucAcc,0,STRING_LENGTH);
		ctk::MemCopy(item.ucAcc,callerUri.c_str(),(callerUri.size()<(STRING_LENGTH)) ? (callerUri.size()) : (STRING_LENGTH-1));
	}
	
	if("true" == video)
	{
		item.isvideo_ = 1;
	}
	if("IPPhone" == callmode)
	{
		item.callMode = 1;
	}
	if("IPPhone" == accountType)
	{
		item.AccountType = 1;
	}

	DEBUG_LOG() << "--- OnAVSessAddedCB ENTER ";
	UCCallManager::OnAVSessAddedCB(item);
	DEBUG_LOG() << "--- OnAVSessAddedCB LEAVE ";
}
Пример #7
0
eLTE_RET XMLProcess::SetXmlStringEventNotifySDSStatus(const SdsMessageInfo* pInfo,
	CString& xmlStr)
{
	/************************************************************************
			--- XML 格式 ---
			<Content>
			<SdsMsgId>消息ID</SdsMsgId>
			<SdsRetCode>消息发送状态</SdsRetCode>
			</Content>
	************************************************************************/
	LOG_TRACE();
	CXml xml;
	(void)xml.AddElem("Content");
	(void)xml.AddChildElem("SdsMsgId");
	(void)xml.IntoElem();
	(void)xml.SetElemValue(pInfo->strSubject.c_str());

	(void)xml.AddElem("SdsRetCode");
	(void)xml.SetElemValue(pInfo->strRetCode.c_str());

	xml.OutOfElem();

	IVS_UINT32 uiLen = 0;
	const char* pXmlStr = xml.GetXMLStream(uiLen);
	if (NULL == pXmlStr)
	{
		LOG_RUN_ERROR("pXmlStr is null.");
		return eLTE_ERR_FAILED;
	}
	xmlStr = eLTE_Tool::ANSIToUnicode(pXmlStr).c_str();

	INFO_PARAM1(pXmlStr);
	return eLTE_ERR_SUCCESS;
}
Пример #8
0
int UCMeetingProxy::AcceptMeeting(const std::string& convId)
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(convId);

	//校验参数
	if (convId.empty())
	{
		ERROR_LOG() << "Meeting is not exist.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_InvalidParam;
	}
	if (NULL == m_pConvManager)
	{
		ERROR_LOG() << "m_pConvManager is null.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_NullPoint;
	}

	uc::model::conversation::Conversation* pConversation = m_pConvManager->GetConversation(convId);
	if (NULL == pConversation)
	{
		ERROR_LOG() << "Get conversation by convId failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	//获取AVsession
	uc::model::conversation::AVSession* pAVSession = GetAVSession(pConversation);
	if (NULL == pAVSession)
	{
		ERROR_LOG() << "Get av session failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	if (!pAVSession->Accept())
	{
		ERROR_LOG() << "Accept av session failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	//关联信号
#ifdef ESDKCLIENT_PLATFORM_DEPEND
	UCSDK* pUCSDK = UCSDK::CreateInstance();
#else
	UCSDK* pUCSDK = UCSDK::Instance();
#endif
	if (NULL == pUCSDK)
	{
		ERROR_LOG() << "Get UCSDK's instance failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}
	(void)pUCSDK->ConnectConference(pConversation);

	DEBUG_LOG() << "--- LEAVE";
	return UCSDK_Succ;
}
void UCEventMgr::EventAgent::NotifyCallClosed() const
{
	INFO_PARAM1(m_EventPara);
	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string id;
	xmlStr["id"] >> id;
	std::string callerNum;
	xmlStr["callerNum"] >> callerNum;
	std::string reason;
	xmlStr["reason"] >> reason;
	std::string conversationId;
	xmlStr["conversationId"] >> conversationId;

	if (conversationId == UCCallManager::Instance().GetConvID())
	{
		(void)UCCallManager::Instance().ClearCallMember();
		(void)UCCallManager::Instance().ClearConvMember();
		(void)UCCallManager::Instance().ClearConvID();
	}

	if(NULL == UCCallManager::OnAVSessionClosedCB)
	{
		ERROR_LOG() << "UCCallManager::OnAVSessionClosedCB is null.";
		return;
	}

	STMsgAVSessionClosedParam item = {0};
	(void)strcpy_s(item.AVSessionId_,id.c_str());
	(void)strcpy_s(item.callerUri_,callerNum.c_str());
	(void)strcpy_s(item.reason_,reason.c_str());

	DEBUG_LOG() << "--- OnAVSessionClosedCB ENTER ";
	UCCallManager::OnAVSessionClosedCB(item);
	DEBUG_LOG() << "--- OnAVSessionClosedCB LEAVE ";
}
void UCEventMgr::EventAgent::NotifyPublishPJ(void) const
{
	INFO_PARAM1(m_EventPara);
	int iType = -1;
	if(UC_SDK_Success == UCConfigMgr::Instance().GetPhoneJointDevType(iType))
	{
		(void)UCConfigMgr::Instance().SetPhoneJointDevType(iType);
	}
}
void UCEventMgr::EventAgent::NotifyRejectNewCall(void) const
{
	INFO_PARAM1(m_EventPara);
	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string conversationID;
	xmlStr["conversationID"] >> conversationID;

	(void)UCCallManager::Instance().RejectCall(conversationID);

}
void UCEventMgr::onThreadExit(ctk::Thread* _thr)
{
	if(NULL == _thr)
	{
		ERROR_LOG() << "thread is null";
		return;
	}
	ctk::ThreadId::type threadId = _thr->id().id_;
	INFO_PARAM1(threadId);
}
Пример #13
0
eLTE_RET XMLProcess::SetXmlStringEventNotifyGisReport(const GisReportInfo* pInfo,
	CString& xmlStr)
{
	/************************************************************************
			--- XML 格式 ---
			<Content>
			<ResourceID>上报方</ResourceID>
			<Time>最后一次上报时间</Time>
			<Altitude>高度</Altitude>
			<Latitude>纬度</Latitude>
			<Longtitude>经度</Longtitude>
			<TriggerCode>周期上报(0),特定事件(1、紧急呼叫)</TriggerCode>
			<ReportStatus>GPS正常开启(0),GPS搜星失败(1)或其它异常(2)</ReportStatus>
			</Content>
	************************************************************************/
	LOG_TRACE();

	if (NULL == pInfo)
	{
		LOG_RUN_ERROR("pInfo is null.");
		return eLTE_ERR_FAILED;
	}

	CXml xml;
	(void)xml.AddElem("Content");
	(void)xml.AddChildElem("ResourceID");
	(void)xml.IntoElem();
	(void)xml.SetElemValue(pInfo->strSender.c_str());
	(void)xml.AddElem("Time");
	(void)xml.SetElemValue(pInfo->strTime.c_str());
	(void)xml.AddElem("Altitude");
	(void)xml.SetElemValue(pInfo->strAltitude.c_str());
	(void)xml.AddElem("Latitude");
	(void)xml.SetElemValue(pInfo->strLatitude.c_str());
	(void)xml.AddElem("Longtitude");
	(void)xml.SetElemValue(pInfo->strLongtitude.c_str());
	(void)xml.AddElem("TriggerCode");
	(void)xml.SetElemValue(eLTE_Tool::Int2String(pInfo->iTriggerCode).c_str());
	(void)xml.AddElem("ReportStatus");
	(void)xml.SetElemValue(eLTE_Tool::Int2String(pInfo->iReportState).c_str());
	xml.OutOfElem();

	IVS_UINT32 uiLen = 0;
	const char* pXmlStr = xml.GetXMLStream(uiLen);
	if (NULL == pXmlStr)
	{
		LOG_RUN_ERROR("pXmlStr is null.");
		return eLTE_ERR_FAILED;
	}
	xmlStr = eLTE_Tool::ANSIToUnicode(pXmlStr).c_str();

	INFO_PARAM1(pXmlStr);
	return eLTE_ERR_SUCCESS;
}
Пример #14
0
int UCMeetingProxy::StartMeeting(const std::string& convId)
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(convId);

	//校验参数
	if (convId.empty())
	{
		ERROR_LOG() << "Meeting is not exist.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_InvalidParam;
	}
	if (NULL == m_pConvManager)
	{
		ERROR_LOG() << "m_pConvManager is null.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_NullPoint;
	}

	uc::model::conversation::Conversation* pConversation = m_pConvManager->GetConversation(convId);
	if (NULL == pConversation)
	{
		ERROR_LOG() << "Get conversation by convId failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	if (pConversation->HasSession(AudioVideo))
	{
		ERROR_LOG() << "Meeting is started.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	conversation::AVSession* pAVSess = dynamic_cast<conversation::AVSession*>(pConversation->AddSession(AudioVideo));
	if (NULL == pAVSess)
	{
		ERROR_LOG() << "Add av session failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	if (!pAVSess->Connect())
	{
		pConversation->RemoveSession(AudioVideo);
		ERROR_LOG() << "AV session connect failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	DEBUG_LOG() << "--- LEAVE";
	return UCSDK_Succ;
}
Пример #15
0
ELTE_INT32 SharedMemoryMgr::SetPlayWindow(const std::string& strResId, HWND hWnd)
{
	LOG_TRACE();
	INFO_PARAM1(strResId);

	std::map <std::string, SharedMemory*>::iterator iter = m_sharedMemorys.find(strResId);
	if(iter == m_sharedMemorys.end())
	{
		return eLTE_SDK_ERR_NULL_POINTER;
	}
	iter->second->SetPlayWindow(hWnd);
	return eLTE_SDK_ERR_SUCCESS;
}
Пример #16
0
// 设置标题栏文本
void CVideoPane::SetCaptionText(const CString& strText)
{
	LOG_TRACE();
	INFO_PARAM1(strText);
	
	m_strCaptionText = strText;
	SetWindowText(m_strCaptionText);

	CRect rect;
	GetClientRect(rect);
	rect.bottom = CAPTION_HEIGHT;
	InvalidateRect(rect, TRUE);
}
void UCEventMgr::EventAgent::NotifyPhoneJointCB() const
{

	INFO_PARAM1(m_EventPara);

	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string strStatus;
	xmlStr["status"] >> strStatus;
	int iStatus = -1;
	if("0" == strStatus)
	{
		iStatus = STATUS_START_SUCC;
	}
	else if("1" == strStatus)
	{
		iStatus = STATUS_START_FAILED;
	}
	else if("2" == strStatus)
	{
		iStatus = STATUS_STOP_SUCC;
	}
	else if("3" == strStatus)
	{
		iStatus = STATUS_STOP_FAILED;
	}
	else if("4" == strStatus)
	{
		iStatus = STATUS_ONLINE;
	}
	else if("5" == strStatus)
	{
		iStatus = STATUS_OFFLINE;
	}
	else if("6" == strStatus)
	{
		iStatus = STATUS_OFFHOOK;
	}

	if(NULL == UCConfigMgr::m_OnPJEventCB)
	{
		WARN_LOG() << "m_OnPJEventCB is null";
		return;
	}

	DEBUG_LOG() << "--- OnPJEventCB ENTER ";
	UCConfigMgr::m_OnPJEventCB((EM_PhoneJointStatusType)iStatus);
	DEBUG_LOG() << "--- OnPJEventCB LEAVE ";

	return;
}
Пример #18
0
ELTE_VOID SharedMemoryMgr::DeleteSharedMemory(const std::string& strResId)
{
	LOG_TRACE();
	INFO_PARAM1(strResId);

	std::map <std::string, SharedMemory*>::iterator iter = m_sharedMemorys.find(strResId);
	if(iter == m_sharedMemorys.end())
	{
		return;
	}
	delete iter->second;

	m_sharedMemorys.erase(iter);
}
Пример #19
0
ELTE_INT32 SharedMemoryMgr::CreateSharedMemory(const std::string& strResId)
{
	LOG_TRACE();
	INFO_PARAM1(strResId);

	std::map <std::string, SharedMemory*>::iterator iter = m_sharedMemorys.find(strResId);
	if(m_sharedMemorys.end() != iter)
	{
		return eLTE_SDK_ERR_SUCCESS;
	}
	SharedMemory* pSharedMemory = new SharedMemory(strResId);
	if (NULL == pSharedMemory)
	{
		return eLTE_SDK_ERR_NULL_POINTER;
	}

	//初始化资源
	ELTE_INT32 iRet = pSharedMemory->InitResource();
	if(eLTE_SDK_ERR_SUCCESS != iRet)
	{
		delete pSharedMemory;
		pSharedMemory = NULL;
		return iRet;//lint !e438
	}

	//开启接受视频流线程
	iRet = pSharedMemory->StartYuvFrameProcess();
	if(eLTE_SDK_ERR_SUCCESS != iRet)
	{
		delete pSharedMemory;
		pSharedMemory = NULL;
		return iRet;//lint !e438
	}

	//开启发送视频流线程
	iRet = pSharedMemory->StartRevMsg();
	if(eLTE_SDK_ERR_SUCCESS != iRet)
	{
		delete pSharedMemory;
		pSharedMemory = NULL;
		return iRet;//lint !e438
	}

	(ELTE_VOID)m_sharedMemorys.insert(std::pair <std::string, SharedMemory*> (strResId, pSharedMemory));

	return eLTE_SDK_ERR_SUCCESS;//lint !e429
}
Пример #20
0
ELTE_INT32 SharedMemoryMgr::LocalSnapshot(const std::string& strResourceID, const std::string& strSnapshotPath, const ELTE_ULONG& ulSnapshotFormat)
{
	LOG_TRACE();
	INFO_PARAM1(strResourceID);

	std::map <std::string, SharedMemory*>::iterator iter = m_sharedMemorys.find(strResourceID);
	if(iter == m_sharedMemorys.end())
	{
		return eLTE_SDK_ERR_NULL_POINTER;
	}
	ELTE_INT32 iRet = iter->second->LocalSnapshot(strSnapshotPath, ulSnapshotFormat);
	if(eLTE_SDK_ERR_SUCCESS != iRet)
	{
		return iRet;
	}
	return eLTE_SDK_ERR_SUCCESS;
}
Пример #21
0
// 解析入参Mute_UL_parameter
eLTE_RET XMLProcess::XmlParseMuteULParameter(const std::string& xmlStr,	// 入参
		std::string& strCallType)			// 出参
{
	/************************************************************************
	--- XML 格式 ---
	<Content>
		<MuteParam>
			<CallType>"0"点呼,"1"组呼,"2"视频回传</CallType>
		</MuteParam>
	</Content>
	************************************************************************/ 
	
	LOG_TRACE();
	INFO_PARAM1(xmlStr);

	CXml xmlParse;
	if (!xmlParse.Parse(xmlStr.c_str()))
	{
		LOG_RUN_ERROR("parse xml failed.");
		return eLTE_ERR_FAILED;
	}
	if (!xmlParse.FindElem("Content"))
	{
		LOG_RUN_ERROR("FindElem Content failed.");
		return eLTE_ERR_FAILED;
	}
	(void)xmlParse.IntoElem();
	if (!xmlParse.FindElem("MuteParam"))
	{
		LOG_RUN_ERROR("FindElem MuteParam failed.");
		return eLTE_ERR_FAILED;
	}
	(void)xmlParse.IntoElem();

	const unsigned int XML_VAR_LENGTH = 20;
	char elemValue[XML_VAR_LENGTH] = {0};
	const char* srcValue;
	unsigned int uiMaxLen = XML_VAR_LENGTH;

	memset(elemValue, 0, sizeof(char)*XML_VAR_LENGTH);	
	GET_XML_ELEM_VALUE_CHAR(xmlParse, "CallType", srcValue, elemValue, uiMaxLen);
	strCallType = elemValue;

	return eLTE_ERR_SUCCESS;
}
Пример #22
0
int UCSDK_CALL HasContact(const char* pUri)
{
	DEBUG_LOG() << "--- ENTER";
	CHECK_POINTER(pUri, false);

	UCContactMgrAbsProxy* pUCContactMgrAbsProxy = UCContactMgrAbsProxy::GetInstance();
	CHECK_POINTER(pUCContactMgrAbsProxy, false);

	bool bRet = pUCContactMgrAbsProxy->HasContact(pUri);
	INFO_PARAM1(bRet);

	int iRet = UC_Fail;
	if (bRet)
	{
		iRet = UC_Succ;
	}

	DEBUG_LOG() << "--- LEAVE";
	return iRet;
}
Пример #23
0
int UCMeetingProxy::LeaveMeeting(const std::string& convId)
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(convId);

	if (convId.empty())
	{
		ERROR_LOG() << "convId is empty.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_InvalidParam;
	}

	//获取conversation
	uc::model::conversation::Conversation* pConversation = GetConversation(convId);
	if (NULL == pConversation)
	{
		ERROR_LOG() << "Get conversation failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	//获取AVsession
	uc::model::conversation::AVSession* pAVSession = GetAVSession(pConversation);
	if (NULL == pAVSession)
	{
		ERROR_LOG() << "Get av session failed.";
		DEBUG_LOG() << "--- LEAVE";
		return UCSDK_Fail;
	}

	pAVSession->Disconnect();
	pConversation->RemoveSession(uc::model::InstantMessage);
	pConversation->RemoveSession(uc::model::AudioVideo);
	if (NULL != m_pConvManager)
	{
		m_pConvManager->RemoveConversation(convId);
	}

	DEBUG_LOG() << "--- LEAVE";
	return UCSDK_Succ;
}
void UCEventMgr::EventAgent::NotifyCallConnect() const
{
	if (NULL == UCCallManager::OnAVSessionConnectedCB)
	{
		WARN_LOG() << "OnAVSessionConnectedCB is null";
		return;
	}

	INFO_PARAM1(m_EventPara);

	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string caller;
	xmlStr["caller"] >> caller;  
	std::string conID ;
	xmlStr["convid"] >> conID;

	DEBUG_LOG() << "--- OnAVSessionConnectedCB ENTER ";
	UCCallManager::OnAVSessionConnectedCB();
	DEBUG_LOG() << "--- OnAVSessionConnectedCB LEAVE ";

}
Пример #25
0
int UCSDK_CALL IsFavourite(const UCContact* member)
{
	DEBUG_LOG() << "--- ENTER";
	CHECK_POINTER(member, false);

	UCContactMgrAbsProxy* pUCContactMgrAbsProxy = UCContactMgrAbsProxy::GetInstance();
	CHECK_POINTER(pUCContactMgrAbsProxy, false);

	UCSDKContact contact;
	UCStructCopy::Copy_UCSDKContact(contact, *member);

	bool bRet = pUCContactMgrAbsProxy->IsFavourite(contact);
	INFO_PARAM1(bRet);

	int iRet = UC_Fail;
	if (bRet)
	{
		iRet = UC_Succ;
	}

	DEBUG_LOG() << "--- LEAVE";
	return iRet;
}
Пример #26
0
uc::model::conversation::AVSession* UCMeetingProxy::GetAVSession(conversation::Conversation* pConversation) const
{
	DEBUG_LOG() << "--- ENTER";
	INFO_PARAM1(pConversation);

	uc::model::conversation::AVSession* pAVSession = NULL;

	if (NULL == pConversation)
	{
		ERROR_LOG() << "pConversation is null.";
		DEBUG_LOG() << "--- LEAVE";
		return pAVSession;
	}

	pAVSession = dynamic_cast<uc::model::conversation::AVSession*>(pConversation->GetSession(uc::model::AudioVideo));
	if (NULL == pAVSession)
	{
		ERROR_LOG() << "Get av session failed.";
	}

	DEBUG_LOG() << "--- LEAVE";
	return pAVSession;
}
void UCEventMgr::EventAgent::NotifyContactStatus(void) const
{
	INFO_PARAM1(m_EventPara);
	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string uri;
	xmlStr["caller"] >> uri;

	Contact _contact;
	if(UC_SDK_Success != UCContactMgr::Instance().getContactByUri(uri,_contact))
	{
		return;
	}

	if(NULL == UCRegManager::Instance().m_pSubscribeMgr)
	{
		WARN_LOG() << "m_pSubscribeMgr is null";
		return;
	}

	std::string _desc;
	ContactAvailability _state = UCRegManager::Instance().m_pSubscribeMgr->GetContactStatus(uri,_desc);
	(void)UCRegManager::Instance().NotifyStatus(_contact,_state,_desc);
}
Пример #28
0
int UCSDK_CALL CanStartSession(const UCContact* member, int _type)
{
	DEBUG_LOG() << "--- ENTER";
	CHECK_POINTER(member, false);

	UCContactMgrAbsProxy* pUCContactMgrAbsProxy = UCContactMgrAbsProxy::GetInstance();
	CHECK_POINTER(pUCContactMgrAbsProxy, false);

	UCSDKContact contact;
	UCStructCopy::Copy_UCSDKContact(contact, *member);

	bool bRet = pUCContactMgrAbsProxy->CanStartSession(contact, (SESSION_TYPE_E)_type);
	INFO_PARAM1(bRet);

	int iRet = UC_Fail;
	if (bRet)
	{
		iRet = UC_Succ;
	}

	DEBUG_LOG() << "--- LEAVE";
	return iRet;
}
void UCEventMgr::EventAgent::NotifyVideo() const
{
	if(NULL == UCCallManager::OnVideoCallEventCB)
	{
		WARN_LOG() << "OnVideoCallEventCB is null";
		return;
	}

	INFO_PARAM1(m_EventPara);
	ctk::xml::XMLInStream xmlStr(m_EventPara);
	std::string strVideoState;
	xmlStr["video"] >> strVideoState;
	std::string strAcc;
	xmlStr["account"] >> strAcc;
	STVideoCallParam st={0};
	ctk::MemSet(st.ucAcc,0,STRING_LENGTH);
	ctk::MemCopy(st.ucAcc,strAcc.c_str(),(strAcc.size()<(STRING_LENGTH)) ? (strAcc.size()) : (STRING_LENGTH-1));

	if("connecting" == strVideoState)
	{
		st.callStatus = CALL_VIDEO_REQ;
	}
	else if("connected" == strVideoState)
	{
		st.callStatus = CALL_VIDEO_CONNECTED;
	}
	else
	{
		st.callStatus = CALL_VIDEO_CLOSE;
	}

	DEBUG_LOG() << "--- OnVideoCallEventCB ENTER ";
	UCCallManager::OnVideoCallEventCB(st);
	DEBUG_LOG() << "--- OnVideoCallEventCB LEAVE ";

}
Пример #30
0
// 解析入参Video_UL_parameter
eLTE_RET XMLProcess::XmlParseVideoULParameter(const std::string& xmlStr,	// 入参
		std::string& strVideoFormat, std::string& strCameraType,			// 出参
		std::string& strUserConfirmType, std::string& strMuteType)			// 出参
{
	/************************************************************************
	--- XML 格式 ---
	<Content>
		<VideoParam>
			<VideoFormat>D1、CIF、QCIF、720P或1080P</VideoFormat>
			<CameraType>“0”表示前置,“1”表示后置。</CameraType>
			<UserConfirmType>“0”表示不需要用户确认,“1”表示需要用户确认。</UserConfirmType>
			<MuteType>“0”表示需要伴音;“1”表示不需要伴音</MuteType>
		</VideoParam>
	</Content>
	************************************************************************/ 
	
	LOG_TRACE();
	INFO_PARAM1(xmlStr);

	CXml xmlParse;
	if (!xmlParse.Parse(xmlStr.c_str()))
	{
		LOG_RUN_ERROR("parse xml failed.");
		return eLTE_ERR_FAILED;
	}
	if (!xmlParse.FindElem("Content"))
	{
		LOG_RUN_ERROR("FindElem Content failed.");
		return eLTE_ERR_FAILED;
	}
	(void)xmlParse.IntoElem();
	if (!xmlParse.FindElem("VideoParam"))
	{
		LOG_RUN_ERROR("FindElem VideoParam failed.");
		return eLTE_ERR_FAILED;
	}
	(void)xmlParse.IntoElem();

	const unsigned int XML_VAR_LENGTH = 20;
	char elemValue[XML_VAR_LENGTH] = {0};
	const char* srcValue;
	unsigned int uiMaxLen = XML_VAR_LENGTH;

	GET_XML_ELEM_VALUE_CHAR(xmlParse, "VideoFormat", srcValue, elemValue, uiMaxLen);
	strVideoFormat = elemValue;

	uiMaxLen = XML_VAR_LENGTH;
	memset(elemValue, 0, sizeof(char)*XML_VAR_LENGTH);	
	GET_XML_ELEM_VALUE_CHAR(xmlParse, "CameraType", srcValue, elemValue, uiMaxLen);
	strCameraType = elemValue;

	uiMaxLen = XML_VAR_LENGTH;
	memset(elemValue, 0, sizeof(char)*XML_VAR_LENGTH);	
	GET_XML_ELEM_VALUE_CHAR(xmlParse, "UserConfirmType", srcValue, elemValue, uiMaxLen);
	strUserConfirmType = elemValue;

	uiMaxLen = XML_VAR_LENGTH;
	memset(elemValue, 0, sizeof(char)*XML_VAR_LENGTH);
	GET_XML_ELEM_VALUE_CHAR(xmlParse, "MuteType", srcValue, elemValue, uiMaxLen);
	strMuteType = elemValue;

	return eLTE_ERR_SUCCESS;
}