Module: kamailio
Branch: master
Commit: 75de09f369abad7192c853e74c99741feadec619
URL:
https://github.com/kamailio/kamailio/commit/75de09f369abad7192c853e74c99741…
Author: herlesupreeth <herlesupreeth(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-28T11:07:40+01:00
ims_ipsec_pcscf: reset destination URI after value is used to decide destination protocol
to use
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/75de09f369abad7192c853e74c99741…
Patch:
https://github.com/kamailio/kamailio/commit/75de09f369abad7192c853e74c99741…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index de61ad7cf6b..47f9e401702 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -1016,13 +1016,6 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int _cflags)
// from URI
//int uri_len = 4 /* strlen("sip:") */ + ci.via_host.len + 5 /* max len of
port number */ ;
- if(!(_cflags & IPSEC_NODSTURI_RESET) && (m->dst_uri.s != NULL)) {
- LM_DBG("resetting dst uri [%.*s]\n", m->dst_uri.len, m->dst_uri.s);
- pkg_free(m->dst_uri.s);
- m->dst_uri.s = NULL;
- m->dst_uri.len = 0;
- }
-
if(_cflags & IPSEC_FORWARD_USEVIA) {
vb = cscf_get_last_via(m);
}
@@ -1119,6 +1112,13 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int _cflags)
}
}
+ if(!(_cflags & IPSEC_NODSTURI_RESET) && (m->dst_uri.s != NULL)) {
+ LM_DBG("resetting dst uri [%.*s]\n", m->dst_uri.len, m->dst_uri.s);
+ pkg_free(m->dst_uri.s);
+ m->dst_uri.s = NULL;
+ m->dst_uri.len = 0;
+ }
+
if(!(_cflags & IPSEC_NODSTURI_RESET)) {
char buf[1024];
int buf_len;