Module: kamailio
Branch: master
Commit: 18f59c10582845da5eea280990daf19c804978fb
URL:
https://github.com/kamailio/kamailio/commit/18f59c10582845da5eea280990daf19…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-11-17T12:55:17+01:00
drouting: give portparameter set to 0 to sip_resolvehost()
- enable doing SRV query, GH #2553
---
Modified: src/modules/drouting/routing.c
---
Diff:
https://github.com/kamailio/kamailio/commit/18f59c10582845da5eea280990daf19…
Patch:
https://github.com/kamailio/kamailio/commit/18f59c10582845da5eea280990daf19…
---
diff --git a/src/modules/drouting/routing.c b/src/modules/drouting/routing.c
index a1d32fa0ba..da4385911f 100644
--- a/src/modules/drouting/routing.c
+++ b/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);