Sfoglia il codice sorgente

Z991239-5139 #comment 新增获取音视频配置,提挂机事件接口

80274480 1 anno fa
parent
commit
6599442d8c
28 ha cambiato i file con 762 aggiunte e 62 eliminazioni
  1. 0 2
      Module/mod_counterconnector/CMakeLists.txt
  2. 11 0
      Module/mod_counterconnector/ConnectorService.xml
  3. 49 0
      Module/mod_counterconnector/CounterConnector_client_g.h
  4. 28 0
      Module/mod_counterconnector/CounterConnector_def_g.h
  5. 16 0
      Module/mod_counterconnector/CounterConnector_msg_g.h
  6. 27 0
      Module/mod_counterconnector/CounterConnector_server_g.h
  7. 2 0
      Module/mod_counterconnector/http_callrouter.cpp
  8. 0 14
      Module/mod_counterconnector/http_callrouter.h
  9. 30 3
      Module/mod_counterconnector/mod_counterconnector.cpp
  10. 5 2
      Module/mod_counterconnector/mod_counterconnector.h
  11. 19 0
      Module/mod_interactivecontrol/InteractiveControl.xml
  12. 98 0
      Module/mod_interactivecontrol/InteractiveControl_client_g.h
  13. 50 0
      Module/mod_interactivecontrol/InteractiveControl_def_g.h
  14. 54 0
      Module/mod_interactivecontrol/InteractiveControl_server_g.h
  15. 80 3
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  16. 8 0
      Module/mod_interactivecontrol/mod_interactivecontrol.h
  17. 49 0
      Module/mod_mediacontroller/MediaController_client_g.h
  18. 24 0
      Module/mod_mediacontroller/MediaController_def_g.h
  19. 27 0
      Module/mod_mediacontroller/MediaController_server_g.h
  20. 38 31
      Module/mod_mediacontroller/MediaService.xml
  21. 1 0
      Module/mod_mediacontroller/mod_mediacontroller.h
  22. 13 1
      Module/mod_mediacontroller/unix/mod_mediacontroller.cpp
  23. 49 0
      Module/mod_sipphone/SIPPhone_client_g.h
  24. 26 0
      Module/mod_sipphone/SIPPhone_def_g.h
  25. 27 0
      Module/mod_sipphone/SIPPhone_server_g.h
  26. 11 0
      Module/mod_sipphone/SipService.xml
  27. 2 0
      Module/mod_sipphone/mod_sipphone.h
  28. 18 6
      Module/mod_sipphone/unix/mod_sipphone.cpp

+ 0 - 2
Module/mod_counterconnector/CMakeLists.txt

@@ -11,8 +11,6 @@ set(${MODULE_PREFIX}_SRCS
 	strutil.cpp
 	callroute_nodelist.h
 	callroute_nodelist.cpp
-	callroute_request.h
-	callroute_request.cpp
 	http_callrouter.h
 	http_callrouter.cpp
 	)

+ 11 - 0
Module/mod_counterconnector/ConnectorService.xml

@@ -23,6 +23,10 @@
 	<message name="PickUpCallMsg">
 		<param name="infos" type="string"/>
 	</message>
+	<message name="PickUpMicroPhoneEvt">
+		<param name="state" type="int"/>
+		<param name="infos" type="string"/>
+	</message>
 	<class name="ConnectService" overlap="true" exclusive="false">
 		<twoway name="StartCall" overlap="true">
 			<req>
@@ -62,5 +66,12 @@
 				<param name="ErrorMsg" type="wstring"/>
 			</res>
 		</twoway>
+		<twoway name="GetPickUpStatus" overlap="true">
+			<req>
+			</req>
+			<res>
+				<param name="iStatus" type="int"/>
+			</res>
+		</twoway>
 	</class>
 </entity>

+ 49 - 0
Module/mod_counterconnector/CounterConnector_client_g.h

