Explorar o código

Z991239-5511 #comment 清除无效代码

80274480 hai 1 ano
pai
achega
f1b86201e5

+ 0 - 12
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -299,15 +299,6 @@ 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) {
@@ -519,9 +510,6 @@ void ChannelServiceSession::Handle_EndRecv( SpOnewayCallContext<ChannelService_E
 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);
 }
 

+ 0 - 1
Module/mod_assistantchannel/mod_assistantchannel.h

@@ -46,7 +46,6 @@ public:
 	void UnregisterState(int id);
 	void UnregisterRxpkt(int id);
 	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);

+ 0 - 71
Module/mod_sipphone/win/endpoint.cpp

@@ -608,21 +608,6 @@ static int get_media_direction(const sdp_media_t *lm, const sdp_media_t *rm)
 }
 
 
-static int endpoint_get_ipaddress_by_domain(endpoint_call_t *call, const char* plocalip, char* premoteip, size_t ulen, const char* pdomain)
-{
-	if (0 != endpoint_getip_bydomain(premoteip, ulen, pdomain)){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get ip by domain failed!");
-	}
-	if (0 == strlen(premoteip) || 0 == strcmp(plocalip, premoteip)){
-		char strmsg[MAX_PATH] = {0};
-		_snprintf(strmsg, MAX_PATH, "get server ip by domain(%s -> %s) failed!", pdomain, premoteip);
-		LogWarn(Severity_Low, Error_Debug, ERROR_MOD_SIP_GET_IP_BY_DOMAIN_FAILED, strmsg);
-		call->func_cb.on_function(premoteip, ulen, pdomain, call->func_cb.user_data);
-	}
-
-	return 0;
-}
-
 static int negotiate_audio(endpoint_call_t *call, media_desc_t *audio_desc, const sdp_media_t *lm, const sdp_media_t *rm)
 {
 	memset(audio_desc, 0, sizeof(media_desc_t));
@@ -633,11 +618,6 @@ static int negotiate_audio(endpoint_call_t *call, media_desc_t *audio_desc, cons
 	local_ip = lm->m_connections ? lm->m_connections->c_address : lm->m_session->sdp_connection->c_address;
 	remote_ip = rm->m_connections ? rm->m_connections->c_address : rm->m_session->sdp_connection->c_address;
 
-	if (endpoint_addr_is_domain(remote_ip)){
-		endpoint_get_ipaddress_by_domain(call, local_ip, str_domain_ip, MAX_PATH, remote_ip);
-		remote_ip = str_domain_ip;
-	}
-
 	//audio_desc->local_ip = local_ip ? inet_addr(local_ip) : 0;
 	//audio_desc->local_port = lm->m_port;
 	audio_desc->local_ip = strlen(call->local_ip) ? inet_addr(call->local_ip) : 0;
@@ -675,11 +655,6 @@ static int negotiate_video(endpoint_call_t *call, media_desc_t *video_desc, cons
 	local_ip = lm->m_connections ? lm->m_connections->c_address : lm->m_session->sdp_connection->c_address;
 	remote_ip = rm->m_connections ? rm->m_connections->c_address : rm->m_session->sdp_connection->c_address;
 
-	if (endpoint_addr_is_domain(remote_ip)){
-		endpoint_get_ipaddress_by_domain(call, local_ip, str_domain_ip, MAX_PATH, remote_ip);
-		remote_ip = str_domain_ip;
-	}
-
 	//video_desc->local_ip = local_ip ? inet_addr(local_ip) : 0;
 	//video_desc->local_port = lm->m_port;
 	video_desc->local_ip = strlen(call->local_ip) ? inet_addr(call->local_ip) : 0;
@@ -1589,50 +1564,4 @@ int translate_ipaddr_from_int(char* strdst, size_t ulen, unsigned long uip)
 }
 
 
-int endpoint_getip_bydomain(char* strbuffer, size_t ulen, const char* pdomain)
-{
-	int iret = -1;
-	int i = 0;
-	struct hostent *phst = NULL;
-	if (NULL == strbuffer || NULL == pdomain){
-		return iret;
-	}
-
-	phst = gethostbyname(pdomain);
-	if (!phst){
-		return iret;
-	}
-
-	for (; phst->h_aliases[i]; i++){
-	}
-
-	for (i = 0; phst->h_addr_list[i]; i++){
-		char* strip = inet_ntoa(*(struct in_addr*)phst->h_addr_list[i]);
-		if (0 == i){
-			if (NULL != strip){
-				_snprintf(strbuffer, ulen, "%s", strip);
-				iret = 0;
-			}
-		}
-	}
-
-	return iret;
-}
-
-
-bool endpoint_addr_is_domain(const char* pserver_addr)
-{
-	bool bret = false;
-	if (NULL == pserver_addr){
-		return bret;
-	}
-
-	if (strstr(pserver_addr, ".com") ||strstr(pserver_addr, ".cn")){
-		bret = true;
-	}
-
-	return bret;
-}
-
-
 IMPLEMENT_REF_COUNT_MT_STATIC(endpoint_call, endpoint_call_t, ref_cnt, __endpoint_call_destroy)

+ 0 - 32
Module/mod_sipphone/win/mod_sipphone.cpp

@@ -132,38 +132,6 @@ static int __get_ip_by_domain(char* poutput, size_t ulen, const char *pinput, vo
 
 
 
-static int getip_bydomain(char* strbuffer, size_t ulen, const char* pdomain)
-{
-	int iret = -1;
-	int i = 0;
-	struct hostent *phst = NULL;
-	if (NULL == strbuffer || NULL == pdomain){
-		return iret;
-	}
-
-	phst = gethostbyname(pdomain);
-	if (!phst){
-		return iret;
-	}
-
-	for (; phst->h_aliases[i]; i++){
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("aliases %d:%s.", i+1, phst->h_aliases[i]);
-	}
-
-	for (i = 0; phst->h_addr_list[i]; i++){
-		char* strip = inet_ntoa(*(struct in_addr*)phst->h_addr_list[i]);
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("IP addr %d:%s.", i+1, strip);
-		if (0 == i){
-			if (NULL != strip){
-				_snprintf(strbuffer, ulen, "%s", strip);
-				iret = 0;
-			}
-		}
-	}
-
-	return iret;
-}
-
 
 static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
 {

+ 2 - 52
Other/win/libbizchan/bizchan.c

@@ -170,39 +170,6 @@ BIZCHAN_API(int) bizchan_lib_term()
 	return WSACleanup();
 }
 
-BIZCHAN_API(int) bizchan_getip_bydomain(bizchan_t *chan, char* strbuffer, size_t ulen, const char* pdomain)
-{
-	int iret = -1;
-	int i = 0;
-	struct hostent *phst = NULL;
-	if (NULL == strbuffer || NULL == pdomain){
-		return iret;
-	}
-
-	phst = gethostbyname(pdomain);
-	if (!phst){
-		return iret;
-	}
-
-	bizlog(chan, "address type is %s.", (phst->h_addrtype == AF_INET) ? "AF_INET" : "AF_INET6");
-
-	for (; phst->h_aliases[i]; i++){
-		bizlog(chan, "aliases %d:%s.", i+1, phst->h_aliases[i]);
-	}
-
-	for (i = 0; phst->h_addr_list[i]; i++){
-		char* strip = inet_ntoa(*(struct in_addr*)phst->h_addr_list[i]);
-		bizlog(chan, "IP addr %d:%s.", i+1, strip);
-		if (0 == i){
-			if (NULL != strip){
-				_snprintf(strbuffer, ulen, "%s", strip);
-				iret = 0;
-			}
-		}
-	}
-
-	return iret;
-}
 
 static int config_copy(const bizchan_config_t *src, bizchan_config_t *dst)
 {
@@ -634,25 +601,8 @@ static unsigned long biz_get_inetaddr(bizchan_t *chan, BOOL bprimary, const char
 		return uret;
 	}
 
-	if (addr_is_domain(pserver)){
-		char strbuffer[MAX_PATH] = {0};
-		if (0 == bizchan_getip_bydomain(chan, strbuffer, MAX_PATH, pserver)){
-			if (bprimary){
-				free(chan->config.proxy_server);
-				chan->config.proxy_server = _strdup(strbuffer);
-			}
-			else{
-				free(chan->config.bak_proxy_server);
-				chan->config.bak_proxy_server = _strdup(strbuffer);
-			}
-			uret = inet_addr(strbuffer);
-		}
-		
-	}
-	else{
-		uret = inet_addr(pserver);
-	}
-
+	uret = inet_addr(pserver);
+	
 	return uret;
 }
 

+ 0 - 1
Other/win/libbizchan/bizchan.h

@@ -51,7 +51,6 @@ BIZCHAN_API(int) bizchan_lib_init();
 BIZCHAN_API(int) bizchan_lib_term();
 
 BIZCHAN_API(int) bizchan_create(const bizchan_config_t *config, const bizchan_callback_t *cb, bizchan_t **p_chan);
-BIZCHAN_API(int) bizchan_getip_bydomain(bizchan_t *chan, char* strbuffer, size_t ulen, const char* pdomain);
 BIZCHAN_API(void) bizchan_destroy(bizchan_t *chan);
 BIZCHAN_API(void) bizchan_set_tag(bizchan_t *chan, void *tag);
 BIZCHAN_API(void*) bizchan_get_tag(bizchan_t *chan);