Module: kamailio Branch: 5.4 Commit: d9a1a5cf667e7d093cc077fc51297825565c79d1 URL: https://github.com/kamailio/kamailio/commit/d9a1a5cf667e7d093cc077fc51297825...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-11-19T13:28:35+01:00
drouting: give portparameter set to 0 to sip_resolvehost()
- enable doing SRV query, GH #2553
(cherry picked from commit 18f59c10582845da5eea280990daf19c804978fb)
---
Modified: src/modules/drouting/routing.c
---
Diff: https://github.com/kamailio/kamailio/commit/d9a1a5cf667e7d093cc077fc51297825... Patch: https://github.com/kamailio/kamailio/commit/d9a1a5cf667e7d093cc077fc51297825...
---
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);