@@ -304,6 +304,55 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum GetPickUpStatus(ConnectService_GetPickUpStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(ConnectService_Method_GetPickUpStatus, ConnectService_MethodSignature_GetPickUpStatus, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetPickUpStatus(ConnectService_GetPickUpStatus_Req &Req, ConnectService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetPickUpStatus(ConnectService_GetPickUpStatus_Req &Req, ConnectService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetPickUpStatus(ConnectService_GetPickUpStatus_Req &Req, ConnectService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 28 - 0
Module/mod_counterconnector/CounterConnector_def_g.h

@@ -26,12 +26,20 @@ namespace CounterConnector {
 #define ConnectService_Method_StopCall 2
 #define ConnectService_Method_GetCallRouteType 3
 #define ConnectService_Method_SetVideoCallRouteParams 4
+#define ConnectService_Method_GetPickUpStatus 5
 
 #define ConnectService_MethodSignature_StartCall -1910459811
 #define ConnectService_MethodSignature_StartCallExternal 40470846
 #define ConnectService_MethodSignature_StopCall 181632529
 #define ConnectService_MethodSignature_GetCallRouteType 1911492577
 #define ConnectService_MethodSignature_SetVideoCallRouteParams -240588169
+#define ConnectService_MethodSignature_GetPickUpStatus 1969791211
+
+#define ConnectService_LogCode_StartCall "QLR040230400"
+#define ConnectService_LogCode_StartCallExternal "QLR040230401"
+#define ConnectService_LogCode_StopCall "QLR040230402"
+#define ConnectService_LogCode_GetCallRouteType "QLR040230403"
+#define ConnectService_LogCode_SetVideoCallRouteParams "QLR040230404"
 
 struct ConnectService_StartCall_Req
 {
@@ -142,6 +150,26 @@ struct ConnectService_SetVideoCallRouteParams_Ans
 
 };
 
+struct ConnectService_GetPickUpStatus_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct ConnectService_GetPickUpStatus_Ans
+{
+	int iStatus;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & iStatus;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 16 - 0
Module/mod_counterconnector/CounterConnector_msg_g.h

@@ -13,11 +13,13 @@ namespace CounterConnector {
 #define eMsg_CallTransferInfo 1
 #define eMsg_AgentVideoType 2
 #define eMsg_PickUpCallMsg 3
+#define eMsg_PickUpMicroPhoneEvt 4
 
 #define eMsgSig_PhoneState -731514138
 #define eMsgSig_CallTransferInfo 1065141005
 #define eMsgSig_AgentVideoType 622887136
 #define eMsgSig_PickUpCallMsg -1154128776
+#define eMsgSig_PickUpMicroPhoneEvt -1739127963
 
 struct PhoneState
 {
@@ -73,5 +75,19 @@ struct PickUpCallMsg
 
 ///////////////////////////
 
+struct PickUpMicroPhoneEvt
+{
+	int state;
+	CSimpleStringA infos;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & state & infos;
+	}
+
+};
+
+///////////////////////////
+
 } // namespace CounterConnector
 #endif // __COUNTERCONNECTOR_MSG_G_H

+ 27 - 0
Module/mod_counterconnector/CounterConnector_server_g.h

@@ -65,6 +65,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ConnectService_Method_GetPickUpStatus:
+			if (dwSignature == ConnectService_MethodSignature_GetPickUpStatus) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -101,6 +108,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ConnectService_Method_GetPickUpStatus:
+			if (dwSignature != ConnectService_MethodSignature_GetPickUpStatus) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -133,6 +145,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetPickUpStatus(SpReqAnsContext<ConnectService_GetPickUpStatus_Req, ConnectService_GetPickUpStatus_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -199,6 +216,16 @@ public:
 						Handle_SetVideoCallRouteParams(ctx);
 					}
 					break;
+				case ConnectService_Method_GetPickUpStatus:
+					{
+						SpReqAnsContext<ConnectService_GetPickUpStatus_Req,ConnectService_GetPickUpStatus_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ConnectService_GetPickUpStatus_Req,ConnectService_GetPickUpStatus_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetPickUpStatus(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 2 - 0
Module/mod_counterconnector/http_callrouter.cpp

@@ -2,6 +2,7 @@
 #include "strutil.h"
 #include "Event.h"
 
+
 void HttpsLogCallBack(const char* logtxt) {
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI("HttpsLogCallBack")("HttpsLogCallBack: %s.", logtxt);
 }
@@ -53,6 +54,7 @@ static int get_http_callnodeinfo(node_info_t* pnode, const char* pcaller_num, co
 	return iret;
 }
 
+
 node_list_head_t* get_http_callroute_list(http_call_info_t* pinfo, int itimeout, bool bprintdbg)
 {
 	node_list_head_t* phead = NULL;

+ 0 - 14
Module/mod_counterconnector/http_callrouter.h

@@ -65,39 +65,25 @@ struct CallRouteHTTPRet : CHTTPRet {
 	bool m_success;
 
 	virtual bool Parse(string strData) {
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GrayLaunchResponse: data = %s", strData.c_str());
 		Json::Value root;
 		Json::Reader reader;
 
 		if (reader.parse(strData, root, false)) {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("reader parse success!");
 			m_success = root[REFLECTION(success)].asBool();
 			m_code = root[REFLECTION(code)].asString();
 			m_message = root[REFLECTION(message)].asString();
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_message = %s.", m_message.c_str());
 			m_returnCode = root[REFLECTION(returnCode)].asString();
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_returnCode = %s.", m_returnCode.c_str());
 			m_errorMsg = root[REFLECTION(errorMsg)].asString();
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_errorMsg = %s.", m_errorMsg.c_str());
 			if (m_success) {
 				m_call_route.m_accessNum = root[REFLECTION(data)][REFLECTION(accessNum)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_accessNum = %s.", m_call_route.m_accessNum.c_str());
 				m_call_route.m_branchNo = root[REFLECTION(data)][REFLECTION(branchNo)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_branchNo = %s.", m_call_route.m_branchNo.c_str());
 				m_call_route.m_clientLevel = root[REFLECTION(data)][REFLECTION(clientLevel)].asInt();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_clientLevel = %d.", m_call_route.m_clientLevel);
 				m_call_route.m_mediaGateAddress = root[REFLECTION(data)][REFLECTION(mediaGateAddress)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_mediaGateAddress = %s.", m_call_route.m_mediaGateAddress.c_str());
 				m_call_route.m_voiceGateAddress = root[REFLECTION(data)][REFLECTION(voiceGateAddress)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_voiceGateAddress = %s.", m_call_route.m_voiceGateAddress.c_str());
 				m_call_route.m_queueName = root[REFLECTION(data)][REFLECTION(queueName)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_queueName = %s.", m_call_route.m_queueName.c_str());
 				m_call_route.m_terminalNo = root[REFLECTION(data)][REFLECTION(terminalNo)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_terminalNo = %s.", m_call_route.m_terminalNo.c_str());
 				m_call_route.m_voiceGateAddressBackUp = root[REFLECTION(data)][REFLECTION(voiceGateAddressBackUp)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("voiceGateAddressBackUp = %s.", m_call_route.m_voiceGateAddressBackUp.c_str());
 				m_call_route.m_mediaGateAddressBackUp = root[REFLECTION(data)][REFLECTION(mediaGateAddressBackUp)].asString();
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_mediaGateAddressBackUp = %s.", m_call_route.m_mediaGateAddressBackUp.c_str());
 			}
 		}
 		else {

+ 30 - 3
Module/mod_counterconnector/mod_counterconnector.cpp

@@ -60,11 +60,11 @@ ErrorCodeEnum CCounterConnectorEntity ::__OnStart(ErrorCodeEnum preOperationErro
 		m_bIsPadType = FALSE;
 	}
 
-	m_IsStand2SType = TRUE;
+	m_IsStandType = TRUE;
 
 	DeviceTypeEnum eDeviceType = RvcGetDeviceType();
 	if (eStand1SPlusType != eDeviceType && eStand2sType != eDeviceType) {
-		m_IsStand2SType = FALSE;
+		m_IsStandType = FALSE;
 	}
 
 	m_fsm.Init(this);
@@ -334,6 +334,16 @@ void CCounterConnectorEntity::HandleGetVideoFailedEvent()
 	LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_GET_VIDEO_FAILED_INFO, strinfo);
 }
 
+
+void CCounterConnectorEntity::HandlePickUpMicroPhoneEvent(int iEvent, const char* strMsg)
+{
+	PickUpMicroPhoneEvt evt;
+	evt.state = iEvent;
+	evt.infos = strMsg;
+	SpSendBroadcast(GetFunction(), SP_MSG_OF(PickUpMicroPhoneEvt), SP_MSG_SIG_OF(PickUpMicroPhoneEvt), evt);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SpSendBroadcast PickUp MicroPhone Event to UI.");
+}
+
 ErrorCodeEnum CCounterConnectorEntity ::__OnClose(ErrorCodeEnum preOperationError)
 {
 	if (preOperationError != Error_Succeed) {
@@ -370,6 +380,7 @@ void CCounterConnectorEntity ::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUI
 			CSimpleStringA strValue;
 			GetFunction()->GetSysVar("CallState", strValue);
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("摘机,and CallState is %s.", strValue.GetData());
+			HandlePickUpMicroPhoneEvent(1, "pick up microphone.");
 		}
 		break;
 	case EVENT_MOD_CONNECT_GPIO_HANDFREE:
@@ -382,6 +393,7 @@ void CCounterConnectorEntity ::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUI
 			CSimpleStringA strValue;
 			GetFunction()->GetSysVar("CallState", strValue);
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("挂机,and CallState is %s.", strValue.GetData());
+			HandlePickUpMicroPhoneEvent(0, "hang up microphone.");
 		}
 		break;
 	case EVENT_MOD_CONNECT_PICKUP_CALL: // 提机呼叫
@@ -828,7 +840,7 @@ void CCounterConnectorEntity::Handle_StartRemoteRecord(const char* pszMessage)
 void CCounterConnectorEntity::StopRemoteRecordSpeakerAudioCapture()
 {
 	if(DOUBLERECORD_CALLTYPE == m_fsm.m_CallingParam.nCallType){
-		if (TRUE == m_IsStand2SType){
+		if (TRUE == m_IsStandType){
 			if (FALSE == m_bIsRemoteRecordStopSpeakerCapture){
 				if (Error_Succeed == m_fsm.StopSpeakerAudioCapture()){
 					m_bIsRemoteRecordStopSpeakerCapture = TRUE;
@@ -1069,6 +1081,21 @@ void CCounterConnectorSession::Handle_SetVideoCallRouteParams(SpReqAnsContext<Co
 }
 
 
+void CCounterConnectorSession::Handle_GetPickUpStatus(SpReqAnsContext<ConnectService_GetPickUpStatus_Req, ConnectService_GetPickUpStatus_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+
+	if (m_pEntity->m_fsm.m_bHandFree) {
+		ctx->Ans.iStatus = 0;
+	}
+	else {
+		ctx->Ans.iStatus = 1;
+	}
+
+	ctx->Answer(Error_Succeed);
+}
+
+
 void CCounterConnectorSession::OnClose(ErrorCodeEnum eErrorCode )
 {
 	LOG_FUNCTION();

+ 5 - 2
Module/mod_counterconnector/mod_counterconnector.h

@@ -15,13 +15,14 @@
 #include "chan_protocol.h"
 #include "CounterConnector_server_g.h"
 
-class CCounterConnectorEntity ;
+class CCounterConnectorEntity;
 
 class CCounterConnectorSession : public ConnectService_ServerSessionBase
 {
 public:
 	CCounterConnectorSession(CCounterConnectorEntity *pEntity) : m_pEntity(pEntity)
 	{
+
 	}
 	virtual void Handle_StartCall(SpReqAnsContext<ConnectService_StartCall_Req, ConnectService_StartCall_Ans>::Pointer ctx);
 	virtual void Handle_StartCallExternal(SpReqAnsContext<ConnectService_StartCallExternal_Req, ConnectService_StartCallExternal_Ans>::Pointer ctx);
@@ -29,6 +30,7 @@ public:
 	virtual void OnClose(ErrorCodeEnum eErrorCode);
 	virtual void Handle_GetCallRouteType(SpReqAnsContext<ConnectService_GetCallRouteType_Req, ConnectService_GetCallRouteType_Ans>::Pointer ctx);
 	virtual void Handle_SetVideoCallRouteParams(SpReqAnsContext<ConnectService_SetVideoCallRouteParams_Req, ConnectService_SetVideoCallRouteParams_Ans>::Pointer ctx);
+	virtual void Handle_GetPickUpStatus(SpReqAnsContext<ConnectService_GetPickUpStatus_Req, ConnectService_GetPickUpStatus_Ans>::Pointer ctx);
 
 
 private:
@@ -90,6 +92,7 @@ public:
 	ErrorCodeEnum SetCallRouteParams(CSimpleStringA strQueueName, CSimpleStringA strClientLevel);
 	void HandlePickUpCallEvent();
 	void HandleGetVideoFailedEvent();
+	void HandlePickUpMicroPhoneEvent(int iEvent, const char* strMsg);
 
 	virtual bool IsService()const;
 	virtual void OnTimeout(DWORD dwTimerID);
@@ -104,7 +107,7 @@ public:
 
 private:
 	BOOL m_bIsPadType;
-	BOOL m_IsStand2SType;
+	BOOL m_IsStandType;
 	ChannelCounterConnectorClient*m_pCounterConnectorChannel;
 	CAutoArray<CUUID> m_arrListener;
 	CUUID m_uidlivenessListener;

+ 19 - 0
Module/mod_interactivecontrol/InteractiveControl.xml

@@ -490,6 +490,25 @@
 				<param name="strDevices" type="string"/>
 			</res>
 		</twoway>
+		<twoway name="GetMediaDeviceInfo" overlap="true">
+			<req>
+			</req>
+			<res>
+				<param name="HandfreeIn" type="string"/>
+				<param name="HandfreeOut" type="string"/>
+				<param name="PickupIn" type="string"/>
+				<param name="PickupOut" type="string"/>
+				<param name="EnvCamera" type="string"/>
+				<param name="OptCamera" type="string"/>
+			</res>
+		</twoway>
+		<twoway name="GetPickUpStatus" overlap="true">
+			<req>
+			</req>
+			<res>
+				<param name="iStatus" type="int"/>
+			</res>
+		</twoway>
 	</class>
 	
 

+ 98 - 0
Module/mod_interactivecontrol/InteractiveControl_client_g.h

@@ -2724,6 +2724,104 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum GetMediaDeviceInfo(UIService_GetMediaDeviceInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(UIService_Method_GetMediaDeviceInfo, UIService_MethodSignature_GetMediaDeviceInfo, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetMediaDeviceInfo(UIService_GetMediaDeviceInfo_Req &Req, UIService_GetMediaDeviceInfo_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetMediaDeviceInfo(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetMediaDeviceInfo(UIService_GetMediaDeviceInfo_Req &Req, UIService_GetMediaDeviceInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetMediaDeviceInfo(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetMediaDeviceInfo(UIService_GetMediaDeviceInfo_Req &Req, UIService_GetMediaDeviceInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetMediaDeviceInfo(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
+	ErrorCodeEnum GetPickUpStatus(UIService_GetPickUpStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(UIService_Method_GetPickUpStatus, UIService_MethodSignature_GetPickUpStatus, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetPickUpStatus(UIService_GetPickUpStatus_Req &Req, UIService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetPickUpStatus(UIService_GetPickUpStatus_Req &Req, UIService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetPickUpStatus(UIService_GetPickUpStatus_Req &Req, UIService_GetPickUpStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetPickUpStatus(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 50 - 0
Module/mod_interactivecontrol/InteractiveControl_def_g.h

@@ -84,6 +84,8 @@ namespace InteractiveControl {
 #define UIService_Method_GetAudioInDevices 62
 #define UIService_Method_GetAudioOutDevices 63
 #define UIService_Method_GetCameraInfo 64
+#define UIService_Method_GetMediaDeviceInfo 65
+#define UIService_Method_GetPickUpStatus 66
 
 #define UIService_MethodSignature_SetUIState -649355360
 #define UIService_MethodSignature_SendAgentText -389826246
@@ -150,6 +152,9 @@ namespace InteractiveControl {
 #define UIService_MethodSignature_GetAudioInDevices -541811993
 #define UIService_MethodSignature_GetAudioOutDevices -1224223001
 #define UIService_MethodSignature_GetCameraInfo 180376278
+#define UIService_MethodSignature_GetMediaDeviceInfo -887802742
+#define UIService_MethodSignature_GetPickUpStatus -1057807018
+
 
 #define UIService_LogCode_SetUIState "QLR040230B00"
 #define UIService_LogCode_SendAgentText "QLR040230B01"
@@ -1421,6 +1426,51 @@ struct UIService_GetCameraInfo_Ans
 
 };
 
+struct UIService_GetMediaDeviceInfo_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct UIService_GetMediaDeviceInfo_Ans
+{
+	CSimpleStringA HandfreeIn;
+	CSimpleStringA HandfreeOut;
+	CSimpleStringA PickupIn;
+	CSimpleStringA PickupOut;
+	CSimpleStringA EnvCamera;
+	CSimpleStringA OptCamera;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & HandfreeIn & HandfreeOut & PickupIn & PickupOut & EnvCamera & OptCamera;
+	}
+
+};
+
+struct UIService_GetPickUpStatus_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct UIService_GetPickUpStatus_Ans
+{
+	int iStatus;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & iStatus;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 54 - 0
Module/mod_interactivecontrol/InteractiveControl_server_g.h

@@ -485,6 +485,20 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case UIService_Method_GetMediaDeviceInfo:
+			if (dwSignature == UIService_MethodSignature_GetMediaDeviceInfo) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case UIService_Method_GetPickUpStatus:
+			if (dwSignature == UIService_MethodSignature_GetPickUpStatus) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -821,6 +835,16 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case UIService_Method_GetMediaDeviceInfo:
+			if (dwSignature != UIService_MethodSignature_GetMediaDeviceInfo) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case UIService_Method_GetPickUpStatus:
+			if (dwSignature != UIService_MethodSignature_GetPickUpStatus) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -1153,6 +1177,16 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetMediaDeviceInfo(SpReqAnsContext<UIService_GetMediaDeviceInfo_Req, UIService_GetMediaDeviceInfo_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
+	virtual void Handle_GetPickUpStatus(SpReqAnsContext<UIService_GetPickUpStatus_Req, UIService_GetPickUpStatus_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -1819,6 +1853,26 @@ public:
 						Handle_GetCameraInfo(ctx);
 					}
 					break;
+				case UIService_Method_GetMediaDeviceInfo:
+					{
+						SpReqAnsContext<UIService_GetMediaDeviceInfo_Req,UIService_GetMediaDeviceInfo_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<UIService_GetMediaDeviceInfo_Req,UIService_GetMediaDeviceInfo_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetMediaDeviceInfo(ctx);
+					}
+					break;
+				case UIService_Method_GetPickUpStatus:
+					{
+						SpReqAnsContext<UIService_GetPickUpStatus_Req,UIService_GetPickUpStatus_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<UIService_GetPickUpStatus_Req,UIService_GetPickUpStatus_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetPickUpStatus(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 80 - 3
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -212,7 +212,7 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
 	}
 		
 	m_eDeviceType = RvcGetDeviceType();
-	
+
 	if (eMobilePadType == m_eDeviceType)
 	{
 		Error = pFunc->RegistSysVarEvent("CameraState", this);
@@ -1867,7 +1867,6 @@ void CITCtrlEntity::FreeSipPhoneClient()
 	}
 }
 
-
 bool CITCtrlEntity::IsMediaCtrEntityAvailable()
 {
 	if (Error_Succeed == ConnectMediaCtr()) {
@@ -1916,7 +1915,6 @@ void CITCtrlEntity:: FreeMediaCtrClient()
 	}
 }
 
-
 void CITCtrlEntity::OnTimeout(DWORD dwTimerID)
 {
 	if (1 == dwTimerID)
@@ -1954,6 +1952,7 @@ bool CITCtrlEntity::IsSupportTransRecordDeviceType()
 	return bRet;
 }
 
+
 ErrorCodeEnum CITCtrlEntity::StartTransactionRecord(CSimpleStringA strVideoName)
 {
 	char strmsg[MAX_PATH] = { 0 };
@@ -2136,6 +2135,72 @@ ErrorCodeEnum CITCtrlEntity::GetVideoDeviceInfo(int& iDeviceCount, CSimpleString
 }
 
 
+ErrorCodeEnum CITCtrlEntity::GetMediaDeviceInfo(CSimpleStringA& strHandfreeIn, CSimpleStringA& strHandfreeOut, CSimpleStringA& strPickUpIn, CSimpleStringA& strPickUpOut, CSimpleStringA& strEnvCamera, CSimpleStringA& strOptCamera, DWORD dwTimeout)
+{
+	auto rc = Error_Succeed;
+
+	if (!IsMediaCtrEntityAvailable() || !IsSipPhoneEntityAvailable()) {
+		rc = Error_DevConnFailed;
+	}
+	else {
+		MediaService_GetCameraInfos_Req camerareq;
+		MediaService_GetCameraInfos_Ans cameraans;
+		rc = (*m_pMediaCtlClient)(EntityResource::getLink().upgradeLink())->GetCameraInfos(camerareq, cameraans, 5000);
+
+		if (Error_Succeed == rc) {
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get camera info success.");
+			strEnvCamera = cameraans.strEnvCamera;
+			strOptCamera = cameraans.strOptCamera;
+		}
+		else {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get camera info failed for 0x%08x.", rc);
+		}
+
+		PhoneService_GetAudioDevices_Req audioreq;
+		PhoneService_GetAudioDevices_Ans audioans;
+		rc = (*m_pSipPhoneClient)(EntityResource::getLink().upgradeLink())->GetAudioDevices(audioreq, audioans, 5000);
+
+		if (Error_Succeed == rc) {
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get audio device info success.");
+			strHandfreeIn = audioans.strHandfreeIn;
+			strHandfreeOut = audioans.strHandfreeOut;
+			strPickUpIn = audioans.strPickupIn;
+			strPickUpOut = audioans.strPickupOut;
+		}
+		else {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get audio device info failed for 0x%08x.", rc);
+		}
+	}
+
+	return rc;
+}
+
+
+ErrorCodeEnum CITCtrlEntity::GetPickUpStatus(int& iStatus, DWORD dwTimeout)
+{
+	auto rc = Error_Succeed;
+
+	if (!IsCounterConnectorEntityAvailable()) {
+		rc = Error_DevConnFailed;
+	}
+	else {
+		ConnectService_GetPickUpStatus_Req req;
+		ConnectService_GetPickUpStatus_Ans ans;
+		rc = (*m_pConnectClient)(EntityResource::getLink().upgradeLink())->GetPickUpStatus(req, ans, 5000);
+
+		if (Error_Succeed == rc) {
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get pickup status success.");
+			iStatus = ans.iStatus;
+		}
+		else {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get pickup status failed for 0x%08x.", rc);
+		}
+	}
+
+	return rc;
+}
+
+
 void UIServiceSession::Handle_SetUIState(SpOnewayCallContext<UIService_SetUIState_Info>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
@@ -2772,7 +2837,19 @@ void UIServiceSession::Handle_GetCameraInfo(SpReqAnsContext<UIService_GetCameraI
 	ctx->Answer(Error);
 }
 
+void UIServiceSession::Handle_GetMediaDeviceInfo(SpReqAnsContext<UIService_GetMediaDeviceInfo_Req, UIService_GetMediaDeviceInfo_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+	ErrorCodeEnum Error = m_pEntity->GetMediaDeviceInfo(ctx->Ans.HandfreeIn, ctx->Ans.HandfreeOut, ctx->Ans.PickupIn, ctx->Ans.PickupOut, ctx->Ans.EnvCamera, ctx->Ans.OptCamera, 2000);
+	ctx->Answer(Error);
+}
 
+void UIServiceSession::Handle_GetPickUpStatus(SpReqAnsContext<UIService_GetPickUpStatus_Req, UIService_GetPickUpStatus_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+	ErrorCodeEnum Error = m_pEntity->GetPickUpStatus(ctx->Ans.iStatus, 2000);
+	ctx->Answer(Error);
+}
 
 ChannelClient::ChannelClient( CITCtrlEntity *pEntity ) : ChannelService_ClientBase(pEntity)
 {

+ 8 - 0
Module/mod_interactivecontrol/mod_interactivecontrol.h

@@ -227,6 +227,10 @@ public:
 
 	ErrorCodeEnum GetVideoDeviceInfo(int& iDeviceCount, CSimpleStringA& strVideoDev, DWORD dwTimeout);
 
+	ErrorCodeEnum GetMediaDeviceInfo(CSimpleStringA& strHandfreeIn, CSimpleStringA& strHandfreeOut, CSimpleStringA& strPickUpIn, CSimpleStringA& strPickUpOut, CSimpleStringA& strEnvCamera, CSimpleStringA& strOptCamera, DWORD dwTimeout);
+
+	ErrorCodeEnum GetPickUpStatus(int& iStatus, DWORD dwTimeout);
+
 private:
 	ErrorCodeEnum ConnectAssistChannel();
 
@@ -458,6 +462,10 @@ public:
 
 	virtual void Handle_GetCameraInfo(SpReqAnsContext<UIService_GetCameraInfo_Req, UIService_GetCameraInfo_Ans>::Pointer ctx);
 
+	virtual void Handle_GetMediaDeviceInfo(SpReqAnsContext<UIService_GetMediaDeviceInfo_Req, UIService_GetMediaDeviceInfo_Ans>::Pointer ctx);
+
+	virtual void Handle_GetPickUpStatus(SpReqAnsContext<UIService_GetPickUpStatus_Req, UIService_GetPickUpStatus_Ans>::Pointer ctx);
+
 private:
 	CITCtrlEntity *m_pEntity;
 };

+ 49 - 0
Module/mod_mediacontroller/MediaController_client_g.h

@@ -374,6 +374,55 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum GetCameraInfos(MediaService_GetCameraInfos_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(MediaService_Method_GetCameraInfos, MediaService_MethodSignature_GetCameraInfos, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetCameraInfos(MediaService_GetCameraInfos_Req &Req, MediaService_GetCameraInfos_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetCameraInfos(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetCameraInfos(MediaService_GetCameraInfos_Req &Req, MediaService_GetCameraInfos_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetCameraInfos(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetCameraInfos(MediaService_GetCameraInfos_Req &Req, MediaService_GetCameraInfos_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetCameraInfos(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 24 - 0
Module/mod_mediacontroller/MediaController_def_g.h

@@ -22,6 +22,7 @@ namespace MediaController {
 #define MediaService_Method_ManipulateMediaDevice 7
 #define MediaService_Method_GetAudioDevices 8
 #define MediaService_Method_GetVideoDevices 9
+#define MediaService_Method_GetCameraInfos 10
 
 #define MediaService_MethodSignature_GetVideoDeviceName -496217232
 #define MediaService_MethodSignature_StartCamera 749460891
@@ -33,6 +34,7 @@ namespace MediaController {
 #define MediaService_MethodSignature_ManipulateMediaDevice -461255211
 #define MediaService_MethodSignature_GetAudioDevices -819377328
 #define MediaService_MethodSignature_GetVideoDevices 616397805
+#define MediaService_MethodSignature_GetCameraInfos -2116637958
 
 #define MediaService_LogCode_GetVideoDeviceName "QLR040220800"
 #define MediaService_LogCode_StartCamera "QLR040220801"
@@ -202,6 +204,28 @@ struct MediaService_GetVideoDevices_Ans
 
 };
 
+struct MediaService_GetCameraInfos_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct MediaService_GetCameraInfos_Ans
+{
+	int retCode;
+	CSimpleStringA strEnvCamera;
+	CSimpleStringA strOptCamera;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & retCode & strEnvCamera & strOptCamera;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 27 - 0
Module/mod_mediacontroller/MediaController_server_g.h

@@ -100,6 +100,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case MediaService_Method_GetCameraInfos:
+			if (dwSignature == MediaService_MethodSignature_GetCameraInfos) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -161,6 +168,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case MediaService_Method_GetCameraInfos:
+			if (dwSignature != MediaService_MethodSignature_GetCameraInfos) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -218,6 +230,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetCameraInfos(SpReqAnsContext<MediaService_GetCameraInfos_Req, MediaService_GetCameraInfos_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -334,6 +351,16 @@ public:
 						Handle_GetVideoDevices(ctx);
 					}
 					break;
+				case MediaService_Method_GetCameraInfos:
+					{
+						SpReqAnsContext<MediaService_GetCameraInfos_Req,MediaService_GetCameraInfos_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<MediaService_GetCameraInfos_Req,MediaService_GetCameraInfos_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetCameraInfos(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 38 - 31
Module/mod_mediacontroller/MediaService.xml

@@ -23,39 +23,46 @@
 		<oneway name="StopSpeakerRender" overlap="true">
 		</oneway>
 		<twoway name="ManipulateMediaDevice" overlap="true">
-            <req>
-                <!--操作意图指令: 0:获取并接管设备权限;1:归还设备权限,不再占用-->
-                <param name="cmdType" type="int"/>
-                <!--设备类型:0:无效参数;1:ENV环境摄像头;2:OPT操作摄像头;3:EWS外部广角摄像头;4:高拍仪文档摄像头;5:高拍仪上接摄像头-->
-                <param name="devType" type="int"/>
-                <param name="reserved1" type="int"/>
-                <param name="reserved2" type="string"/>
-            </req>
-                <!--实体收到接口请求时无论操作成功与否返回Answer(Error_Succeed),具体操作成功与否通过retCode标识-->
-            <res>
-                <!--retCode:0:表示成功,非0:表示失败 -->
-                <param name="retCode" type="int"/>
-                <param name="reserved1" type="int"/>
-                <param name="reserved2" type="string"/>
-            </res>
-        </twoway>
+            		<req>
+                		<!--操作意图指令: 0:获取并接管设备权限;1:归还设备权限,不再占用-->
+                		<param name="cmdType" type="int"/>
+                		<!--设备类型:0:无效参数;1:ENV环境摄像头;2:OPT操作摄像头;3:EWS外部广角摄像头;4:高拍仪文档摄像头;5:高拍仪上接摄像头-->
+                		<param name="devType" type="int"/>
+                		<param name="reserved1" type="int"/>
+                		<param name="reserved2" type="string"/>
+            		</req>
+                	<!--实体收到接口请求时无论操作成功与否返回Answer(Error_Succeed),具体操作成功与否通过retCode标识-->
+            		<res>
+                		<!--retCode:0:表示成功,非0:表示失败 -->
+                		<param name="retCode" type="int"/>
+                		<param name="reserved1" type="int"/>
+                		<param name="reserved2" type="string"/>
+            		</res>
+        	</twoway>
 		<twoway name="GetAudioDevices" overlap="true">
-            <req>
-                <param name="audioType" type="int"/>
-            </req>
-            <res>
-                <param name="retCode" type="int"/>
-		<param name="deviceCount" type="int"/>
-                <param name="strNames" type="string"/>
-            </res>
-        </twoway>
+            		<req>
+                		<param name="audioType" type="int"/>
+            		</req>
+            		<res>
+                		<param name="retCode" type="int"/>
+				<param name="deviceCount" type="int"/>
+                		<param name="strNames" type="string"/>
+            		</res>
+        	</twoway>
 		<twoway name="GetVideoDevices" overlap="true">
-            <res>
-                <param name="retCode" type="int"/>
-		<param name="deviceCount" type="int"/>
-                <param name="strNames" type="string"/>
-            </res>
-        </twoway>
+            		<res>
+                		<param name="retCode" type="int"/>
+				<param name="deviceCount" type="int"/>
+                		<param name="strNames" type="string"/>
+            		</res>
+       		 </twoway>
+		<twoway name="GetCameraInfos" overlap="true">
+            		<res>
+                		<param name="retCode" type="int"/>
+                		<param name="strEnvCamera" type="string"/>
+				<param name="strOptCamera" type="string"/>
+            		</res>
+        	</twoway>
 	</class>
 	<!-- 内置摄像头切换外接摄像头失败消息 -->
 	<message name="ExternalCameraSwitchFailed">

+ 1 - 0
Module/mod_mediacontroller/mod_mediacontroller.h

@@ -61,6 +61,7 @@ public:
 	virtual void Handle_ManipulateMediaDevice(SpReqAnsContext<MediaService_ManipulateMediaDevice_Req, MediaService_ManipulateMediaDevice_Ans>::Pointer ctx);
 	virtual void Handle_GetAudioDevices(SpReqAnsContext<MediaService_GetAudioDevices_Req, MediaService_GetAudioDevices_Ans>::Pointer ctx);
 	virtual void Handle_GetVideoDevices(SpReqAnsContext<MediaService_GetVideoDevices_Req, MediaService_GetVideoDevices_Ans>::Pointer ctx);
+	virtual void Handle_GetCameraInfos(SpReqAnsContext<MediaService_GetCameraInfos_Req, MediaService_GetCameraInfos_Ans>::Pointer ctx);
 
 private:
 	CMediaControllerEntity *m_pEntity;

+ 13 - 1
Module/mod_mediacontroller/unix/mod_mediacontroller.cpp

@@ -1898,7 +1898,6 @@ ErrorCodeEnum CMediaControllerEntity::HandleSalesRecordPCMAudio(bool bRemoteReco
 		
 	FILE *pRecord = fopen(strMicroName, "wb+");
 	if (NULL != pRecord){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fopen %s success.", strMicroName);
 		if (Error_Succeed == StartSalesRecordAudioCapture(bRemoteRecord, eSingleWriteLocal, pRecord)){
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin remote sales record audio capture and record local PCM.");
 		}
@@ -2121,11 +2120,13 @@ SelfChekerClient::SelfChekerClient( CMediaControllerEntity *pEntity ) : SelfChec
 
 }
 
+
 ChannelMediaControllerClient::ChannelMediaControllerClient( CMediaControllerEntity *pEntity ) : ChannelService_ClientBase(pEntity)
 {
 
 }
 
+
 void ChannelMediaControllerClient::OnMessage(ErrorCodeEnum Error, ChannelService_State_Info &Msg, CSmartPointer<IReleasable> pData)
 {
 	if (Error == Error_Succeed) 
@@ -2269,6 +2270,17 @@ void MediaServiceSession::Handle_GetVideoDevices(SpReqAnsContext<MediaService_Ge
 }
 
 
+void MediaServiceSession::Handle_GetCameraInfos(SpReqAnsContext<MediaService_GetCameraInfos_Req, MediaService_GetCameraInfos_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+	ErrorCodeEnum Error = Error_Succeed;
+
+	ctx->Ans.strEnvCamera = m_pEntity->conf.strVideoEnv;
+	ctx->Ans.strOptCamera = m_pEntity->conf.strVideoOpt;
+	ctx->Ans.retCode = (int)Error;
+
+	ctx->Answer(Error_Succeed);
+}
 
 
 SP_BEGIN_ENTITY_MAP()

+ 49 - 0
Module/mod_sipphone/SIPPhone_client_g.h

@@ -715,6 +715,55 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum GetAudioDevices(PhoneService_GetAudioDevices_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(PhoneService_Method_GetAudioDevices, PhoneService_MethodSignature_GetAudioDevices, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetAudioDevices(PhoneService_GetAudioDevices_Req &Req, PhoneService_GetAudioDevices_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetAudioDevices(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetAudioDevices(PhoneService_GetAudioDevices_Req &Req, PhoneService_GetAudioDevices_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetAudioDevices(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetAudioDevices(PhoneService_GetAudioDevices_Req &Req, PhoneService_GetAudioDevices_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetAudioDevices(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 26 - 0
Module/mod_sipphone/SIPPhone_def_g.h

@@ -39,6 +39,7 @@ namespace SIPPhone {
 #define PhoneService_Method_SetHandfreeInVolume 17
 #define PhoneService_Method_SetPickupInVolume 18
 #define PhoneService_Method_GetPickupInVolume 19
+#define PhoneService_Method_GetAudioDevices 20
 
 #define PhoneService_MethodSignature_MakeCall -1045574280
 #define PhoneService_MethodSignature_HangupCall 507892508
@@ -60,6 +61,7 @@ namespace SIPPhone {
 #define PhoneService_MethodSignature_SetHandfreeInVolume -1471315400
 #define PhoneService_MethodSignature_SetPickupInVolume 35636029
 #define PhoneService_MethodSignature_GetPickupInVolume -735373015
+#define PhoneService_MethodSignature_GetAudioDevices -271351251
 
 #define PhoneService_LogCode_MakeCall "QLR040230100"
 #define PhoneService_LogCode_HangupCall "QLR040230101"
@@ -430,6 +432,30 @@ struct PhoneService_GetPickupInVolume_Ans
 
 };
 
+struct PhoneService_GetAudioDevices_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct PhoneService_GetAudioDevices_Ans
+{
+	int retCode;
+	CSimpleStringA strHandfreeIn;
+	CSimpleStringA strHandfreeOut;
+	CSimpleStringA strPickupIn;
+	CSimpleStringA strPickupOut;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & retCode & strHandfreeIn & strHandfreeOut & strPickupIn & strPickupOut;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 27 - 0
Module/mod_sipphone/SIPPhone_server_g.h

@@ -163,6 +163,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case PhoneService_Method_GetAudioDevices:
+			if (dwSignature == PhoneService_MethodSignature_GetAudioDevices) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -269,6 +276,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case PhoneService_Method_GetAudioDevices:
+			if (dwSignature != PhoneService_MethodSignature_GetAudioDevices) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -371,6 +383,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetAudioDevices(SpReqAnsContext<PhoneService_GetAudioDevices_Req, PhoneService_GetAudioDevices_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -573,6 +590,16 @@ public:
 						Handle_GetPickupInVolume(ctx);
 					}
 					break;
+				case PhoneService_Method_GetAudioDevices:
+					{
+						SpReqAnsContext<PhoneService_GetAudioDevices_Req,PhoneService_GetAudioDevices_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<PhoneService_GetAudioDevices_Req,PhoneService_GetAudioDevices_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetAudioDevices(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 11 - 0
Module/mod_sipphone/SipService.xml

@@ -134,6 +134,17 @@
 				<param name="Volume" type="int"/>
 			</res>
 		</twoway>
+		<twoway name="GetCameraInfos" overlap="true">
+			<req>
+			</req>
+      <res>
+        <param name="retCode" type="int"/>
+        <param name="strHandfreeIn" type="string"/>
+				<param name="strHandfreeOut" type="string"/>
+				<param name="strPickupIn" type="string"/>
+				<param name="strPickupOut" type="string"/>
+      </res>
+    </twoway>
 	</class>
 	<!-- ÊÓÆµ¿ò¿ªÊ¼Òƶ¯ÏûÏ¢ -->
 	<message name="VideoBoxStartMove">

+ 2 - 0
Module/mod_sipphone/mod_sipphone.h

@@ -6,6 +6,7 @@ using namespace SIPPhone;
 
 #include "SpBase.h"
 #include "SpIni.h"
+#include "endpoint.h"
 
 #if defined(RVC_OS_WIN)
 #include "volumekeeper.h"
@@ -240,6 +241,7 @@ public:
 	virtual void Handle_SetHandfreeInVolume(SpReqAnsContext<PhoneService_SetHandfreeInVolume_Req, PhoneService_SetHandfreeInVolume_Ans>::Pointer ctx);
 	virtual void Handle_SetPickupInVolume(SpReqAnsContext<PhoneService_SetPickupInVolume_Req, PhoneService_SetPickupInVolume_Ans>::Pointer ctx);
 	virtual void Handle_GetPickupInVolume(SpReqAnsContext<PhoneService_GetPickupInVolume_Req, PhoneService_GetPickupInVolume_Ans>::Pointer ctx);
+	virtual void Handle_GetAudioDevices(SpReqAnsContext<PhoneService_GetAudioDevices_Req, PhoneService_GetAudioDevices_Ans>::Pointer ctx);
 
 public:
 	void on_call_state(int state, const char *state_desc, const char *phrase);

+ 18 - 6
Module/mod_sipphone/unix/mod_sipphone.cpp

@@ -1,7 +1,6 @@
 #include "stdafx.h"
 
 #include "pthread.h"
-#include "endpoint.h"
 #include "mod_sipphone.h"
 
 #include "../mod_agentip/sysvar.h"
@@ -1244,19 +1243,19 @@ ErrorCodeEnum CSIPEntity::RvcGetAudioDeviceInfo()
 	ErrorCodeEnum Error = Error_Param;
 	if (NULL != m_pAudioMgr) {
 		int icountmic = m_pAudioMgr->audio_get_device_count(true);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio input device(%d):", icountmic);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("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_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
 		}
 		int icountspeaker = m_pAudioMgr->audio_get_device_count(false);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio output device(%d):", icountspeaker);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("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_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, strname);
 		}
 		Error = Error_Succeed;
 	}
@@ -1268,7 +1267,7 @@ ErrorCodeEnum CSIPEntity::RvcSetSaveAudioVolume()
 {
 	ErrorCodeEnum Error = Error_Succeed;
 	if (eStand2sType == m_eDeviceType) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("handfree out volume is %d, handfree in volume is %d, pickup out volume is %d, pickup in volume %d", m_kept_volume_out[DEV_HANDFREE], m_kept_volume_in[DEV_HANDFREE], m_kept_volume_out[DEV_PICKUP], m_kept_volume_in[DEV_PICKUP]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("handfree out volume is %d, handfree in volume is %d, pickup out volume is %d, pickup in volume %d", m_kept_volume_out[DEV_HANDFREE], m_kept_volume_in[DEV_HANDFREE], m_kept_volume_out[DEV_PICKUP], m_kept_volume_in[DEV_PICKUP]);
 		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);
@@ -2571,6 +2570,19 @@ void CSIPPhoneSession::Handle_GetPickupInVolume(SpReqAnsContext<PhoneService_Get
 	ctx->Answer(Error_Succeed);
 }
 
+void CSIPPhoneSession::Handle_GetAudioDevices(SpReqAnsContext<PhoneService_GetAudioDevices_Req, PhoneService_GetAudioDevices_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+
+	ctx->Ans.strHandfreeIn = m_pEntity->conf.audio_handfree_in_dev;
+	ctx->Ans.strHandfreeOut = m_pEntity->conf.audio_handfree_out_dev;
+	ctx->Ans.strPickupIn = m_pEntity->conf.audio_pickup_in_dev;
+	ctx->Ans.strPickupOut = m_pEntity->conf.audio_pickup_out_dev;
+	ctx->Ans.retCode = Error_Succeed;
+
+	ctx->Answer(Error_Succeed);
+}
+
 void CSIPPhoneSession::Handle_BeginState( SpSubscribeContext<PhoneService_BeginState_Sub, PhoneService_PhoneState_Info>::Pointer ctx )
 {
 	m_spCallbackContext = ctx;