[sr-dev] git:master:b59812ff: modules: readme files regenerated - secsipid ... [skip ci]

2024-03-20 Thread Kamailio Dev via sr-dev
Module: kamailio
Branch: master
Commit: b59812ff025a4c7e531ce9ad29d435820908fa8a
URL: 
https://github.com/kamailio/kamailio/commit/b59812ff025a4c7e531ce9ad29d435820908fa8a

Author: Kamailio Dev 
Committer: Kamailio Dev 
Date: 2024-03-21T07:31:23+01:00

modules: readme files regenerated - secsipid ... [skip ci]

---

Modified: src/modules/secsipid/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/b59812ff025a4c7e531ce9ad29d435820908fa8a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b59812ff025a4c7e531ce9ad29d435820908fa8a.patch

---

diff --git a/src/modules/secsipid/README b/src/modules/secsipid/README
index 0433f481cf3..9297251072a 100644
--- a/src/modules/secsipid/README
+++ b/src/modules/secsipid/README
@@ -346,8 +346,8 @@ request_route {
 ...
 request_route {
 ...
-http_client_query("https://provider.com/stir-shaken/cert.pem";, 
"$var(pubkey)
-");
+secsipid_get_url("https://provider.com/stir-shaken/cert.pem";, 
"$var(pubkey)"
+);
 if(secsipid_verify("$hdr(Identity)", "$var(pubkey)", "A")) { ... }
 ...
 }
@@ -359,7 +359,8 @@ request_route {
 
 4.5.  secsipid_get_url(url, ovar)
 
-   Get the content of a URL and store the result in a variable.
+   Get the content of a URL and store the result in a variable. The result
+   is cached by libsecsipid, if caching is enabled.
 
The url parameters can contain pseudo-variables and ovar has to be the
name of a writable pseudo-variable.

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


[sr-dev] git:master:01ec19f7: secsipid: note that get url function is doing caching

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 01ec19f73a7257a83bd9abb9a02c12e2c3d225e0
URL: 
https://github.com/kamailio/kamailio/commit/01ec19f73a7257a83bd9abb9a02c12e2c3d225e0

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-21T07:21:27+01:00

secsipid: note that get url function is doing caching

- use get url function in example for verify

---

Modified: src/modules/secsipid/doc/secsipid_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/01ec19f73a7257a83bd9abb9a02c12e2c3d225e0.diff
Patch: 
https://github.com/kamailio/kamailio/commit/01ec19f73a7257a83bd9abb9a02c12e2c3d225e0.patch

---

diff --git a/src/modules/secsipid/doc/secsipid_admin.xml 
b/src/modules/secsipid/doc/secsipid_admin.xml
index c43ccf3c637..f8f2e823a21 100644
--- a/src/modules/secsipid/doc/secsipid_admin.xml
+++ b/src/modules/secsipid/doc/secsipid_admin.xml
@@ -338,7 +338,7 @@ request_route {
 ...
 request_route {
 ...
-http_client_query("https://provider.com/stir-shaken/cert.pem";, 
"$var(pubkey)");
+secsipid_get_url("https://provider.com/stir-shaken/cert.pem";, 
"$var(pubkey)");
 if(secsipid_verify("$hdr(Identity)", "$var(pubkey)", "A")) { ... }
 ...
 }
@@ -356,7 +356,8 @@ request_route {
secsipid_get_url(url, ovar)


-   Get the content of a URL and store the result in a 
variable.
+   Get the content of a URL and store the result in a variable. 
The result
+   is cached by libsecsipid, if caching is enabled.


The url parameters can contain pseudo-variables and ovar has to 
be

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


[sr-dev] Re: [kamailio/kamailio] TLS crash in Kamailio 5.6.3 (5.7.4) on Debian 12 (Issue #3791)

2024-03-20 Thread Richard Chan via sr-dev
In 5.8 you need to set in global config

tls_threads_mode = 1 #or 2

On Thu, 21 Mar 2024, 03:59 Henning Westerholt via sr-dev, <
sr-dev@lists.kamailio.org> wrote:

> Thanks for the report. This is could be a known issue with OpenSSL 3.0
> e.g. on bookworm. Please try with Kamailio 5.8.0, or even better, the soon
> to be released 5.8.1. If it still crashes, its probably something that
> still needs to be fixed in the tls module.
>
> —
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> 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
>
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] xhttp: fix execution of async functions (PR #3723)

2024-03-20 Thread github-actions[bot] via sr-dev
Closed #3723.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3723#event-12193921070
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] [FEATURE] mid-call self-redirect call to new nexthop (Issue #3773)

2024-03-20 Thread Jakihiko via sr-dev
@miconda any comment on this proposal?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3773#issuecomment-2010580418
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] TLS crash in Kamailio 5.6.3 (5.7.4) on Debian 12 (Issue #3791)

2024-03-20 Thread Henning Westerholt via sr-dev
Thanks for the report. This is could be a known issue with OpenSSL 3.0 e.g. on 
bookworm. Please try with Kamailio 5.8.0, or even better, the soon to be 
released 5.8.1. If it still crashes, its probably something that still needs to 
be fixed in the tls module.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3791#issuecomment-2010488832
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] [kamailio/kamailio] TLS crash in Kamailio 5.6.3 (5.7.4) on Debian 12 (Issue #3791)

2024-03-20 Thread Evgeniy G via sr-dev
**Description**

I have installed kamailio 5.6.3(from debian repo) on Debian 12. Try testing 
with openvas and some case, I saw kamailio crashes.

> Mar 19 12:55:45 hostname kamailio[1789359]: CRITICAL:  
> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer 
> (0x7f0429907ea0), called from tls: tls_init.c: ser_free(323), first free tls: 
> tls_init.c: ser_free(323) - ignoring
> Mar 19 12:55:45 hostname kamailio[1789361]: CRITICAL:  
> [core/mem/q_malloc.c:123]: qm_debug_check_frag(): BUG: qm: fragm. 
> 0x7f0429907ee8 (address 0x7f0429907f20) beginning overwritten (80)! Memory 
> allocator was called from tls: tls_init.c:323. Fragment marked by tls: 
> tls_init.c:293. Exec from core/mem/q_malloc.c:511.
> Mar 19 12:55:45 hostname kamailio[1789367]: CRITICAL:  
> [core/pass_fd.c:277]: receive_fd(): EOF on 620
> Mar 19 12:55:45 hostname kamailio[1788962]: ALERT:  [main.c:774]: 
> handle_sigs(): child process 1789361 exited by a signal 6.

Next step, I added option --atexit=no to args - result same.

Next step, I tried to build kamailio 5.7.4 from source and re-run testing, the 
result was the same - kamailio was crash.

After that, I tried use `tlsa` module instead of `tlsa`, but it not resolve 
problem.

Backtrace:
[kamailio_5.6.3_backtrace_full.txt](https://github.com/kamailio/kamailio/files/14669895/kamailio_5.6.3_backtrace_full.txt)
[kamailio_5.6.3_backtrace.txt](https://github.com/kamailio/kamailio/files/14669896/kamailio_5.6.3_backtrace.txt)

**Additional Information**

> openssl version
OpenSSL 3.0.11 19 Sep 2023 (Library: OpenSSL 3.0.11 19 Sep 2023)

**Kamailio**:
> kamailio -v
version: kamailio 5.6.3 (x86_64/linux) 
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled with gcc 12.2.0

> kamailio -v
version: kamailio 5.7.4 (x86_64/linux) c717c0
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, 
MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, 
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: c717c0 
compiled on 13:23:19 Mar 20 2024 with gcc 12.2.0

**OS**:
> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux 12 (bookworm)
Release:12
Codename:   bookworm

> uname -a
Linux hostname 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 
(2024-02-01) x86_64 GNU/Linux

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3791
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] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
This function is with key value as parameter, not file path. There is also a 
function in the secsipid module to download:

  - 
https://www.kamailio.org/docs/modules/devel/modules/secsipid.html#secsipid.f.secsipid_get_url

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009991445
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] git:master:d3900987: pvtpl: docs - section for template file

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: d3900987ddd012a192c4a429b29ac8d4e24587c5
URL: 
https://github.com/kamailio/kamailio/commit/d3900987ddd012a192c4a429b29ac8d4e24587c5

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T16:15:27+01:00

pvtpl: docs - section for template file

---

Modified: src/modules/pvtpl/doc/pvtpl_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/d3900987ddd012a192c4a429b29ac8d4e24587c5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d3900987ddd012a192c4a429b29ac8d4e24587c5.patch

---

diff --git a/src/modules/pvtpl/doc/pvtpl_admin.xml 
b/src/modules/pvtpl/doc/pvtpl_admin.xml
index 8ca0174d3c4..25459ac1139 100644
--- a/src/modules/pvtpl/doc/pvtpl_admin.xml
+++ b/src/modules/pvtpl/doc/pvtpl_admin.xml
@@ -120,11 +120,35 @@ modparam("pvtpl", "tpl", 
"name=tpl2;fpath=/etc/kamailio/tpl2.pvtpl;bsize=256;")
pvtpl_render usage

 ...
-pvtpl_render("t1", "$var(out)")
+pvtpl_render("t1", "$var(out)");
 ...
 



 
+   
+   Template File
+   
+   The template file can contain text and config variables that 
are evaluate
+   when running pvtpl_render() functions.
+   
+   
+   The templates files are loaded at startup and prepared for 
runtime. It is
+   no option to reload the template files.
+   
+   
+   Template file
+   
+...
+{
+  "from": "$fu",
+  "to": "$tu",
+  "x" : $var(x)
+}
+...
+
+   
+
+   
 

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


[sr-dev] git:master:eca79b06: modules: readme files regenerated - pvtpl ... [skip ci]

2024-03-20 Thread Kamailio Dev via sr-dev
Module: kamailio
Branch: master
Commit: eca79b066984d8bd219c19a8c0dccb4955503bfc
URL: 
https://github.com/kamailio/kamailio/commit/eca79b066984d8bd219c19a8c0dccb4955503bfc

Author: Kamailio Dev 
Committer: Kamailio Dev 
Date: 2024-03-20T16:16:11+01:00

modules: readme files regenerated - pvtpl ... [skip ci]

---

Modified: src/modules/pvtpl/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/eca79b066984d8bd219c19a8c0dccb4955503bfc.diff
Patch: 
https://github.com/kamailio/kamailio/commit/eca79b066984d8bd219c19a8c0dccb4955503bfc.patch

---

diff --git a/src/modules/pvtpl/README b/src/modules/pvtpl/README
index 4ed20d00202..5bf5553aa97 100644
--- a/src/modules/pvtpl/README
+++ b/src/modules/pvtpl/README
@@ -30,12 +30,15 @@ Daniel-Constantin Mierla
 
 4. Functions
 
-  4.1. pvtpl_apply(tplname, res)
+  4.1. pvtpl_render(tplname, res)
+
+5. Template File
 
List of Examples
 
1.1. Set tpl parameter
-   1.2. gcrypt_aes_encrypt usage
+   1.2. pvtpl_render usage
+   1.3. Template file
 
 Chapter 1. Admin Guide
 
@@ -53,7 +56,9 @@ Chapter 1. Admin Guide
 
4. Functions
 
-4.1. pvtpl_apply(tplname, res)
+4.1. pvtpl_render(tplname, res)
+
+   5. Template File
 
 1. Overview
 
@@ -101,18 +106,33 @@ modparam("pvtpl", "tpl", 
"name=tpl2;fpath=/etc/kamailio/tpl2.pvtpl;bsize=256;")
 
 4. Functions
 
-   4.1. pvtpl_apply(tplname, res)
+   4.1. pvtpl_render(tplname, res)
 
-4.1.  pvtpl_apply(tplname, res)
+4.1.  pvtpl_render(tplname, res)
 
-   Encrypts the text with the key using AES256 ECB encryption algorithm.
-   The result is encoded in base64 format and stored in res. The parameter
-   res must be a read-write variables. The parameters text and key can be
-   static strings or strings with variables (dynamic strings).
+   Render the template 'tplname' using config variables, setting the
+   result in the variable specified by 'res'.
 
This function can be used from ANY_ROUTE.
 
-   Example 1.2. gcrypt_aes_encrypt usage
+   Example 1.2. pvtpl_render usage
+...
+pvtpl_render("t1", "$var(out)");
+...
+
+5. Template File
+
+   The template file can contain text and config variables that are
+   evaluate when running pvtpl_render() functions.
+
+   The templates files are loaded at startup and prepared for runtime. It
+   is no option to reload the template files.
+
+   Example 1.3. Template file
 ...
-gcrypt_aes_encrypt("$rb", "my-secret-key", "$var(encrypted)");
+{
+  "from": "$fu",
+  "to": "$tu",
+  "x" : $var(x)
+}
 ...

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


[sr-dev] git:master:d75e10f9: pvtpl: renamed pvtpl_apply() to pvtpl_render()

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: d75e10f983e7afaa7779e8fde6524d7eccdfd497
URL: 
https://github.com/kamailio/kamailio/commit/d75e10f983e7afaa7779e8fde6524d7eccdfd497

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T16:07:16+01:00

pvtpl: renamed pvtpl_apply() to pvtpl_render()

---

Modified: src/modules/pvtpl/doc/pvtpl_admin.xml
Modified: src/modules/pvtpl/pvtpl_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d75e10f983e7afaa7779e8fde6524d7eccdfd497.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d75e10f983e7afaa7779e8fde6524d7eccdfd497.patch

---

diff --git a/src/modules/pvtpl/doc/pvtpl_admin.xml 
b/src/modules/pvtpl/doc/pvtpl_admin.xml
index 8ccfb8f9a23..8ca0174d3c4 100644
--- a/src/modules/pvtpl/doc/pvtpl_admin.xml
+++ b/src/modules/pvtpl/doc/pvtpl_admin.xml
@@ -105,24 +105,22 @@ modparam("pvtpl", "tpl", 
"name=tpl2;fpath=/etc/kamailio/tpl2.pvtpl;bsize=256;")
 

Functions
-   
+   

-   pvtpl_apply(tplname, res)
+   pvtpl_render(tplname, res)


-   Encrypts the text with the key using AES256 ECB encryption 
algorithm.
-   The result is encoded in base64 format and stored in res. The 
parameter
-   res must be a read-write variables. The parameters text and key 
can
-   be static strings or strings with variables (dynamic strings).
+   Render the template 'tplname' using config variables, setting 
the result
+   in the variable specified by 'res'.


This function can be used from ANY_ROUTE.


-   gcrypt_aes_encrypt usage
+   pvtpl_render usage

 ...
-gcrypt_aes_encrypt("$rb", "my-secret-key", "$var(encrypted)");
+pvtpl_render("t1", "$var(out)")
 ...
 

diff --git a/src/modules/pvtpl/pvtpl_mod.c b/src/modules/pvtpl/pvtpl_mod.c
index 15ee74b6838..9862a225236 100644
--- a/src/modules/pvtpl/pvtpl_mod.c
+++ b/src/modules/pvtpl/pvtpl_mod.c
@@ -42,7 +42,7 @@ static int mod_init(void);
 static int child_init(int);
 static void mod_destroy(void);
 
-static int w_pvtpl_apply(sip_msg_t *msg, char *ptplname, char *popv);
+static int w_pvtpl_render(sip_msg_t *msg, char *ptplname, char *popv);
 
 /* clang-format off */
 typedef struct pvtpl_item {
@@ -61,7 +61,7 @@ static pvtpl_item_t *_pvtpl_list = NULL;
 
 /* clang-format off */
 static cmd_export_t cmds[]={
-   {"pvtpl_apply", (cmd_function)w_pvtpl_apply, 2, fixup_spve_pvar,
+   {"pvtpl_render", (cmd_function)w_pvtpl_render, 2, fixup_spve_pvar,
fixup_free_spve_pvar, ANY_ROUTE},
 
{0, 0, 0, 0, 0, 0}
@@ -278,7 +278,7 @@ static int pvtpl_tpl_param(modparam_t type, void *val)
 /**
  *
  */
-static int pvtpl_apply(sip_msg_t *msg, str *tplname, pv_spec_t *dst)
+static int pvtpl_render(sip_msg_t *msg, str *tplname, pv_spec_t *dst)
 {
pvtpl_item_t *it;
pv_value_t val;
@@ -313,7 +313,7 @@ static int pvtpl_apply(sip_msg_t *msg, str *tplname, 
pv_spec_t *dst)
 /**
  *
  */
-static int ki_pvtpl_apply(sip_msg_t *msg, str *tplname, str *opv)
+static int ki_pvtpl_render(sip_msg_t *msg, str *tplname, str *opv)
 {
pv_spec_t *dst;
 
@@ -324,13 +324,13 @@ static int ki_pvtpl_apply(sip_msg_t *msg, str *tplname, 
str *opv)
return -1;
}
 
-   return pvtpl_apply(msg, tplname, dst);
+   return pvtpl_render(msg, tplname, dst);
 }
 
 /**
  *
  */
-static int w_pvtpl_apply(sip_msg_t *msg, char *ptplname, char *popv)
+static int w_pvtpl_render(sip_msg_t *msg, char *ptplname, char *popv)
 {
str tplname;
pv_spec_t *dst;
@@ -341,7 +341,7 @@ static int w_pvtpl_apply(sip_msg_t *msg, char *ptplname, 
char *popv)
}
dst = (pv_spec_t *)popv;
 
-   return pvtpl_apply(msg, &tplname, dst);
+   return pvtpl_render(msg, &tplname, dst);
 }
 
 /**
@@ -349,8 +349,8 @@ static int w_pvtpl_apply(sip_msg_t *msg, char *ptplname, 
char *popv)
  */
 /* clang-format off */
 static sr_kemi_t sr_kemi_pvtpl_exports[] = {
-   { str_init("pvtpl"), str_init("pvtpl_apply"),
-   SR_KEMIP_INT, ki_pvtpl_apply,
+   { str_init("pvtpl"), str_init("pvtpl_render"),
+   SR_KEMIP_INT, ki_pvtpl_render,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},

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


[sr-dev] Re: [kamailio/kamailio] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Is it possible to use the same logic for downloading (and caching) of the key 
as the `secsipid_check` function:

> If the keyPath parameter is empty, the function is downloading the key using 
> the URL from "info" parameter of the sIdentity, using the value of "timeout" 
> parameter to limit the download time


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009737204
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] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Ah - I see the function takes three arguments.  The third argument only has "A" 
as an allowed value?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009659271
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] secsipid method to only validate signature without checking the rest of the header (Issue #3784)

2024-03-20 Thread Ben Kaufman via sr-dev
Sorry for the delayed reply - I had a few small issues compiling, but kamailio 
then fails to start with secsipid_verify() not found:

During startup:
```
 0(1) ERROR:  [core/cfg.y:3870]: yyparse(): cfg. parser: failed to find 
command secsipid_verify (params 2)
```

Versions:
```
[ben@NV0162~/projects/cnam_relay]$ dc exec cnam-sti-vs kamailio -v
version: kamailio 5.9.0-dev0 (x86_64/linux) 951ab1
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 951ab1
compiled on 21:42:15 Mar 19 2024 with gcc 12.2.0

[ben@NV0162~/projects/cnam_relay]$ dc exec cnam-sti-vs secsipidx -version
secsipidx v1.3.2
```

This is my Dockerfile in case I'm missing something in compilation:
```
FROM golang:1.22.1-bookworm AS secsipidbuilder
ARG SECSIPID_VERSION=v1.3.2
ENV GO111MODULE=off
RUNcd / \
&& git clone https://github.com/asipto/secsipidx.git \
&& cd secsipidx \
&& make \
&& make install \
&& cd / \
&& apt update \
&& apt upgrade -y \
&& apt install -y git make automake autoconf libtool libcurl4-openssl-dev \
  sngrep gnupg2 wget lsb-release openssl libssl-dev \
  pkg-config uuid-dev sip-tester \
&& apt install -y pkg-config gcc bison flex g++ libssl-dev libxml2-dev \
  libjson-c-dev libpcre3 libjansson-dev libpcre3-dev  \
  libhiredis-dev libsqlite3-dev libpq-dev libevent-dev \
  sqlite3 uuid-dev \
&& cd /secsipidx \
&& make install \
&& git clone \
-b master \
--single-branch https://github.com/kamailio/kamailio.git /kamailio \
&& cd /kamailio \
&& make include_modules="jansson json ndb_redis db_sqlite db_postgres \
 secsipid secsipid_proc http_async_client avpops \
 uuid" prefix="/" cfg \
&& make all \
&& make install \
&& apt clean \
&& apt-get autoremove --yes \
&& cd / \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& rm -rf /kamailio \
&& rm -rf /secsipidx

COPY etc/kamailio /etc/kamailio
```




-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784#issuecomment-2009632594
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] Not enough parameters for htable.seti (Issue #3774)

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Thanks for testing, commits backported to 5.8 and 5.7.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3774#issuecomment-2009480065
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] Not enough parameters for htable.seti (Issue #3774)

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Closed #3774 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3774#event-12184279464
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] git:5.7:29b6562d: ctl: handle int input for double storage

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.7
Commit: 29b6562d8ebe6277fda5524dda18b88cf2a4e1a9
URL: 
https://github.com/kamailio/kamailio/commit/29b6562d8ebe6277fda5524dda18b88cf2a4e1a9

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:42:36+01:00

ctl: handle int input for double storage

(cherry picked from commit 1380a4a0d18159c7130b70c0216134a253ad83f7)
(cherry picked from commit 90f8117f9669069b4dab7e9d747dfa06245ec8a0)

---

Modified: src/modules/ctl/binrpc.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/29b6562d8ebe6277fda5524dda18b88cf2a4e1a9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/29b6562d8ebe6277fda5524dda18b88cf2a4e1a9.patch

---

diff --git a/src/modules/ctl/binrpc.h b/src/modules/ctl/binrpc.h
index fd247bc603a..7909bc930d4 100644
--- a/src/modules/ctl/binrpc.h
+++ b/src/modules/ctl/binrpc.h
@@ -719,10 +719,12 @@ inline static unsigned char *binrpc_read_record(struct 
binrpc_parse_ctx *ctx,
*err = E_BINRPC_MORE_DATA;
goto error;
}
-   if((v->type != type) && (v->type != BINRPC_T_ALL)) {
-   goto error_type;
+   if(!(v->type == BINRPC_T_DOUBLE && type == BINRPC_T_INT)) {
+   if((v->type != type) && (v->type != BINRPC_T_ALL)) {
+   goto error_type;
+   }
+   v->type = type;
}
-   v->type = type;
switch(type) {
case BINRPC_T_STRUCT:
if(ctx->in_struct) {
@@ -779,7 +781,12 @@ inline static unsigned char *binrpc_read_record(struct 
binrpc_parse_ctx *ctx,
case BINRPC_T_INT:
if(ctx->in_struct && smode == 0)
goto error_record;
-   p = binrpc_read_int(&v->u.intval, len, p, end, err);
+   if(v->type == BINRPC_T_DOUBLE) {
+   p = binrpc_read_int(&tmp, len, p, end, err);
+   v->u.fval = tmp;
+   } else {
+   p = binrpc_read_int(&v->u.intval, len, p, end, 
err);
+   }
break;
case BINRPC_T_STR:
if(ctx->in_struct && smode == 0)

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


[sr-dev] git:master:68c69966: gcrypt: docs - module name used for section ids

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 68c69966c38b56775a3966d07c33ff94c2a8ba95
URL: 
https://github.com/kamailio/kamailio/commit/68c69966c38b56775a3966d07c33ff94c2a8ba95

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:40:28+01:00

gcrypt: docs - module name used for section ids

---

Modified: src/modules/gcrypt/doc/gcrypt_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/68c69966c38b56775a3966d07c33ff94c2a8ba95.diff
Patch: 
https://github.com/kamailio/kamailio/commit/68c69966c38b56775a3966d07c33ff94c2a8ba95.patch

---

diff --git a/src/modules/gcrypt/doc/gcrypt_admin.xml 
b/src/modules/gcrypt/doc/gcrypt_admin.xml
index 533ec5c80f9..3fc03d3eabc 100644
--- a/src/modules/gcrypt/doc/gcrypt_admin.xml
+++ b/src/modules/gcrypt/doc/gcrypt_admin.xml
@@ -127,7 +127,7 @@ modparam("gcrypt", "register_callid", 1)
 

Functions
-   
+   

gcrypt_aes_encrypt(text, key, 
res)

@@ -150,7 +150,7 @@ gcrypt_aes_encrypt("$rb", "my-secret-key", 
"$var(encrypted)");


 
-   
+   

gcrypt_aes_decrypt(text, key, 
res)


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


[sr-dev] git:5.8:7bcef8ef: modules: readme files regenerated - modules ... [skip ci]

2024-03-20 Thread Kamailio Dev via sr-dev
Module: kamailio
Branch: 5.8
Commit: 7bcef8ef487a713f5b6c6fadb7a3166ed41fb136
URL: 
https://github.com/kamailio/kamailio/commit/7bcef8ef487a713f5b6c6fadb7a3166ed41fb136

Author: Kamailio Dev 
Committer: Kamailio Dev 
Date: 2024-03-20T13:31:25+01:00

modules: readme files regenerated - modules ... [skip ci]

---

Modified: src/modules/dispatcher/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/7bcef8ef487a713f5b6c6fadb7a3166ed41fb136.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7bcef8ef487a713f5b6c6fadb7a3166ed41fb136.patch

---

diff --git a/src/modules/dispatcher/README b/src/modules/dispatcher/README
index 79fc82ec175..209d77f4c87 100644
--- a/src/modules/dispatcher/README
+++ b/src/modules/dispatcher/README
@@ -1489,9 +1489,16 @@ if(ds_list_exists("10")) {
ignoring the protocol (value 2). If parameter is 0, all ip, port
and proto are matched and active status is ignored. If bit one is
set, then port is ignored. If bit two is set, then protocol is
-   ignored. If bit three is set, then state must be active. The
-   parameter can be an integer or a variable holding an integer value.
-   It must be provided if the uri parameter is provided.
+   ignored. If bit three is set, then state must be active. If bit
+   four is set, then socket/sockname be matched. If bit five is set,
+   then try to find the most closest target from all dispatcher
+   targets with the mandatory ip and combination of local socket,
+   protocol, port, the weighted search result is combined from bit
+   flags of matched components: ip - 1, port - 2, protocol - 4, local
+   socket - 8, the target with the maximum value of flags combination
+   will be selected. The parameter can be an integer or a variable
+   holding an integer value. It must be provided if the uri parameter
+   is provided.
  * uri (optional) - if parameter is empty or missing, the matching is
done against source IP, port and protocol. Otherwise the value has
to be a valid SIP URI, used to match against addresses in the

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


[sr-dev] git:5.7:4cc28e45: ndb_redis: fix index on parsing sentinel address inside redisc_reconnect_server()

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.7
Commit: 4cc28e453d8e62b9f6e2725b9496600c662a8811
URL: 
https://github.com/kamailio/kamailio/commit/4cc28e453d8e62b9f6e2725b9496600c662a8811

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:27:08+01:00

ndb_redis: fix index on parsing sentinel address inside 
redisc_reconnect_server()

(cherry picked from commit c8f3b496a05ae5bf29341dc7e2630f951d4effc5)
(cherry picked from commit 86df978bc9842687035d6673ee1b71e542dcbd71)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/4cc28e453d8e62b9f6e2725b9496600c662a8811.diff
Patch: 
https://github.com/kamailio/kamailio/commit/4cc28e453d8e62b9f6e2725b9496600c662a8811.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index a0865dc6125..e85fdcec7aa 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -491,7 +491,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
port = 6379;
if((pos = strchr(sentinelAddr, ':')) != NULL) {
port = atoi(pos + 1);
-   pos[i] = '\0';
+   pos[0] = '\0';
}
 
redis = redisConnectWithTimeout(sentinelAddr, port, 
tv_conn);

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


[sr-dev] git:5.7:6a9caa09: keepalive: proper storing of last up/down timestamps

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.7
Commit: 6a9caa099352a31a2f14012d16c01d55c9250f02
URL: 
https://github.com/kamailio/kamailio/commit/6a9caa099352a31a2f14012d16c01d55c9250f02

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:26:29+01:00

keepalive: proper storing of last up/down timestamps

- GH #3790

(cherry picked from commit 9e2a0ee545646bd4491ecdbe58d7fea770764b54)
(cherry picked from commit 0b3aa00775a5c0b4b1dc4990f4c26bc637fc6de5)

---

Modified: src/modules/keepalive/keepalive_core.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/6a9caa099352a31a2f14012d16c01d55c9250f02.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6a9caa099352a31a2f14012d16c01d55c9250f02.patch

---

diff --git a/src/modules/keepalive/keepalive_core.c 
b/src/modules/keepalive/keepalive_core.c
index 0aaafa8c8da..b1b3581cb34 100644
--- a/src/modules/keepalive/keepalive_core.c
+++ b/src/modules/keepalive/keepalive_core.c
@@ -131,11 +131,11 @@ static void ka_options_callback(
// accepting 2XX return codes
if(ps->code >= 200 && ps->code <= 299) {
state = KA_STATE_UP;
-   ka_dest->last_down = time(NULL);
+   ka_dest->last_up = time(NULL);
ka_dest->counter = 0;
} else {
state = KA_STATE_DOWN;
-   ka_dest->last_up = time(NULL);
+   ka_dest->last_down = time(NULL);
ka_dest->counter++;
}
 

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


[sr-dev] git:5.7:a7e9a265: ndb_redis: break on finding a server via sentinel inside redisc_reconnect_server()

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.7
Commit: a7e9a26542010e1677fcb0e305e7d371e5467dba
URL: 
https://github.com/kamailio/kamailio/commit/a7e9a26542010e1677fcb0e305e7d371e5467dba

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:27:15+01:00

ndb_redis: break on finding a server via sentinel inside 
redisc_reconnect_server()

(cherry picked from commit 951ab118bb7d9955f8e69b66bec1f0c107d474a2)
(cherry picked from commit 60fd6c2622c9c5edbe82908c0e461d646225c8a6)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a7e9a26542010e1677fcb0e305e7d371e5467dba.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a7e9a26542010e1677fcb0e305e7d371e5467dba.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index e85fdcec7aa..eed2e1bcc88 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -485,6 +485,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
for(i = 0; i < sentinels_count; i++) {
char *sentinelAddr = sentinels[i];
char *pos;
+   int srvfound = 0;
redisContext *redis;
redisReply *res, *res2;
 
@@ -507,6 +508,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
port = 
atoi(res->element[1]->str);
LOG(ndb_redis_debug, "sentinel 
replied: %s:%d\n", addr,
port);
+   srvfound = 1;
}
} else {
res = redisCommand(
@@ -530,9 +532,13 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
}
LOG(ndb_redis_debug, "slave for 
%s: %s:%d\n",
sentinel_group, 
addr, port);
+   srvfound = 1;
}
}
}
+   if(srvfound == 1) {
+   break;
+   }
}
}
 

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


[sr-dev] git:5.7:f654b9c1: keepalive: small formatting updates and comments to the ka dest structure

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.7
Commit: f654b9c1943be6816827f9048627a7c8a7fe50f6
URL: 
https://github.com/kamailio/kamailio/commit/f654b9c1943be6816827f9048627a7c8a7fe50f6

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:26:43+01:00

keepalive: small formatting updates and comments to the ka dest structure

(cherry picked from commit cee82c92b06a026b88fea654944f6146eb5cb4d8)
(cherry picked from commit a7d4ce95b383dc26c547ef9ee07b05d51abc50f9)

---

Modified: src/modules/keepalive/keepalive.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/f654b9c1943be6816827f9048627a7c8a7fe50f6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f654b9c1943be6816827f9048627a7c8a7fe50f6.patch

---

diff --git a/src/modules/keepalive/keepalive.h 
b/src/modules/keepalive/keepalive.h
index d5a8fcb2197..5ca1ce3561d 100644
--- a/src/modules/keepalive/keepalive.h
+++ b/src/modules/keepalive/keepalive.h
@@ -69,13 +69,15 @@ typedef struct _ka_initial_dest
 typedef struct _ka_dest
 {
str uri;
-   str owner; // name of destination "owner"
-  // (module asking to monitor this destination
-   str uuid;  // Universal id for this record
+   str owner; /*!< Name of destination "owner" */
+  /*!< Module asking to monitor this destination */
+   str uuid;  /*!< Universal id for this record */
int flags;
int state;
-   time_t last_checked, last_up, last_down;
-   int counter;   // counts unreachable attempts
+   time_t last_checked;
+   time_t last_up;/*!< Time of last successful SIP reply */
+   time_t last_down;  /*!< Time of last failure SIP reply */
+   int counter;   /*!< Counts unreachable attempts */
ticks_t ping_interval; /*!< Actual interval between OPTIONS  */
 
void *user_attr;

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


[sr-dev] git:5.8:60fd6c26: ndb_redis: break on finding a server via sentinel inside redisc_reconnect_server()

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 60fd6c2622c9c5edbe82908c0e461d646225c8a6
URL: 
https://github.com/kamailio/kamailio/commit/60fd6c2622c9c5edbe82908c0e461d646225c8a6

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:16:29+01:00

ndb_redis: break on finding a server via sentinel inside 
redisc_reconnect_server()

(cherry picked from commit 951ab118bb7d9955f8e69b66bec1f0c107d474a2)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/60fd6c2622c9c5edbe82908c0e461d646225c8a6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/60fd6c2622c9c5edbe82908c0e461d646225c8a6.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index dbbaecbcebe..c9280991ff3 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -533,6 +533,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
for(i = 0; i < sentinels_count; i++) {
char *sentinelAddr = sentinels[i];
char *pos;
+   int srvfound = 0;
redisContext *redis;
redisReply *res, *res2;
 
@@ -555,6 +556,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
port = 
atoi(res->element[1]->str);
LOG(ndb_redis_debug, "sentinel 
replied: %s:%d\n", addr,
port);
+   srvfound = 1;
}
} else {
res = redisCommand(
@@ -578,9 +580,13 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
}
LOG(ndb_redis_debug, "slave for 
%s: %s:%d\n",
sentinel_group, 
addr, port);
+   srvfound = 1;
}
}
}
+   if(srvfound == 1) {
+   break;
+   }
}
}
 

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


[sr-dev] git:5.8:7df7508d: dispatcher: refine documentation

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 7df7508d7d2b7b9495dafab8b515a5721bd669ee
URL: 
https://github.com/kamailio/kamailio/commit/7df7508d7d2b7b9495dafab8b515a5721bd669ee

Author: Dennis Yurasov 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:14:16+01:00

dispatcher: refine documentation
- more clear documentation for the new ds_is_from_list flags

(cherry picked from commit 761e963c0f7d9bf1b66c1ef18a409756b919ae2c)

---

Modified: src/modules/dispatcher/doc/dispatcher_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/7df7508d7d2b7b9495dafab8b515a5721bd669ee.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7df7508d7d2b7b9495dafab8b515a5721bd669ee.patch

---

diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml 
b/src/modules/dispatcher/doc/dispatcher_admin.xml
index 4708ca06c92..83ef06285a0 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1805,9 +1805,12 @@ if(ds_list_exists("10")) {
If bit two is set, then protocol is ignored.
If bit three is set, then state must be active.
If bit four is set, then socket/sockname be 
matched.
-   If bit five is set, then try to find the most 
complete 
-   "address/protocol/port/local socket" 
combination for all dispatcher targets.The parameter
-   can be an integer or a variable holding an 
integer value.
+   If bit five is set, then try to find the most 
closest target from all
+   dispatcher targets with the mandatory ip and 
combination of local socket, protocol, port,
+   the weighted search result is combined from bit 
flags of matched components:
+   ip - 1, port - 2, protocol - 4, local socket - 
8,
+   the target with the maximum value of flags 
combination will be selected.
+   The parameter can be an integer or a variable 
holding an integer value.
It must be provided if the uri parameter is 
provided.



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


[sr-dev] git:5.8:5daadecd: ims_ipsec_pcscf: TLS support in ipsec_forward() improved

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 5daadecd248322e5f8eaf1e46692f3d1c267
URL: 
https://github.com/kamailio/kamailio/commit/5daadecd248322e5f8eaf1e46692f3d1c267

Author: Axel Sommerfeldt 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:14:42+01:00

ims_ipsec_pcscf: TLS support in ipsec_forward() improved

This patch was initially done by Herle Supreeth in his fork but isn't present 
upstream yet:
https://github.com/kamailio/kamailio/commit/8b9a2977e111d9adb8595d98ab59f8c8eb033120

See also: https://github.com/kamailio/kamailio/issues/3772

(cherry picked from commit 3154a0aba5543cab75153429bc8ec617c3484f71)

---

Modified: src/modules/ims_ipsec_pcscf/cmd.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5daadecd248322e5f8eaf1e46692f3d1c267.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5daadecd248322e5f8eaf1e46692f3d1c267.patch

---

diff --git a/src/modules/ims_ipsec_pcscf/cmd.c 
b/src/modules/ims_ipsec_pcscf/cmd.c
index 47f9e401702..4f7301b56c1 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -1126,6 +1126,10 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int 
_cflags)
buf_len =
snprintf(buf, sizeof(buf) - 1, 
"sip:%.*s:%d;transport=tcp",
ci.via_host.len, 
ci.via_host.s, dst_port);
+   } else if((_cflags & IPSEC_SETDSTURI_FULL) && (dst_proto == 
PROTO_TLS)) {
+   buf_len =
+   snprintf(buf, sizeof(buf) - 1, 
"sip:%.*s:%d;transport=tls",
+   ci.via_host.len, 
ci.via_host.s, dst_port);
} else {
buf_len = snprintf(buf, sizeof(buf) - 1, "sip:%.*s:%d",
ci.via_host.len, ci.via_host.s, 
dst_port);

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


[sr-dev] git:5.8:a7d4ce95: keepalive: small formatting updates and comments to the ka dest structure

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: a7d4ce95b383dc26c547ef9ee07b05d51abc50f9
URL: 
https://github.com/kamailio/kamailio/commit/a7d4ce95b383dc26c547ef9ee07b05d51abc50f9

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:16:00+01:00

keepalive: small formatting updates and comments to the ka dest structure

(cherry picked from commit cee82c92b06a026b88fea654944f6146eb5cb4d8)

---

Modified: src/modules/keepalive/keepalive.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/a7d4ce95b383dc26c547ef9ee07b05d51abc50f9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a7d4ce95b383dc26c547ef9ee07b05d51abc50f9.patch

---

diff --git a/src/modules/keepalive/keepalive.h 
b/src/modules/keepalive/keepalive.h
index d5a8fcb2197..5ca1ce3561d 100644
--- a/src/modules/keepalive/keepalive.h
+++ b/src/modules/keepalive/keepalive.h
@@ -69,13 +69,15 @@ typedef struct _ka_initial_dest
 typedef struct _ka_dest
 {
str uri;
-   str owner; // name of destination "owner"
-  // (module asking to monitor this destination
-   str uuid;  // Universal id for this record
+   str owner; /*!< Name of destination "owner" */
+  /*!< Module asking to monitor this destination */
+   str uuid;  /*!< Universal id for this record */
int flags;
int state;
-   time_t last_checked, last_up, last_down;
-   int counter;   // counts unreachable attempts
+   time_t last_checked;
+   time_t last_up;/*!< Time of last successful SIP reply */
+   time_t last_down;  /*!< Time of last failure SIP reply */
+   int counter;   /*!< Counts unreachable attempts */
ticks_t ping_interval; /*!< Actual interval between OPTIONS  */
 
void *user_attr;

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


[sr-dev] git:5.8:91b09626: acc: more log messages of failure arsing extra acc string

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 91b0962679092f28abb5022d1505372356460f7d
URL: 
https://github.com/kamailio/kamailio/commit/91b0962679092f28abb5022d1505372356460f7d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:15:21+01:00

acc: more log messages of failure arsing extra acc string

(cherry picked from commit 04a73ace6572dd5c95a8f50b39b2ce712f7ebe84)

---

Modified: src/modules/acc/acc_extra.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/91b0962679092f28abb5022d1505372356460f7d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/91b0962679092f28abb5022d1505372356460f7d.patch

---

diff --git a/src/modules/acc/acc_extra.c b/src/modules/acc/acc_extra.c
index 255057a99c4..a84f02bbe02 100644
--- a/src/modules/acc/acc_extra.c
+++ b/src/modules/acc/acc_extra.c
@@ -127,8 +127,10 @@ struct acc_extra *parse_acc_extra(char *extra_str)
foo = s;
while(*s && !isspace((int)*s) && EQUAL != *s)
s++;
-   if(*s == 0)
+   if(*s == 0) {
+   LM_ERR("unexpected end of string\n");
goto parse_error;
+   }
if(*s == EQUAL) {
extra->name.len = (s++) - foo;
} else {
@@ -136,8 +138,10 @@ struct acc_extra *parse_acc_extra(char *extra_str)
/* skip spaces */
while(*s && isspace((int)*s))
s++;
-   if(*s != EQUAL)
+   if(*s != EQUAL) {
+   LM_ERR("unexpected char '%c' instead of '='\n", 
*s);
goto parse_error;
+   }
s++;
}
extra->name.s = foo;
@@ -149,15 +153,19 @@ struct acc_extra *parse_acc_extra(char *extra_str)
/* get value type */
stmp.s = s;
stmp.len = strlen(s);
-   if((foo = pv_parse_spec(&stmp, &extra->spec)) == 0)
+   if((foo = pv_parse_spec(&stmp, &extra->spec)) == 0) {
+   LM_ERR("failed to parse variable name\n");
goto parse_error;
+   }
s = foo;
 
/* skip spaces */
while(*s && isspace((int)*s))
s++;
-   if(*s && (*(s++) != SEPARATOR || *s == 0))
+   if(*s && (*(s++) != SEPARATOR || *s == 0)) {
+   LM_ERR("unexpected char at end of name=var group\n");
goto parse_error;
+   }
}
 
/* go throught all extras and make the names null terminated */

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


[sr-dev] git:5.8:86df978b: ndb_redis: fix index on parsing sentinel address inside redisc_reconnect_server()

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 86df978bc9842687035d6673ee1b71e542dcbd71
URL: 
https://github.com/kamailio/kamailio/commit/86df978bc9842687035d6673ee1b71e542dcbd71

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:16:19+01:00

ndb_redis: fix index on parsing sentinel address inside 
redisc_reconnect_server()

(cherry picked from commit c8f3b496a05ae5bf29341dc7e2630f951d4effc5)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/86df978bc9842687035d6673ee1b71e542dcbd71.diff
Patch: 
https://github.com/kamailio/kamailio/commit/86df978bc9842687035d6673ee1b71e542dcbd71.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index 9b755e42d6b..dbbaecbcebe 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -539,7 +539,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
port = 6379;
if((pos = strchr(sentinelAddr, ':')) != NULL) {
port = atoi(pos + 1);
-   pos[i] = '\0';
+   pos[0] = '\0';
}
 
redis = redisConnectWithTimeout(sentinelAddr, port, 
tv_conn);

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


[sr-dev] git:5.8:0b3aa007: keepalive: proper storing of last up/down timestamps

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 0b3aa00775a5c0b4b1dc4990f4c26bc637fc6de5
URL: 
https://github.com/kamailio/kamailio/commit/0b3aa00775a5c0b4b1dc4990f4c26bc637fc6de5

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:15:36+01:00

keepalive: proper storing of last up/down timestamps

- GH #3790

(cherry picked from commit 9e2a0ee545646bd4491ecdbe58d7fea770764b54)

---

Modified: src/modules/keepalive/keepalive_core.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/0b3aa00775a5c0b4b1dc4990f4c26bc637fc6de5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/0b3aa00775a5c0b4b1dc4990f4c26bc637fc6de5.patch

---

diff --git a/src/modules/keepalive/keepalive_core.c 
b/src/modules/keepalive/keepalive_core.c
index 0aaafa8c8da..b1b3581cb34 100644
--- a/src/modules/keepalive/keepalive_core.c
+++ b/src/modules/keepalive/keepalive_core.c
@@ -131,11 +131,11 @@ static void ka_options_callback(
// accepting 2XX return codes
if(ps->code >= 200 && ps->code <= 299) {
state = KA_STATE_UP;
-   ka_dest->last_down = time(NULL);
+   ka_dest->last_up = time(NULL);
ka_dest->counter = 0;
} else {
state = KA_STATE_DOWN;
-   ka_dest->last_up = time(NULL);
+   ka_dest->last_down = time(NULL);
ka_dest->counter++;
}
 

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


[sr-dev] git:5.8:a0dfa0ac: ndb_redis: clang-format for WITH_SSL code

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: a0dfa0ac81ed4aec33863fc20cf5cb3ee077a90c
URL: 
https://github.com/kamailio/kamailio/commit/a0dfa0ac81ed4aec33863fc20cf5cb3ee077a90c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T13:16:11+01:00

ndb_redis: clang-format for WITH_SSL code

(cherry picked from commit e54051d698b059aa168229493dc2d6bf3cdd757c)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a0dfa0ac81ed4aec33863fc20cf5cb3ee077a90c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a0dfa0ac81ed4aec33863fc20cf5cb3ee077a90c.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index ab0edf28187..9b755e42d6b 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -233,15 +233,15 @@ int redisc_init(void)
}
 
 #ifdef WITH_SSL
-   if(enable_ssl) {
-   /* Create SSL context*/
-   redisInitOpenSSL();
-   rsrv->sslCtxRedis = redisCreateSSLContext(
+   if(enable_ssl) {
+   /* Create SSL context*/
+   redisInitOpenSSL();
+   rsrv->sslCtxRedis = redisCreateSSLContext(
NULL, ndb_redis_ca_path, NULL, NULL, 
NULL, NULL);
-   if(rsrv->sslCtxRedis == NULL) {
+   if(rsrv->sslCtxRedis == NULL) {
LM_ERR("Unable to create Redis TLS Context.\n");
-   }
-   }
+   }
+   }
 #endif
 
if(sock != 0) {
@@ -260,10 +260,10 @@ int redisc_init(void)
}
 
 #ifdef WITH_SSL
-   if(enable_ssl) {
-   /* Negotiate SSL/TLS handshake*/
-   redisInitiateSSLWithContext(rsrv->ctxRedis, 
rsrv->sslCtxRedis);
-   }
+   if(enable_ssl) {
+   /* Negotiate SSL/TLS handshake*/
+   redisInitiateSSLWithContext(rsrv->ctxRedis, 
rsrv->sslCtxRedis);
+   }
 #endif
 
LOG(ndb_redis_debug, "rsrv->ctxRedis = %p\n", rsrv->ctxRedis);
@@ -498,10 +498,10 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
pass, sizeof(pass) - 1, "%.*s", 
pit->body.len, pit->body.s);
haspass = 1;
 #ifdef WITH_SSL
-   } else if(pit->name.len == 3 && strncmp(pit->name.s, "tls", 3) 
== 0) {
+   } else if(pit->name.len == 3 && strncmp(pit->name.s, "tls", 3) 
== 0) {
snprintf(
pass, sizeof(pass) - 1, "%.*s", 
pit->body.len, pit->body.s);
-   if(str2int(&pit->body, &enable_ssl) < 0)
+   if(str2int(&pit->body, &enable_ssl) < 0)
enable_ssl = 0;
 #endif
} else if(pit->name.len == 14

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


[sr-dev] git:5.8:90f8117f: ctl: handle int input for double storage

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 90f8117f9669069b4dab7e9d747dfa06245ec8a0
URL: 
https://github.com/kamailio/kamailio/commit/90f8117f9669069b4dab7e9d747dfa06245ec8a0

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-19T18:20:18+01:00

ctl: handle int input for double storage

(cherry picked from commit 1380a4a0d18159c7130b70c0216134a253ad83f7)

---

Modified: src/modules/ctl/binrpc.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/90f8117f9669069b4dab7e9d747dfa06245ec8a0.diff
Patch: 
https://github.com/kamailio/kamailio/commit/90f8117f9669069b4dab7e9d747dfa06245ec8a0.patch

---

diff --git a/src/modules/ctl/binrpc.h b/src/modules/ctl/binrpc.h
index fd247bc603a..7909bc930d4 100644
--- a/src/modules/ctl/binrpc.h
+++ b/src/modules/ctl/binrpc.h
@@ -719,10 +719,12 @@ inline static unsigned char *binrpc_read_record(struct 
binrpc_parse_ctx *ctx,
*err = E_BINRPC_MORE_DATA;
goto error;
}
-   if((v->type != type) && (v->type != BINRPC_T_ALL)) {
-   goto error_type;
+   if(!(v->type == BINRPC_T_DOUBLE && type == BINRPC_T_INT)) {
+   if((v->type != type) && (v->type != BINRPC_T_ALL)) {
+   goto error_type;
+   }
+   v->type = type;
}
-   v->type = type;
switch(type) {
case BINRPC_T_STRUCT:
if(ctx->in_struct) {
@@ -779,7 +781,12 @@ inline static unsigned char *binrpc_read_record(struct 
binrpc_parse_ctx *ctx,
case BINRPC_T_INT:
if(ctx->in_struct && smode == 0)
goto error_record;
-   p = binrpc_read_int(&v->u.intval, len, p, end, err);
+   if(v->type == BINRPC_T_DOUBLE) {
+   p = binrpc_read_int(&tmp, len, p, end, err);
+   v->u.fval = tmp;
+   } else {
+   p = binrpc_read_int(&v->u.intval, len, p, end, 
err);
+   }
break;
case BINRPC_T_STR:
if(ctx->in_struct && smode == 0)

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


[sr-dev] git:master:3e3e9039: pvtpl: new module to process pv templates loaded from files

2024-03-20 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 3e3e9039b6bbd8922af5aa5ab81eb1addb8fb05c
URL: 
https://github.com/kamailio/kamailio/commit/3e3e9039b6bbd8922af5aa5ab81eb1addb8fb05c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-03-20T12:57:04+01:00

pvtpl: new module to process pv templates loaded from files

---

Added: src/modules/pvtpl/Makefile
Added: src/modules/pvtpl/README
Added: src/modules/pvtpl/doc/Makefile
Added: src/modules/pvtpl/doc/pvtpl.xml
Added: src/modules/pvtpl/doc/pvtpl_admin.xml
Added: src/modules/pvtpl/pvtpl_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3e3e9039b6bbd8922af5aa5ab81eb1addb8fb05c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3e3e9039b6bbd8922af5aa5ab81eb1addb8fb05c.patch

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