Browse Source

#IQBX #comment mod_assistantchannel 编译通过

80374374 1 năm trước cách đây
mục cha
commit
33fb5c05df

+ 1 - 1
Module/CMakeLists.txt

@@ -172,7 +172,7 @@ add_subdirectory(mod_localmediaplay)
 #zhaohu
 add_subdirectory(mod_interactivecontrol)
 #zhaohu
-#add_subdirectory(mod_assistantchannel)
+add_subdirectory(mod_assistantchannel)
 add_subdirectory(mod_UpgradeMgr)
 add_subdirectory(mod_upload)
 add_subdirectory(mod_healthmanager)

+ 49 - 0
Module/mod_assistantchannel/AssistantChannel_client_g.h

@@ -281,6 +281,55 @@ public:
 		/// implement by user
 	}
 
+	ErrorCodeEnum GetIpByDomain(ChannelService_GetIpByDomain_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(ChannelService_Method_GetIpByDomain, ChannelService_MethodSignature_GetIpByDomain, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetIpByDomain(ChannelService_GetIpByDomain_Req &Req, ChannelService_GetIpByDomain_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetIpByDomain(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetIpByDomain(ChannelService_GetIpByDomain_Req &Req, ChannelService_GetIpByDomain_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetIpByDomain(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 GetIpByDomain(ChannelService_GetIpByDomain_Req &Req, ChannelService_GetIpByDomain_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetIpByDomain(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()
 	{

+ 30 - 0
Module/mod_assistantchannel/AssistantChannel_def_g.h

@@ -35,6 +35,7 @@ namespace AssistantChannel {
 #define ChannelService_Method_BeginRecv 7
 #define ChannelService_Method_EndRecv 8
 #define ChannelService_Method_Packet 9
+#define ChannelService_Method_GetIpByDomain 10
 
 #define ChannelService_MethodSignature_Connect 524358071
 #define ChannelService_MethodSignature_Close -811482585
@@ -46,6 +47,13 @@ namespace AssistantChannel {
 #define ChannelService_MethodSignature_BeginRecv -2054337141
 #define ChannelService_MethodSignature_EndRecv 1619609928
 #define ChannelService_MethodSignature_Packet -1048709116
+#define ChannelService_MethodSignature_GetIpByDomain 263102333
+
+#define ChannelService_LogCode_Connect "QLR040230C00"
+#define ChannelService_LogCode_Close "QLR040230C01"
+#define ChannelService_LogCode_GetState "QLR040230C02"
+#define ChannelService_LogCode_Send "QLR040230C06"
+#define ChannelService_LogCode_GetIpByDomain "QLR040230C10"
 
 struct ChannelService_Connect_Req
 {
@@ -189,6 +197,28 @@ struct ChannelService_Packet_Info
 
 };
 
+struct ChannelService_GetIpByDomain_Req
+{
+	CSimpleStringA strdomain;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & strdomain;
+	}
+
+};
+
+struct ChannelService_GetIpByDomain_Ans
+{
+	CSimpleStringA strip;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & strip;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 27 - 0
Module/mod_assistantchannel/AssistantChannel_server_g.h

@@ -86,6 +86,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ChannelService_Method_GetIpByDomain:
+			if (dwSignature == ChannelService_MethodSignature_GetIpByDomain) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -137,6 +144,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ChannelService_Method_GetIpByDomain:
+			if (dwSignature != ChannelService_MethodSignature_GetIpByDomain) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -184,6 +196,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetIpByDomain(SpReqAnsContext<ChannelService_GetIpByDomain_Req, ChannelService_GetIpByDomain_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -272,6 +289,16 @@ public:
 						Handle_EndRecv(ctx);
 					}
 					break;
+				case ChannelService_Method_GetIpByDomain:
+					{
+						SpReqAnsContext<ChannelService_GetIpByDomain_Req,ChannelService_GetIpByDomain_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ChannelService_GetIpByDomain_Req,ChannelService_GetIpByDomain_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetIpByDomain(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 8 - 0
Module/mod_assistantchannel/ChannelService.xml

@@ -55,5 +55,13 @@
 				<param name="data" type="blob"/>
 			</message>
 		</subscribe>
+		<twoway name="GetIpByDomain" overlap="true">
+			<req>
+				<param name="strdomain" type="string"/>
+			</req>
+			<res>
+				<param name="strip" type="string"/>
+			</res>
+		</twoway>
 	</class>
 </entity>

+ 7 - 3
Module/mod_assistantchannel/VideoDesc.h

@@ -1,5 +1,9 @@
 #pragma once
 
+#ifndef _MSC_VER
+#define _snprintf snprintf
+#endif //_MSC_VER
+
 static inline ErrorCodeEnum ParseVideoViewParam1(const char *param, 
 	int &local_view_x, int &local_view_y, int &local_view_cx, int &local_view_cy,
 	int &remote_view_x, int &remote_view_y, int &remote_view_cx, int &remote_view_cy)
@@ -51,7 +55,7 @@ static inline CSimpleStringA BuildVideoViewParam(int local_view_x, int local_vie
 static inline CSimpleStringA BuildVideoDesc(const char *remote_ip, int remote_video_rtp, int remote_video_width, int remote_video_height, int remote_video_fps, int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy)
 {
 	char param[512] = {0};
-	snprintf(param, 512, 
+	_snprintf(param, 512, 
 		"remote_ip:%s\r\n"
 		"remote_video_rtp:%d\r\n"
 		"remote_video_width:%d\r\n"
@@ -102,7 +106,7 @@ static inline ErrorCodeEnum ParseVideoDesc(const char *param, CSimpleStringA &re
 static inline CSimpleStringA BuildVideoRenderDesc(int local_view_x, int local_view_y, int local_view_cx, int local_view_cy)
 {
 	char param[512] = { 0 };
-	snprintf(param, 512,
+	_snprintf(param, 512,
 		"local_view_x:%d\r\n"
 		"local_view_y:%d\r\n"
 		"local_view_cx:%d\r\n"
@@ -118,7 +122,7 @@ static inline CSimpleStringA BuildVideoRenderDesc(int local_view_x, int local_vi
 static inline CSimpleStringA BuildDoubleVideoRenderDesc(int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy)
 {
 	char param[512] = { 0 };
-	snprintf(param, 512,
+	_snprintf(param, 512,
 		"local_view_x:%d\r\n"
 		"local_view_y:%d\r\n"
 		"local_view_cx:%d\r\n"

+ 14 - 0
Module/mod_assistantchannel/chan_protocol.h

@@ -53,9 +53,15 @@ typedef struct acm_hdr {
 	unsigned char encrypt : 1;
 	unsigned char error : 7;
 	unsigned short sub_type;
+#if defined(RVC_OS_WIN)
+	unsigned long length; // 需要注意的是长度最大为2^16-1,65535
+	unsigned long id; // 包id
+	unsigned long hash;
+#else
 	unsigned int length; // 需要注意的是长度最大为2^16-1,65535
 	unsigned int id; // 包id
 	unsigned int hash;
+#endif //RVC_OS_WIN
 	unsigned char data[0]; // 长度由length决定
 }acm_hdr;
 typedef struct proxy_hdr {
@@ -66,7 +72,11 @@ typedef struct proxy_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // 用户身份证号码,用与视频面签
+#if defined(RVC_OS_WIN)
+	unsigned long encrypt_keyhash; // 加密key hash code
+#else
 	unsigned int  encrypt_keyhash; // 加密key hash code
+#endif //RVC_OS_WIN
 	char encrypt_key[16]; // encodestring(密钥),传送过去之后利用decodestring解密
 }proxy_hdr;
 typedef struct proxy_ack_hdr {
@@ -75,7 +85,11 @@ typedef struct proxy_ack_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // peer request client_id
+#if defined(RVC_OS_WIN)
+	unsigned long encrypt_keyhash; // 加密key hash code
+#else
 	unsigned int encrypt_keyhash; // 加密key hash code
+#endif //RVC_OS_WIN
 	char encrypt_key[16]; // encodestring(密钥),传送过去之后利用decodestring解密
 }proxy_ack_hdr;
 

+ 48 - 12
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -1,6 +1,6 @@
 #include "stdafx.h"
 #include "mod_assistantchannel.h"
-#include "../include/EventCode.h"
+#include "EventCode.h"
 
 static const char *__states[] = {
 	"Idle", "Connecting", "Connected", "Closing"
@@ -31,7 +31,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 				ACM_VIDEO_MODE_SQUARE, ACM_VIDEO_ENCODE_H264, ACM_VIDEO_FPS_MOBILE, 
 				ACM_VIDEO_MODE_QVGA, ACM_VIDEO_ENCODE_H264, ACM_VIDEO_FPS_MOBILEAGENT);
 		} 
-		else if((ePadtype == eDevicetype)||(eDesk2SType == eDevicetype))
+		else if((ePadtype == eDevicetype)||(eDesk2SType == eDevicetype)||(eDesk1SType == eDevicetype)||(eDesk2SIntegratedType == eDevicetype))
 		{
 			return media_desc_encode(
 				ACM_VIDEO_MODE_SQUARE, ACM_VIDEO_ENCODE_H264, ACM_VIDEO_FPS_MOBILE, 
@@ -84,7 +84,11 @@ static void __on_destroy(bizchan_t *chan, void *user_data)
 static void __dbg(void *user_data, const char *fmt, va_list arg)
 {
 	//vDbg(fmt, arg);
+#if defined(RVC_OS_WIN)
+	int n = _vscprintf(fmt, arg);
+#else
 	int n = _scprintf(fmt, arg);
+#endif //RVC_OS_WIN
 	if (n >= MAX_PATH) {
 		char* buf = (char*)malloc((size_t)(n + 1));
 		vsnprintf(buf, n + 1, fmt, arg);
@@ -93,7 +97,11 @@ static void __dbg(void *user_data, const char *fmt, va_list arg)
 	}
 	else {
 		char strlog[MAX_PATH] = { 0 };
+#if defined(RVC_OS_WIN)
+		_vsnprintf(strlog, MAX_PATH, fmt, arg);
+#else
 		vsnprintf(strlog, MAX_PATH, fmt, arg);
+#endif //RVC_OS_WIN
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
@@ -163,6 +171,9 @@ DeviceTypeEnum CBizChannelEntity::RvcGetDeviceType()
 	else if (_stricmp(stStaticinfo.strMachineType,"RVC.Desk1S")==0){
 		eType = eDesk1SType;
 	}
+	else if (stricmp(stStaticinfo.strMachineType, "RVC.CardStore") == 0 || stricmp(stStaticinfo.strMachineType, "RVC.CardPrinter") == 0) {
+		eType = eCardStore;
+	}
 	else{
 		eType = eStand2sType;
 	}
@@ -185,8 +196,7 @@ ErrorCodeEnum CBizChannelEntity::__OnClose(ErrorCodeEnum preOperationError)
 	
 CServerSessionBase* CBizChannelEntity::OnNewSession(const char* pszRemoteEntityName, const char * pszClass)
 {
-	LOG_FUNCTION();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s connected class = %s!", pszRemoteEntityName, pszClass);
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s connected class = %s!", pszRemoteEntityName, pszClass);
 	return new ChannelServiceSession(this, m_id_seq++);
 }
 
@@ -214,14 +224,16 @@ ErrorCodeEnum CBizChannelEntity::Connect(const char *ip, int port, const char *c
 		cb.on_recv_pkt = &__on_recv_pkt;
 		cb.dbg = &__dbg;
 		int rc = bizchan_create(&config, &cb, &m_pChan);
-		if (rc == 0) 
-		{
+		if (rc == 0) {
 			rc = bizchan_start_connect(m_pChan);
 		}
-		if (rc != 0)
+
+		if (rc != 0) {
 			Error = Error_Unexpect;
-		else
+		}
+		else {
 			ChangeState(eChannelState_Connecting);
+		}
 	} 
 	else 
 	{
@@ -276,7 +288,6 @@ ErrorCodeEnum CBizChannelEntity::RegisterRxPkt(int id, SpSubscribeContext<Channe
 			return Error_AlreadyExist;
 		}
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("RegisterRxPkt id = %d",id);
 	pos = new rxpkt_entry();
 	pos->id = id;
 	pos->ctx = ctx;
@@ -328,6 +339,15 @@ ErrorCodeEnum CBizChannelEntity::Send(int type, bool compress, bool encrypt, int
 }
 
 
+void CBizChannelEntity::GetIpByDomain(char* poutput, size_t ulen, const char *pinput)
+{
+#if defined(RVC_OS_WIN)
+	bizchan_getip_bydomain(m_pChan, poutput, ulen, pinput);
+#endif //RVC_OS_WIN
+}
+
+
+
 void CBizChannelEntity::ChangeState(int new_state, const char *param)
 {
 	if (m_eState != new_state) {
@@ -347,7 +367,7 @@ void CBizChannelEntity::ChangeState(int new_state, const char *param)
 }
 
 
-
+//void on_recv_pkt(int type, int sub_type, const char *pkt, int pkt_size)
 void CBizChannelEntity::on_recv_pkt(int type, int sub_type, int id, CBlob &data)
 {
 	//LOG_TRACE("rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", data.m_iLength, type, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
@@ -414,7 +434,7 @@ void CBizChannelEntity::on_connect(int error, const char *remote_ip, int remote_
 						REC_COMMON_VIDEO_FPS_MOBILE_AGENT, local_view_x, local_view_y, local_view_cx, local_view_cy, 
 						remote_view_x, remote_view_y, remote_view_cx, remote_view_cy);
 				}
-				else if((ePadtype == m_eDeviceType)||(eDesk2SType == m_eDeviceType))
+				else if((ePadtype == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType) || (eDesk2SIntegratedType == m_eDeviceType))
 				{
 					param = BuildVideoDesc(remote_ip, remote_video_rtp, remote_video_width, remote_video_height, 
 						REC_COMMON_VIDEO_FPS_MOBILE, local_view_x, local_view_y, local_view_cx, local_view_cy, 
@@ -433,7 +453,7 @@ void CBizChannelEntity::on_connect(int error, const char *remote_ip, int remote_
 				bizchan_start_close(m_pChan);
 			}
 		}
-	}
+	} 
 	else {
 		if (m_pChan) {
 			bizchan_close(m_pChan);
@@ -499,6 +519,7 @@ void CBizChannelEntity::_on_close()
 
 void ChannelServiceSession::Handle_Connect( SpReqAnsContext<ChannelService_Connect_Req, ChannelService_Connect_Ans>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start connect, %s:%d [%s]", (LPCSTR)ctx->Req.ip, ctx->Req.port, (LPCSTR)ctx->Req.callno);
 	ErrorCodeEnum Error = m_pEntity->Connect(ctx->Req.ip, ctx->Req.port, ctx->Req.callno, (CallingTypeEnum)ctx->Req.etype);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connect Error = %d", Error);
@@ -507,6 +528,7 @@ void ChannelServiceSession::Handle_Connect( SpReqAnsContext<ChannelService_Conne
 
 void ChannelServiceSession::Handle_Close( SpReqAnsContext<ChannelService_Close_Req, ChannelService_Close_Ans>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connect close!");
 	ErrorCodeEnum Error = m_pEntity->Close();
 	ctx->Answer(Error);
@@ -514,6 +536,7 @@ void ChannelServiceSession::Handle_Close( SpReqAnsContext<ChannelService_Close_R
 
 void ChannelServiceSession::Handle_GetState( SpReqAnsContext<ChannelService_GetState_Req, ChannelService_GetState_Ans>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	ctx->Ans.status = state2str(m_pEntity->GetState());
 	ctx->Answer(Error_Succeed);
 }
@@ -525,24 +548,37 @@ void ChannelServiceSession::Handle_BeginState( SpSubscribeContext<ChannelService
 
 void ChannelServiceSession::Handle_EndState( SpOnewayCallContext<ChannelService_EndState_Info>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	m_pEntity->UnregisterState(m_id);
 }
 
 void ChannelServiceSession::Handle_Send( SpOnewayCallContext<ChannelService_Send_Info>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	m_pEntity->Send(ctx->Info.type, ctx->Info.compress, ctx->Info.encrypt, ctx->Info.sub_type, ctx->Info.id, ctx->Info.data);
 }
 
 void ChannelServiceSession::Handle_BeginRecv( SpSubscribeContext<ChannelService_BeginRecv_Sub, ChannelService_Packet_Info>::Pointer ctx )
 {
+
 	m_pEntity->RegisterRxPkt(m_id, ctx);
 }
 
 void ChannelServiceSession::Handle_EndRecv( SpOnewayCallContext<ChannelService_EndRecv_Info>::Pointer ctx )
 {
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	m_pEntity->UnregisterRxpkt(m_id);
 }
 
+void ChannelServiceSession::Handle_GetIpByDomain(SpReqAnsContext<ChannelService_GetIpByDomain_Req, ChannelService_GetIpByDomain_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+	char strip[MAX_PATH] = {0};
+	m_pEntity->GetIpByDomain(strip, MAX_PATH, ctx->Req.strdomain);
+	ctx->Ans.strip = strip;
+	ctx->Answer(Error_Succeed);
+}
+
 void ChannelServiceSession::OnClose( ErrorCodeEnum eErrorCode )
 {
 	m_pEntity->UnregisterRxpkt(m_id);

+ 15 - 12
Module/mod_assistantchannel/mod_assistantchannel.h

@@ -14,7 +14,7 @@
 #include "bizchan.h"
 #include "rvc_media_common.h"
 #include "chan_protocol.h"
-#include "../include/EventCode.h"
+#include "EventCode.h"
 
 #include "../mod_counterconnector/CallType.h"
 
@@ -37,15 +37,18 @@ public:
 	virtual void OnStarted();
 	DeviceTypeEnum RvcGetDeviceType();
 	ErrorCodeEnum __OnClose(ErrorCodeEnum preOperationError);
-	virtual CServerSessionBase* OnNewSession(const char* pszRemoteEntityName, const char* pszClass);
-	ErrorCodeEnum Connect(const char* ip, int port, const char* callno, CallingTypeEnum eType);
+	virtual CServerSessionBase *OnNewSession(const char* pszRemoteEntityName, const char * pszClass);
+	ErrorCodeEnum Connect(const char *ip, int port, const char *callno, CallingTypeEnum eType);
 	ErrorCodeEnum Close();
 	int GetState() { return m_eState; }
 	ErrorCodeEnum RegisterState(int id, SpSubscribeContext<ChannelService_BeginState_Sub, ChannelService_State_Info>::Pointer ctx);
 	ErrorCodeEnum RegisterRxPkt(int id, SpSubscribeContext<ChannelService_BeginRecv_Sub, ChannelService_Packet_Info>::Pointer ctx);
 	void UnregisterState(int id);
 	void UnregisterRxpkt(int id);
-	ErrorCodeEnum Send(int type, bool compress, bool encrypt, int sub_type, int id, CBlob& data);
+	ErrorCodeEnum Send(int type, bool compress, bool encrypt, int sub_type, int id, CBlob &data);
+	void GetIpByDomain(char* poutput, size_t ulen, const char *pinput);
+
+	//void on_recv_pkt(int type, int sub_type, const char *pkt, int pkt_size)
 	void on_recv_pkt(int type, int sub_type, int id, CBlob &data);
 	void on_connect(int error, const char *remote_ip, int remote_video_rtp, int remote_video_desc);
 	void on_close();
@@ -54,20 +57,17 @@ public:
 	void _on_close();
 
 private:
-	void ChangeState(int new_state, const char* param = NULL);
-
 	struct NotifyOnClose : public ITaskSp
 	{
-		CBizChannelEntity* m_pEntity;
+		CBizChannelEntity *m_pEntity;
 		virtual void Process()
 		{
 			m_pEntity->on_close();
 		}
 	};
-
 	struct NotifyOnRecvPkt : public ITaskSp
 	{
-		CBizChannelEntity* m_pEntity;
+		CBizChannelEntity *m_pEntity;
 		int type;
 		int sub_type;
 		int id;
@@ -80,7 +80,7 @@ private:
 
 	struct NotifyOnConnect : public ITaskSp
 	{
-		CBizChannelEntity* m_pEntity;
+		CBizChannelEntity *m_pEntity;
 		int error;
 		CSimpleStringA remote_rtp_ip;
 		int remote_video_port;
@@ -91,6 +91,8 @@ private:
 		}
 	};
 
+	void ChangeState(int new_state, const char *param = NULL);
+
 private:
 	DeviceTypeEnum m_eDeviceType;
 	int m_eState;
@@ -136,11 +138,12 @@ public:
 
 	virtual void OnClose(ErrorCodeEnum eErrorCode);
 
+	virtual void Handle_GetIpByDomain(SpReqAnsContext<ChannelService_GetIpByDomain_Req, ChannelService_GetIpByDomain_Ans>::Pointer ctx);
+
 private:
 	int m_id;
-	CBizChannelEntity* m_pEntity;
+	CBizChannelEntity *m_pEntity;
 };
 
 
-
 #endif /*RVC_MOD_ASSISTANTCHANNEL_H__*/