[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-12-29 Thread Daniel-Constantin Mierla via sr-dev
Closed #3570 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#event-11355454965
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-12-29 Thread Daniel-Constantin Mierla via sr-dev
This feature is in master via #3645 and subsequent commits.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1871821373
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-12-28 Thread github-actions[bot] via sr-dev
This issue is stale because it has been open 6 weeks with no activity. Remove 
stale label or comment or this will be closed in 2 weeks.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1871685578
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-11-16 Thread jbipre2 via sr-dev
My total ignorance is the cause… but I learn, I learn: have now forked 
jbipre2/kamailio.git, set this as upstream for a local clone, and will continue 
to read the manual
From: Henning Westerholt ***@***.***>
Sent: Thursday, November 16, 2023 2:29 PM
To: kamailio/kamailio ***@***.***>
Cc: BISHOP James (JRC-ISPRA) ***@***.***>; Mention ***@***.***>
Subject: Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to 
ipsec_destroy() (Issue #3570)


@jbipre2
 not sure why this happens, just to verify - you forked the kamailio repository 
and then based the PR on that modification in your tree?

—
Reply to this email directly, view it on 
GitHub,
 or 
unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1814518345
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-11-16 Thread Henning Westerholt via sr-dev
@jbipre2 not sure why this happens, just to verify - you forked the kamailio 
repository and then based the PR on that modification in your tree?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1814439014
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-11-15 Thread jbipre2 via sr-dev
Would like to, but don’t know how to; first attempt failed with: Pull request 
creation failed. Validation failed: must be a collaborator
From: Henning Westerholt ***@***.***>
Sent: Wednesday, November 15, 2023 9:11 AM
To: kamailio/kamailio ***@***.***>
Cc: BISHOP James (JRC-ISPRA) ***@***.***>; Mention ***@***.***>
Subject: Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to 
ipsec_destroy() (Issue #3570)


@jbipre2
 Could you maybe create a pull request with your patch suggestion? Then it 
could be reviewed from the developers and possible also integrated in the code 
base.

—
Reply to this email directly, view it on 
GitHub,
 or 
unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1812652624
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-11-15 Thread Henning Westerholt via sr-dev
@jbipre2 Could you maybe create a pull request with your patch suggestion? Then 
it could be reviewed from the developers and possible also integrated in the 
code base.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1811984001
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-11-14 Thread github-actions[bot] via sr-dev
This issue is stale because it has been open 6 weeks with no activity. Remove 
stale label or comment or this will be closed in 2 weeks.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1811719467
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-10-03 Thread jbipre2 via sr-dev
Thankyou Daniel,
Yesterday I posted a comment to the Kamailio Github Issues including a patch 
which adds an optional parameter to the ipsec_destroy function.
Although it’s a quick hack, the patch solves my problem, and I believe it has 
no impact on existing behaviour.
All the best
James Bishop
European Commission
Directorate-General Joint Research Centre
E.2 Unit

Via E. Fermi 2749, TP 723
I-21027 Ispra (VA), Italy
+39 0332 786225
***@***.**@***.***>

From: Daniel-Constantin Mierla ***@***.***>
Sent: Wednesday, September 20, 2023 11:44 AM
To: kamailio/kamailio ***@***.***>
Cc: BISHOP James (JRC-ISPRA) ***@***.***>; Author ***@***.***>
Subject: Re: [kamailio/kamailio] ims_ipsec_pcscf: dummy AOR ***@***.*** 
prevents ipsec_destroy() from finding contact (Issue #3570)


The event route are executed with a fake message, because there could be 
situations when there is not SIP message received from the wire. The solution 
here is to enhance the function to get the value of the AoR as a parameter.

I am tagging this accordingly, maybe someone is going to code it (you are of 
course welcome to do it, as well), if not, it is going to be closed after a 
while.

—
Reply to this email directly, view it on 
GitHub,
 or 
unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3570#issuecomment-1744392656
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] ims_ipsec_pcscf: add AoR parameter to ipsec_destroy() (Issue #3570)

2023-10-02 Thread jbipre2 via sr-dev
Taking a cue from code in ims_registrar_pcscf / w_unregister, this patch 
replaces the dummy AOR in the SIP message passed to fill_contact:
```
diff -urw a/src/modules/ims_ipsec_pcscf/cmd.c 
b/src/modules/ims_ipsec_pcscf/cmd.c
--- a/src/modules/ims_ipsec_pcscf/cmd.c 2023-06-28 09:40:45.0 +0200
+++ b/src/modules/ims_ipsec_pcscf/cmd.c 2023-09-29 15:26:52.200511805 +0200
@@ -1039,7 +1039,7 @@
 }


-int ipsec_destroy(struct sip_msg *m, udomain_t *d)
+int ipsec_destroy(struct sip_msg *m, udomain_t *d, str *uri)
 {
struct pcontact_info ci;
pcontact_t *pcontact = NULL;
@@ -1050,6 +1050,12 @@
t = tmb.t_gett();
}

+// Insert URI in SIP message
+if(uri != NULL) {
+m->first_line.u.request.uri.s = uri->s;
+m->first_line.u.request.uri.len = uri->len;
+}
+
// Find the contact
if(fill_contact(, m, t, 0) != 0) {
LM_ERR("Error filling in contact data\n");
diff -urw a/src/modules/ims_ipsec_pcscf/cmd.h 
b/src/modules/ims_ipsec_pcscf/cmd.h
--- a/src/modules/ims_ipsec_pcscf/cmd.h 2023-06-28 09:40:45.0 +0200
+++ b/src/modules/ims_ipsec_pcscf/cmd.h 2023-09-29 15:24:42.422362274 +0200
@@ -65,7 +65,7 @@

 int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags);
 int ipsec_forward(struct sip_msg *m, udomain_t *d, int _cflags);
-int ipsec_destroy(struct sip_msg *m, udomain_t *d);
+int ipsec_destroy(struct sip_msg *m, udomain_t *d, str *uri);
 int ipsec_cleanall();
 int ipsec_reconfig();
 void ipsec_on_expire(pcontact_t *c, int type, void *param);
diff -urw a/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c 
b/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
--- a/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c 2023-06-28 
09:40:45.0 +0200
+++ b/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c 2023-10-02 
12:51:04.135697115 +0200
@@ -56,12 +56,13 @@
 static void mod_destroy(void);
 static int w_create(struct sip_msg *_m, char *_d, char *_cflags);
 static int w_forward(struct sip_msg *_m, char *_d, char *_cflags);
-static int w_destroy(struct sip_msg *_m, char *_d, char *_cflags);
+static int w_destroy(struct sip_msg *_m, char *_d, char *_aor);

 /*! \brief Fixup functions */
 static int domain_fixup(void **param, int param_no);
 static int save_fixup2(void **param, int param_no);
 static int free_uint_fixup(void **param, int param_no);
+static int unregister_fixup(void **param, int param_no);

 extern int bind_ipsec_pcscf(usrloc_api_t *api);

@@ -83,6 +84,8 @@
free_uint_fixup, REQUEST_ROUTE | ONREPLY_ROUTE },
{"ipsec_destroy", (cmd_function)w_destroy, 1, save_fixup2,
0, REQUEST_ROUTE | ONREPLY_ROUTE },
+   {"ipsec_destroy", (cmd_function)w_destroy, 2, unregister_fixup,
+   0, ANY_ROUTE },
{"bind_ims_ipsec_pcscf", (cmd_function)bind_ipsec_pcscf, 1, 0,
0, 0},
{0, 0, 0, 0, 0, 0}
@@ -448,6 +451,36 @@
return 0;
 }

+/*! \brief
+ * Fixup for "unregister" operation - both domain and aor
+ */
+static int unregister_fixup(void **param, int param_no)
+{
+   if(param_no == 1) {
+   return domain_fixup(param, param_no);
+   } else {
+   pv_elem_t *model=NULL;
+   str s;
+
+   /* convert to str */
+   s.s = (char*)*param;
+   s.len = strlen(s.s);
+
+   model = NULL;
+   if(s.len==0) {
+   LM_ERR("no param!\n");
+   return E_CFG;
+   }
+   if(pv_parse_format(, )<0 || model==NULL) {
+   LM_ERR("wrong format [%s]!\n", s.s);
+   return E_CFG;
+   }
+   *param = (void*)model;
+   return 0;
+   }
+   return E_CFG;
+}
+

 /*! \brief
  * Wrapper to ipsec functions
@@ -468,7 +501,20 @@
return ipsec_forward(_m, (udomain_t *)_d, 0);
 }

-static int w_destroy(struct sip_msg *_m, char *_d, char *_cflags)
+static int w_destroy(struct sip_msg *_m, char *_d, char *_aor)
 {
-   return ipsec_destroy(_m, (udomain_t *)_d);
+pv_elem_t *model;
+str aor;
+
+   if(_aor) {
+model = (pv_elem_t*)_aor;
+if (pv_printf_s(_m, model, ) < 0) {
+LM_ERR("error - cannot print the format\n");
+return -1;
+}
+LM_DBG("URI: %.*s\n", aor.len, aor.s);
+
+   return ipsec_destroy(_m, (udomain_t *)_d, );
+   }
+   return ipsec_destroy(_m, (udomain_t *)_d, NULL);
 }
```
This patch allows ipsec_destroy to be called from the PCSCF cfg file with the 
optional argument: $uac_req(ruri):
```
event_route[uac:reply] {
#!ifdef WITH_DEBUG
xnotice("request sent to $uac_req(ruri) completed with code: 
$uac_req(evcode), Type $uac_req(evtype)\n");
#!endif
if (($uac_req(evtype) != 1) || ($uac_req(evcode) != 200)) {
if