Module: kamailio
Branch: master
Commit: 4ce48efbb7022dbb060173816577aed404689bb9
URL:
https://github.com/kamailio/kamailio/commit/4ce48efbb7022dbb060173816577aed…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-30T15:24:38+02:00
ims_ipsec_pcscf: simplified parsing target uri for contact filling
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4ce48efbb7022dbb060173816577aed…
Patch:
https://github.com/kamailio/kamailio/commit/4ce48efbb7022dbb060173816577aed…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index cb2ad45ce2..18f5e3727a 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -169,26 +169,24 @@ static int fill_contact(
if(m->first_line.type == SIP_REQUEST) {
char *alias_start;
struct sip_uri uri;
+ str suri;
memset(&uri, 0, sizeof(struct sip_uri));
if((sflags & IPSEC_DSTADDR_SEARCH) && m->dst_uri.s!=NULL
&& m->dst_uri.len>0) {
+ suri = m->dst_uri;
LM_DBG("using dst uri for contact filling: %.*s\n",
- m->dst_uri.len, m->dst_uri.s);
- if(parse_uri(m->dst_uri.s, m->dst_uri.len, &uri)<0) {
- LM_ERR("failed to parse the request dst URI\n");
- return -1;
- }
+ suri.len, suri.s);
} else {
+ suri = m->first_line.u.request.uri;
LM_DBG("using original uri for contact filling: %.*s\n",
- m->first_line.u.request.uri.len,
- m->first_line.u.request.uri.s);
- if(parse_uri(m->first_line.u.request.uri.s,
- m->first_line.u.request.uri.len, &uri)<0) {
- LM_ERR("failed to parse the request URI from first line\n");
- return -1;
- }
+ suri.len, suri.s);
+ }
+ if(parse_uri(suri.s, suri.len, &uri)<0) {
+ LM_ERR("failed to parse the URI: %.*s / flags: 0x%x\n",
+ suri.len, suri.s, sflags);
+ return -1;
}
req = m;