Browse Source

drouting: give portparameter set to 0 to sip_resolvehost()

- enable doing SRV query, GH #2553
Daniel-Constantin Mierla 4 năm trước cách đây
mục cha
commit
18f59c1058
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/modules/drouting/routing.c

+ 3 - 1
src/modules/drouting/routing.c

@@ -268,6 +268,7 @@ int add_dst(rt_data_t *r,
 #define GWABUF_MAX_SIZE 512
 	char gwabuf[GWABUF_MAX_SIZE];
 	str gwas;
+	unsigned short port;
 
 	if(NULL == r || NULL == ip) {
 		LM_ERR("invalid parametres\n");
@@ -331,7 +332,8 @@ int add_dst(rt_data_t *r,
 	}
 	/* note we discard the port discovered by the resolve function - we are
 	interested only in the port that was actually configured. */
-	if((he = sip_resolvehost(&uri.host, NULL, (char *)(void *)&uri.proto))
+	port = 0;
+	if((he = sip_resolvehost(&uri.host, &port, (char *)(void *)&uri.proto))
 			== 0) {
 		if(dr_force_dns) {
 			LM_ERR("cannot resolve <%.*s>\n", uri.host.len, uri.host.s);