Module: kamailio
Branch: master
Commit: 13dbfe9da2df3bd0ae21a3f1cbee90f2f47e470b
URL:
https://github.com/kamailio/kamailio/commit/13dbfe9da2df3bd0ae21a3f1cbee90f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-31T08:33:03+02:00
ims_ipsec_pcscf: added option to search ipsec tunel by new r-uri
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/13dbfe9da2df3bd0ae21a3f1cbee90f…
Patch:
https://github.com/kamailio/kamailio/commit/13dbfe9da2df3bd0ae21a3f1cbee90f…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index 18f5e3727a..336395d4ca 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -82,6 +82,8 @@ extern struct tm_binds tmb;
#define IPSEC_REVERSE_SEARCH 0x02
/* if set - use destination address for IPSec tunnel search */
#define IPSEC_DSTADDR_SEARCH 0x04
+/* if set - use new r-uri address for IPSec tunnel search */
+#define IPSEC_RURIADDR_SEARCH 0x08
/* if set - delete unused tunnels before every registration */
#define IPSEC_CREATE_DELETE_UNUSED_TUNNELS 0x01
@@ -178,6 +180,11 @@ static int fill_contact(
suri = m->dst_uri;
LM_DBG("using dst uri for contact filling: %.*s\n",
suri.len, suri.s);
+ } else if((sflags & IPSEC_RURIADDR_SEARCH) && m->new_uri.s!=NULL
+ && m->new_uri.len>0) {
+ suri = m->new_uri;
+ LM_DBG("using new r-uri for contact filling: %.*s\n",
+ suri.len, suri.s);
} else {
suri = m->first_line.u.request.uri;
LM_DBG("using original uri for contact filling: %.*s\n",