[sr-dev] git:master:b96de87a: ipops: define hostname size for ptr structure

2024-04-22 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: b96de87ae94db2285d7a5f022c38a746d69ae5ef
URL: 
https://github.com/kamailio/kamailio/commit/b96de87ae94db2285d7a5f022c38a746d69ae5ef

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-22T21:43:40+02:00

ipops: define hostname size for ptr structure

- replace the strncpy with strlen with straight strcpy

---

Modified: src/modules/ipops/ipops_pv.c
Modified: src/modules/ipops/ipops_pv.h

---

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

---

diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index 034ec696594..acbe08a4283 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -429,7 +429,7 @@ int ptr_update_pv(str *ip_address, str *name)
sr_dns_item_t *dr = NULL;
struct sockaddr_in sa;
struct sockaddr_in6 sa6;
-   char hostname[256];
+   char hostname[SR_DNS_HOSTNAME_SIZE];
int result;
int ip_type;
if(ip_address->len > INET6_ADDRSTRLEN) {
@@ -499,8 +499,7 @@ int ptr_update_pv(str *ip_address, str *name)
}
 
/* Store the hostname in the sr_dns_item_t structure. */
-   strncpy(dr->hostname, hostname, strlen(hostname));
-   dr->hostname[strlen(hostname)] = '\0';
+   strcpy(dr->hostname, hostname);
dr->count = 1;
 
LM_DBG("reverse dns PV updated for: %s (%d)\n", dr->r[0].addr, 
dr->count);
diff --git a/src/modules/ipops/ipops_pv.h b/src/modules/ipops/ipops_pv.h
index 5e9a19be1da..cede3b4217c 100644
--- a/src/modules/ipops/ipops_pv.h
+++ b/src/modules/ipops/ipops_pv.h
@@ -27,7 +27,7 @@
 #define PV_DNS_ADDR 64
 #define PV_DNS_RECS 32
 #define SR_DNS_PVIDX 1
-
+#define SR_DNS_HOSTNAME_SIZE 256
 typedef struct _sr_dns_record
 {
int type;
@@ -38,7 +38,7 @@ typedef struct _sr_dns_item
 {
str name;
unsigned int hashid;
-   char hostname[256];
+   char hostname[SR_DNS_HOSTNAME_SIZE];
int count;
int ipv4;
int ipv6;

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


[sr-dev] git:master:6e6b4f06: xhttp_prom: use %lu for printing pkg fields

2024-04-22 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 6e6b4f06546a0d9ad942847ee745b17a5aeb7f6a
URL: 
https://github.com/kamailio/kamailio/commit/6e6b4f06546a0d9ad942847ee745b17a5aeb7f6a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-22T21:54:26+02:00

xhttp_prom: use %lu for printing pkg fields

---

Modified: src/modules/xhttp_prom/prom.c

---

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

---

diff --git a/src/modules/xhttp_prom/prom.c b/src/modules/xhttp_prom/prom.c
index efe111b752a..71accf21845 100644
--- a/src/modules/xhttp_prom/prom.c
+++ b/src/modules/xhttp_prom/prom.c
@@ -253,7 +253,7 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
for(; i < pkg_proc_stats_no; i++) {
if(prom_body_printf(ctx,
   "%.*spkgmem_used{pid=\"%u\", rank=\"%d\", 
desc=\"%s\"} "
-  "%d %" PRIu64 "\n",
+  "%lu %" PRIu64 "\n",
   xhttp_prom_beginning.len, 
xhttp_prom_beginning.s,
   pkg_proc_stats[i].pid, 
pkg_proc_stats[i].rank, pt[i].desc,
   pkg_proc_stats[i].used, ts)
@@ -263,7 +263,7 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
}
if(prom_body_printf(ctx,
   "%.*spkgmem_available{pid=\"%u\", 
rank=\"%d\", "
-  "desc=\"%s\"} %d %" PRIu64 "\n",
+  "desc=\"%s\"} %lu %" PRIu64 "\n",
   xhttp_prom_beginning.len, 
xhttp_prom_beginning.s,
   pkg_proc_stats[i].pid, 
pkg_proc_stats[i].rank, pt[i].desc,
   pkg_proc_stats[i].available, ts)
@@ -273,7 +273,7 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
}
if(prom_body_printf(ctx,
   "%.*spkgmem_real_used{pid=\"%u\", 
rank=\"%d\", "
-  "desc=\"%s\"} %d %" PRIu64 "\n",
+  "desc=\"%s\"} %lu %" PRIu64 "\n",
   xhttp_prom_beginning.len, 
xhttp_prom_beginning.s,
   pkg_proc_stats[i].pid, 
pkg_proc_stats[i].rank, pt[i].desc,
   pkg_proc_stats[i].real_used, ts)
@@ -283,7 +283,7 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
}
if(prom_body_printf(ctx,
   "%.*spkgmem_total_frags{pid=\"%u\", 
rank=\"%d\", "
-  "desc=\"%s\"} %d %" PRIu64 "\n",
+  "desc=\"%s\"} %lu %" PRIu64 "\n",
   xhttp_prom_beginning.len, 
xhttp_prom_beginning.s,
   pkg_proc_stats[i].pid, 
pkg_proc_stats[i].rank, pt[i].desc,
   pkg_proc_stats[i].total_frags, ts)
@@ -293,7 +293,7 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
}
if(prom_body_printf(ctx,
   "%.*spkgmem_total_size{pid=\"%u\", 
rank=\"%d\" "
-  "desc=\"%s\"} %d %" PRIu64 "\n",
+  "desc=\"%s\"} %lu %" PRIu64 "\n",
   xhttp_prom_beginning.len, 
xhttp_prom_beginning.s,
   pkg_proc_stats[i].pid, 
pkg_proc_stats[i].rank, pt[i].desc,
   pkg_proc_stats[i].total_size, ts)

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


[sr-dev] Re: [kamailio/kamailio] Misleading source IP of 1.0.0.127 in event routes (Issue #3817)

2024-04-22 Thread Daniel-Constantin Mierla via sr-dev
It looks like reversed order, what is the operating system and the compiler 
used?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3817#issuecomment-2070730147
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:1adc0724: acc: docs - small fix to cdr_extra param example

2024-04-15 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 1adc07240c153b40f6bf5cb700145f8789070bcc
URL: 
https://github.com/kamailio/kamailio/commit/1adc07240c153b40f6bf5cb700145f8789070bcc

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-15T21:29:54+02:00

acc: docs - small fix to cdr_extra param example

---

Modified: src/modules/acc/doc/acc_admin.xml

---

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

---

diff --git a/src/modules/acc/doc/acc_admin.xml 
b/src/modules/acc/doc/acc_admin.xml
index 69be72fe2e6..37a1365627e 100644
--- a/src/modules/acc/doc/acc_admin.xml
+++ b/src/modules/acc/doc/acc_admin.xml
@@ -1156,7 +1156,7 @@ modparam("acc", "cdr_facility", "LOG_DAEMON")
cdr_extra example

 ...
-modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)"
+modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)")
 ...
 


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


[sr-dev] Maintenance work overnight on kamailio.org server

2024-04-15 Thread Daniel-Constantin Mierla via sr-dev
Hello,

there is some planned work on the data center infrastructure hosting
kamailio.org server that is going to affect briefly the web server (web
site, wiki) and the mailing lists.

The downtime is expected to be 10-15 minutes around 1:00am Western
Europe time (CEST / GMT+2), but if it takes longer or repeats, be
patient for a while.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, April 18-19, 2024, Berlin -- kamailioworld.com

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


[sr-dev] git:master:39ca2874: Makefile.defs: version set to 5.9.0-dev1

2024-04-14 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 39ca28748162e940bd91bf4e0cb0b1223b5f9138
URL: 
https://github.com/kamailio/kamailio/commit/39ca28748162e940bd91bf4e0cb0b1223b5f9138

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-15T07:19:31+02:00

Makefile.defs: version set to 5.9.0-dev1

---

Modified: src/Makefile.defs

---

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

---

diff --git a/src/Makefile.defs b/src/Makefile.defs
index 4165ca084fb..9feece65535 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -107,7 +107,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 VERSION = 5
 PATCHLEVEL = 9
 SUBLEVEL =  0
-EXTRAVERSION = -dev0
+EXTRAVERSION = -dev1
 
 # memory manager switcher
 # 0 - f_malloc (fast malloc)

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


[sr-dev] git:master:29a890ff: htable: add ew (end-with) operator for delete items functions

2024-04-14 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 29a890ffdcd394d26d53bd0951c7ca58262c7696
URL: 
https://github.com/kamailio/kamailio/commit/29a890ffdcd394d26d53bd0951c7ca58262c7696

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-14T15:29:57+02:00

htable: add ew (end-with) operator for delete items functions

---

Modified: src/modules/htable/ht_api.c
Modified: src/modules/htable/ht_api.h
Modified: src/modules/htable/ht_dmq.h
Modified: src/modules/htable/htable.c

---

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

---

diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 2391cb5c5d0..afda3dc6c54 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -1033,7 +1033,7 @@ int ht_table_spec(char *spec)
 
coldelim = tok.s[0];
LM_DBG("htable [%.*s] - coldelim [%c]\n", name.len, 
name.s,
-  coldelim);
+   coldelim);
} else if(pit->name.len == 7
  && strncmp(pit->name.s, "colnull", 7) == 0) {
if(tok.len > 1)
@@ -1045,8 +1045,7 @@ int ht_table_spec(char *spec)
colnull = tok.s[0];
}
 
-   LM_DBG("htable [%.*s] - colnull [%c]\n", name.len, 
name.s,
-   colnull);
+   LM_DBG("htable [%.*s] - colnull [%c]\n", name.len, 
name.s, colnull);
} else {
goto error;
}
@@ -1383,7 +1382,15 @@ int ht_rm_cell_op(str *sre, ht_t *ht, int mode, int op)
&& strncmp(it->name.s, 
sre->s, sre->len) == 0) {
match = 1;
}
+   } else if(op == HT_RM_OP_EW) {
+   if(sre->len <= it->name.len
+   && strncmp(it->name.s + 
it->name.len - sre->len,
+  
sre->s, sre->len)
+  == 
0) {
+   match = 1;
+   }
}
+
} else {
if(op == HT_RM_OP_SW) {
if(it->flags & AVP_VAL_STR) {
@@ -1393,6 +1400,16 @@ int ht_rm_cell_op(str *sre, ht_t *ht, int mode, int op)
match = 1;
}
}
+   } else if(op == HT_RM_OP_EW) {
+   if(it->flags & AVP_VAL_STR) {
+   if(sre->len <= it->value.s.len
+   && 
strncmp(it->value.s.s + it->value.s.len
+   
   - sre->len,
+   
   sre->s, sre->len)
+   
   == 0) {
+   match = 1;
+   }
+   }
}
}
if(match == 1) {
diff --git a/src/modules/htable/ht_api.h b/src/modules/htable/ht_api.h
index e24a93b1f17..7c7642ef5df 100644
--- a/src/modules/htable/ht_api.h
+++ b/src/modules/htable/ht_api.h
@@ -124,6 +124,7 @@ int ht_reset_content(ht_t *ht);
 #define HT_RM_OP_EQ 1
 #define HT_RM_OP_NE 2
 #define HT_RM_OP_SW 3
+#define HT_RM_OP_EW 3
 #define HT_RM_OP_RE 4
 int ht_rm_cell_op(str *sre, ht_t *ht, int mode, int op);
 int ht_match_cell_op_str(str *sre, ht_t *ht, int mode, int op);
diff --git a/src/modules/htable/ht_dmq.h b/src/modules/htable/ht_dmq.h
index bc5f18830be..7577e445a76 100644
--- a/src/modules/htable/ht_dmq.h
+++ b/src/modules/htable/ht_dmq.h
@@ -39,7 +39,8 @@ typedef enum
HT_DMQ_SET_CELL_EXPIRE,
HT_DMQ_DEL_CELL,
HT_DMQ_RM_CELL_RE,
-   HT_DMQ_RM_CELL_SW
+   HT_DMQ_RM_CELL_SW,
+   HT_DMQ_RM_CELL_EW
 } ht_dmq_action_t;
 
 int ht_dmq_initialize();
diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable

[sr-dev] git:master:bb093505: htable: docs for sw operator for functions removing items

2024-04-14 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: bb093505c5c5f625339f85961518f9db3fd6725d
URL: 
https://github.com/kamailio/kamailio/commit/bb093505c5c5f625339f85961518f9db3fd6725d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-14T15:41:31+02:00

htable: docs for sw operator for functions removing items

---

Modified: src/modules/htable/doc/htable_admin.xml

---

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

---

diff --git a/src/modules/htable/doc/htable_admin.xml 
b/src/modules/htable/doc/htable_admin.xml
index 69ad5e64581..c5cc20e22ed 100644
--- a/src/modules/htable/doc/htable_admin.xml
+++ b/src/modules/htable/doc/htable_admin.xml
@@ -910,6 +910,12 @@ sht_rm_value_re("ha=>.*");
with'.


+   
+   
+   ew - match the val parameter as 
'ends
+   with'.
+   
+   


All parameters can be static strings or contain 
variables.
@@ -950,6 +956,12 @@ sht_rm_name("ha", "re", ".*");
with'.


+   
+   
+   ew - match the val parameter as 
'ends
+   with'.
+   
+   


All parameters can be static strings or contain 
variables.

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


[sr-dev] git:master:671b874a: nghttp2: clear response headers on event route

2024-04-13 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 671b874a31fb10c6c9e9a246358928f202fc669d
URL: 
https://github.com/kamailio/kamailio/commit/671b874a31fb10c6c9e9a246358928f202fc669d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-13T21:24:54+02:00

nghttp2: clear response headers on event route

---

Modified: src/modules/nghttp2/nghttp2_mod.c

---

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

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


[sr-dev] git:master:a368140d: nghttp2: fix typo in filed type

2024-04-13 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: a368140d8d32a68ccc21845aad95e43c98a802d7
URL: 
https://github.com/kamailio/kamailio/commit/a368140d8d32a68ccc21845aad95e43c98a802d7

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-13T08:58:20+02:00

nghttp2: fix typo in filed type

---

Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index 8b343fd11ce..ac69a147313 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -79,7 +79,7 @@ typedef struct http2_stream_data
char *request_path;
char *request_pathfull;
char *request_method;
-   ttp2_msghdr_t *hdrlist;
+   http2_msghdr_t *hdrlist;
int32_t stream_id;
int fd;
 } http2_stream_data;

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


[sr-dev] git:master:a8481f58: nghttp2: debug message instead of error on peer disconnect

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: a8481f588d5461285e512a0b68803ffc0f41d7b3
URL: 
https://github.com/kamailio/kamailio/commit/a8481f588d5461285e512a0b68803ffc0f41d7b3

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: debug message instead of error on peer disconnect

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index d5153bef0c6..d8c23220a13 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -221,7 +221,7 @@ static void delete_http2_session_data(http2_session_data 
*session_data)
 {
http2_stream_data *stream_data;
SSL *ssl = bufferevent_openssl_get_ssl(session_data->bev);
-   LM_ERR("%s disconnected\n", session_data->client_addr);
+   LM_DBG("remote peer %s disconnected\n", session_data->client_addr);
if(ssl) {
SSL_shutdown(ssl);
}

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


[sr-dev] git:master:11c5ed67: nghttp2: debug with data content

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 11c5ed679193c4cc94957c0a5948e07bfbfcfee9
URL: 
https://github.com/kamailio/kamailio/commit/11c5ed679193c4cc94957c0a5948e07bfbfcfee9

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: debug with data content

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 8c17f847f87..d5153bef0c6 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -560,6 +560,27 @@ static int on_frame_recv_callback(
return 0;
 }
 
+/*
+ * The implementation of nghttp2_on_data_chunk_recv_callback type.
+ * - function to get the received body.
+ */
+static int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
+   int32_t stream_id, const uint8_t *data, size_t len, void 
*user_data)
+{
+   struct Request *req;
+   (void)flags;
+   (void)user_data;
+
+   req = nghttp2_session_get_stream_user_data(session, stream_id);
+   if(req) {
+   LM_DBG(" (DATA chunk) [%lu 
bytes]\n",
+   (unsigned long int)len);
+   LM_DBG("[[%.*s]]", (int)len, (char *)data);
+   LM_DBG("\n");
+   }
+   return 0;
+}
+
 static int on_stream_close_callback(nghttp2_session *session, int32_t 
stream_id,
uint32_t error_code, void *user_data)
 {
@@ -587,6 +608,9 @@ static void initialize_nghttp2_session(http2_session_data 
*session_data)
nghttp2_session_callbacks_set_on_frame_recv_callback(
callbacks, on_frame_recv_callback);
 
+   nghttp2_session_callbacks_set_on_data_chunk_recv_callback(
+   callbacks, on_data_chunk_recv_callback);
+
nghttp2_session_callbacks_set_on_stream_close_callback(
callbacks, on_stream_close_callback);
 

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


[sr-dev] git:master:702e9cdb: nghttp2: structure to hold headers in stream data

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce
URL: 
https://github.com/kamailio/kamailio/commit/702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: structure to hold headers in stream data

---

Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index cad3772d9ef..8b343fd11ce 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -66,12 +66,20 @@
 struct app_context;
 typedef struct app_context app_context;
 
+typedef struct http2_msghdr
+{
+   str name;
+   str value;
+   struct http2_msghdr *next;
+} http2_msghdr_t;
+
 typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
char *request_pathfull;
char *request_method;
+   ttp2_msghdr_t *hdrlist;
int32_t stream_id;
int fd;
 } http2_stream_data;

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


[sr-dev] git:master:2b8d5877: nghttp2: added $nghttp2(pathfull) - full http path with all params

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 2b8d587713d96fbee31534b9b16f2c2b432e2e68
URL: 
https://github.com/kamailio/kamailio/commit/2b8d587713d96fbee31534b9b16f2c2b432e2e68

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: added $nghttp2(pathfull) - full http path with all params

---

Modified: src/modules/nghttp2/nghttp2_mod.c
Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_mod.c 
b/src/modules/nghttp2/nghttp2_mod.c
index 95918b1e6c8..c3e05e50b05 100644
--- a/src/modules/nghttp2/nghttp2_mod.c
+++ b/src/modules/nghttp2/nghttp2_mod.c
@@ -218,6 +218,14 @@ int pv_parse_nghttp2_name(pv_spec_p sp, str *in)
goto error;
}
break;
+   case 8:
+   if(strncasecmp(in->s, "pathfull", 8) == 0) {
+   sp->pvp.pvn.u.isname.name.n = 6;
+   } else {
+   goto error;
+   }
+   break;
+
default:
if(in->len > 2 && in->s[1] == ':'
&& (in->s[0] == 'h' || in->s[0] == 
'H')) {
@@ -275,6 +283,9 @@ int pv_get_nghttp2(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.srcip);
}
return pv_get_null(msg, param, res);
+   case 6: /* pathfull */
+   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.pathfull);
+
default:
return pv_get_null(msg, param, res);
}
diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index dec339d7a15..8c17f847f87 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -179,7 +179,12 @@ static void delete_http2_stream_data(http2_stream_data 
*stream_data)
close(stream_data->fd);
}
free(stream_data->request_path);
-   free(stream_data->request_method);
+   if(stream_data->request_pathfull) {
+   free(stream_data->request_pathfull);
+   }
+   if(stream_data->request_method) {
+   free(stream_data->request_method);
+   }
free(stream_data);
 }
 
@@ -460,6 +465,7 @@ static int on_header_callback(nghttp2_session *session,
for(j = 0; j < valuelen && value[j] != '?'; ++j)
;
stream_data->request_path = 
percent_decode(value, j);
+   stream_data->request_pathfull = 
percent_decode(value, valuelen);
} else if(namelen == sizeof(METHOD) - 1
  && memcmp(METHOD, name, namelen) == 
0) {
if(stream_data->request_method) {
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index 34e6155abfc..cad3772d9ef 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -70,6 +70,7 @@ typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
+   char *request_pathfull;
char *request_method;
int32_t stream_id;
int fd;
@@ -100,6 +101,7 @@ typedef struct ksr_nghttp2_ctx
int rplhdrs_n;
str method;
str path;
+   str pathfull;
str httpversion;
str data;
char srcipbuf[IP_ADDR_MAX_STR_SIZE];

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


[sr-dev] Re: [kamailio/kamailio] tcp/docs: Added tcp_accept_iplimit config sample (PR #3792)

2024-04-11 Thread Daniel-Constantin Mierla via sr-dev
Fine for me to add it to the default config file `etc/kamailio.cfg`, but the 
commit message should be updated to reflect that, not the prefix `tcp/docs:` is 
not suggesting at all it is about `etc/kamailio.cfg`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3792#issuecomment-2049694470
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] pike: fix documentation for reqs_density_per_unit (PR #3806)

2024-04-11 Thread Daniel-Constantin Mierla via sr-dev
Then I guess this can be closed without merging, right?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3806#issuecomment-2049691316
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] cfgutils lock (PR #3808)

2024-04-11 Thread Daniel-Constantin Mierla via sr-dev
I have nothing explicitly against this enhancement, but I guess that if one 
wanted to have two strings to compose the lock key,  then could use 
`lock("$var(str1)$var(str2)")` as alternative to new variant 
`lock("$var(str1)", "$var(str2)")`. The hashing behind is probably not the same 
result, but from the perspective of taking in consideration two strings for 
hashing, should be a similar behaviour.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3808#issuecomment-2049690308
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] core/tcp_main: Match protocol when lookup tcp/tls connections (PR #3810)

2024-04-11 Thread Daniel-Constantin Mierla via sr-dev
It can be merged from my point of view, although I am not the main developer of 
tcp/tls code in Kamailio, I guess it was considered that remote ip/port is 
enough, considering that tls is over a tcp connection, so it cannot overlap, 
but when listening on different sockets, it could be a conflict.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3810#issuecomment-2049680678
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:7fb51562: nghttp2: $nghttp2(url) replaced with $nghttp2(path)

2024-04-10 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 7fb51562233c8b94a4bb38e4bcb8c7529937ed9e
URL: 
https://github.com/kamailio/kamailio/commit/7fb51562233c8b94a4bb38e4bcb8c7529937ed9e

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-10T07:31:18+02:00

nghttp2: $nghttp2(url) replaced with $nghttp2(path)

- match corresponding http2 header name

---

Modified: src/modules/nghttp2/nghttp2_mod.c
Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_mod.c 
b/src/modules/nghttp2/nghttp2_mod.c
index de7a13485bf..95918b1e6c8 100644
--- a/src/modules/nghttp2/nghttp2_mod.c
+++ b/src/modules/nghttp2/nghttp2_mod.c
@@ -186,15 +186,10 @@ int pv_parse_nghttp2_name(pv_spec_p sp, str *in)
if(sp == NULL || in == NULL || in->len <= 0)
return -1;
switch(in->len) {
-   case 3:
-   if(strncasecmp(in->s, "url", 3) == 0) {
-   sp->pvp.pvn.u.isname.name.n = 0;
-   } else {
-   goto error;
-   }
-   break;
case 4:
-   if(strncasecmp(in->s, "data", 4) == 0) {
+   if(strncasecmp(in->s, "path", 4) == 0) {
+   sp->pvp.pvn.u.isname.name.n = 0;
+   } else if(strncasecmp(in->s, "data", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 1;
} else if(strncasecmp(in->s, "size", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 2;
@@ -264,8 +259,8 @@ int pv_get_nghttp2(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
 
switch(param->pvn.u.isname.name.n) {
-   case 0: /* url */
-   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.url);
+   case 0: /* path */
+   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.path);
case 1: /* data */
return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.data);
case 2: /* size */
diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 46b4e003462..38ae3673d46 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -494,8 +494,8 @@ static int on_request_recv(nghttp2_session *session,
_ksr_nghttp2_ctx.session_data = session_data;
_ksr_nghttp2_ctx.stream_data = stream_data;
 
-   _ksr_nghttp2_ctx.url.s = stream_data->request_path;
-   _ksr_nghttp2_ctx.url.len = strlen(_ksr_nghttp2_ctx.url.s);
+   _ksr_nghttp2_ctx.path.s = stream_data->request_path;
+   _ksr_nghttp2_ctx.path.len = strlen(_ksr_nghttp2_ctx.path.s);
 
_ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
_ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index dc1f5f148c6..bb5e446631c 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -98,7 +98,7 @@ typedef struct ksr_nghttp2_ctx
nghttp2_nv rplhdrs_v[KSR_NGHTTP2_RPLHDRS_SIZE];
int rplhdrs_n;
str method;
-   str url;
+   str path;
str httpversion;
str data;
char srcipbuf[IP_ADDR_MAX_STR_SIZE];

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


[sr-dev] git:master:9a43631e: nghttp2: store method in stream data

2024-04-10 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 9a43631e1707490c0781f9d2d10055663ebcde44
URL: 
https://github.com/kamailio/kamailio/commit/9a43631e1707490c0781f9d2d10055663ebcde44

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-10T08:07:30+02:00

nghttp2: store method in stream data

---

Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 38ae3673d46..dec339d7a15 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -179,6 +179,7 @@ static void delete_http2_stream_data(http2_stream_data 
*stream_data)
close(stream_data->fd);
}
free(stream_data->request_path);
+   free(stream_data->request_method);
free(stream_data);
 }
 
@@ -436,6 +437,7 @@ static int on_header_callback(nghttp2_session *session,
 {
http2_stream_data *stream_data;
const char PATH[] = ":path";
+   const char METHOD[] = ":method";
(void)flags;
(void)user_data;
 
@@ -446,15 +448,25 @@ static int on_header_callback(nghttp2_session *session,
}
stream_data = nghttp2_session_get_stream_user_data(
session, frame->hd.stream_id);
-   if(!stream_data || stream_data->request_path) {
+   if(!stream_data) {
break;
}
if(namelen == sizeof(PATH) - 1
&& memcmp(PATH, name, namelen) == 0) {
size_t j;
+   if(stream_data->request_path) {
+   break;
+   }
for(j = 0; j < valuelen && value[j] != '?'; ++j)
;
stream_data->request_path = 
percent_decode(value, j);
+   } else if(namelen == sizeof(METHOD) - 1
+ && memcmp(METHOD, name, namelen) == 
0) {
+   if(stream_data->request_method) {
+   break;
+   }
+   stream_data->request_method =
+   strndup((const char *)value, 
valuelen);
}
break;
}
@@ -497,8 +509,15 @@ static int on_request_recv(nghttp2_session *session,
_ksr_nghttp2_ctx.path.s = stream_data->request_path;
_ksr_nghttp2_ctx.path.len = strlen(_ksr_nghttp2_ctx.path.s);
 
-   _ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
-   _ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
+   if(stream_data->request_method) {
+   _ksr_nghttp2_ctx.method.s = stream_data->request_method;
+   _ksr_nghttp2_ctx.method.len = strlen(_ksr_nghttp2_ctx.method.s);
+   }
+
+   if(session_data->client_addr) {
+   _ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
+   _ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
+   }
 
ksr_event_route();
 
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index bb5e446631c..34e6155abfc 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -70,6 +70,7 @@ typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
+   char *request_method;
int32_t stream_id;
int fd;
 } http2_stream_data;

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


[sr-dev] git:master:2da9ed93: Makefile.groups: added group for nghttp2 module

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 2da9ed9395ef04f889f4594753fc5f4cf7a75b29
URL: 
https://github.com/kamailio/kamailio/commit/2da9ed9395ef04f889f4594753fc5f4cf7a75b29

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T19:28:25+02:00

Makefile.groups: added group for nghttp2 module

---

Modified: src/Makefile.groups

---

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

---

diff --git a/src/Makefile.groups b/src/Makefile.groups
index fec21d47bdd..ee514014be2 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -235,6 +235,9 @@ mod_list_ruxc=ruxc
 # - modules depending on microhttpd library
 mod_list_microhttpd=microhttpd
 
+# - modules depending on nghttp2 library
+mod_list_nghttp2=nghttp2
+
 # - modules depending on libgcrypt library
 mod_list_gcrypt=gcrypt
 
@@ -288,6 +291,7 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \
   $(mod_list_tlsa) \
   $(mod_list_tls_wolfssl) \
   $(mod_list_microhttpd) \
+  $(mod_list_nghttp2) \
   $(mod_list_gcrypt) \
   $(mod_list_rtp_media_server)
 
@@ -542,6 +546,9 @@ module_group_kruxc=$(mod_list_ruxc)
 # K microhttpd module
 module_group_kmicrohttpd=$(mod_list_microhttpd)
 
+# K nghttp2 module
+module_group_knghttp2=$(mod_list_nghttp2)
+
 # K gcrypt module
 module_group_kgcrypt=$(mod_list_gcrypt)
 

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


[sr-dev] git:master:3439eb44: nghttp2: docs for nghttp2_reply_header(...) function

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 3439eb44087b044cb9caaaf8af8df155d6a42bba
URL: 
https://github.com/kamailio/kamailio/commit/3439eb44087b044cb9caaaf8af8df155d6a42bba

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T19:15:32+02:00

nghttp2: docs for nghttp2_reply_header(...) function

---

Modified: src/modules/nghttp2/doc/nghttp2_admin.xml

---

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

---

diff --git a/src/modules/nghttp2/doc/nghttp2_admin.xml 
b/src/modules/nghttp2/doc/nghttp2_admin.xml
index 4589bc145fe..54cde446de6 100644
--- a/src/modules/nghttp2/doc/nghttp2_admin.xml
+++ b/src/modules/nghttp2/doc/nghttp2_admin.xml
@@ -129,17 +129,39 @@ end
Functions


-   nghttp2_reply(code, reason, ctype, 
body)
+   nghttp2_reply(code, body)


-   Send back a reply with content-type and body.
+   Send back a reply with body. The body can be empty string. Both 
parameters
+   can contain variables.


nghttp2_reply usage

 ...
 event_route[nghttp2:request] {
-nghttp2_reply("200", "OK", "text/html",
+nghttp2_reply("200",
+"htmlbodyOK/body/html");
+}
+...
+
+   
+   
+   
+   
+   nghttp2_reply_header(name, 
value)
+   
+   
+   Set a header to be added to reply. There can be up to 15 
headers.
+   
+   
+   nghttp2_reply usage
+   
+...
+event_route[nghttp2:request] {
+nghttp2_reply_header("Content-Type", "text/html");
+nghttp2_reply_header("My-Header", "xyz");
+nghttp2_reply("200",
 "htmlbodyOK/body/html");
 }
 ...

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


[sr-dev] git:master:ec847027: nghttp2: separate function for setting response headers

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: ec847027effacb0f7003a3b12ff33017e10dc0c1
URL: 
https://github.com/kamailio/kamailio/commit/ec847027effacb0f7003a3b12ff33017e10dc0c1

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T19:10:57+02:00

nghttp2: separate function for setting response headers

---

Modified: src/modules/nghttp2/nghttp2_mod.c
Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

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


[sr-dev] git:master:f3a5fb51: nghttp2: convert to debug messages

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f3a5fb519d1e6a6670e44175332dc7889f8fb99e
URL: 
https://github.com/kamailio/kamailio/commit/f3a5fb519d1e6a6670e44175332dc7889f8fb99e

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T17:21:40+02:00

nghttp2: convert to debug messages

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 075ff6e0b23..bdbec4a8c58 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -240,7 +240,7 @@ static void delete_http2_session_data(http2_session_data 
*session_data)
 {
http2_stream_data *stream_data;
SSL *ssl = bufferevent_openssl_get_ssl(session_data->bev);
-   fprintf(stderr, "%s disconnected\n", session_data->client_addr);
+   LM_ERR("%s disconnected\n", session_data->client_addr);
if(ssl) {
SSL_shutdown(ssl);
}
@@ -517,8 +517,7 @@ static int on_request_recv(nghttp2_session *session,
}
return 0;
}
-   fprintf(stderr, "%s GET %s\n", session_data->client_addr,
-   stream_data->request_path);
+   LM_DBG("%s GET %s\n", session_data->client_addr, 
stream_data->request_path);
if(!check_path(stream_data->request_path)) {
if(error_reply(session, stream_data) != 0) {
return NGHTTP2_ERR_CALLBACK_FAILURE;
@@ -676,7 +675,7 @@ static void eventcb(struct bufferevent *bev, short events, 
void *ptr)
SSL *ssl;
(void)bev;
 
-   fprintf(stderr, "%s connected\n", session_data->client_addr);
+   LM_DBG("%s connected\n", session_data->client_addr);
 
ssl = bufferevent_openssl_get_ssl(session_data->bev);
 
@@ -690,8 +689,7 @@ static void eventcb(struct bufferevent *bev, short events, 
void *ptr)
 #endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */
 
if(alpn == NULL || alpnlen != 2 || memcmp("h2", alpn, 2) != 0) {
-   fprintf(stderr, "%s h2 is not negotiated\n",
-   session_data->client_addr);
+   LM_DBG("%s h2 is not negotiated\n", 
session_data->client_addr);
delete_http2_session_data(session_data);
return;
}
@@ -707,11 +705,11 @@ static void eventcb(struct bufferevent *bev, short 
events, void *ptr)
return;
}
if(events & BEV_EVENT_EOF) {
-   fprintf(stderr, "%s EOF\n", session_data->client_addr);
+   LM_DBG("%s EOF\n", session_data->client_addr);
} else if(events & BEV_EVENT_ERROR) {
-   fprintf(stderr, "%s network error\n", 
session_data->client_addr);
+   LM_DBG("%s network error\n", session_data->client_addr);
} else if(events & BEV_EVENT_TIMEOUT) {
-   fprintf(stderr, "%s timeout\n", session_data->client_addr);
+   LM_DBG("%s timeout\n", session_data->client_addr);
}
delete_http2_session_data(session_data);
 }

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


[sr-dev] git:master:20fd1c44: nghttpd2: docs - update required libnghttp2 version

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T17:18:05+02:00

nghttpd2: docs - update required libnghttp2 version

---

Modified: src/modules/nghttp2/doc/nghttp2_admin.xml

---

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

---

diff --git a/src/modules/nghttp2/doc/nghttp2_admin.xml 
b/src/modules/nghttp2/doc/nghttp2_admin.xml
index 80465a7a49c..4589bc145fe 100644
--- a/src/modules/nghttp2/doc/nghttp2_admin.xml
+++ b/src/modules/nghttp2/doc/nghttp2_admin.xml
@@ -43,7 +43,7 @@



-   libnghttp2 - libnghttpd 
library (v1.61.0+)
+   libnghttp2 - libnghttpd 
library (v1.43.0+)




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


[sr-dev] git:master:740b73e6: nghttp2: Makefile - link with additional libraries

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 740b73e6dd174f2946e29cfc00c2a72063fd6645
URL: 
https://github.com/kamailio/kamailio/commit/740b73e6dd174f2946e29cfc00c2a72063fd6645

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T17:10:47+02:00

nghttp2: Makefile - link with additional libraries

---

Modified: src/modules/nghttp2/Makefile

---

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

---

diff --git a/src/modules/nghttp2/Makefile b/src/modules/nghttp2/Makefile
index d6b2dd84674..f71ba0c3556 100644
--- a/src/modules/nghttp2/Makefile
+++ b/src/modules/nghttp2/Makefile
@@ -38,7 +38,55 @@ else
LEVENTLIBS = $(shell $(LEVENT_BUILDER) --libs)
 endif
 
-DEFS+=$(LNGHTTP2DEFS) $(LEVENTDEFS)
-LIBS=$(LNGHTTP2LIBS) $(LEVENTLIBS)
+
+ifeq ($(CROSS_COMPILE),)
+LEVENTSSL_BUILDER = $(shell \
+   if pkg-config --exists libevent_openssl; then \
+   echo 'pkg-config libevent_openssl'; \
+   fi)
+endif
+
+ifeq ($(LEVENTSSL_BUILDER),)
+   LEVENTSSLDEFS=-I$(LOCALBASE)/include -I$(SYSBASE)/include
+   LEVENTSSLLIBS=-L$(LOCALBASE)/lib -levent_openssl
+else
+   LEVENTSSLDEFS = $(shell $(LEVENTSSL_BUILDER) --cflags)
+   LEVENTSSLLIBS = $(shell $(LEVENTSSL_BUILDER) --libs)
+endif
+
+
+ifeq ($(CROSS_COMPILE),)
+LSSL_BUILDER=$(shell \
+   if pkg-config --exists libssl; then \
+   echo 'pkg-config libssl'; \
+   fi)
+LCRYPTO_BUILDER=$(shell \
+   if pkg-config --exists libcrypto; then \
+   echo 'pkg-config libcrypto'; \
+   fi)
+endif
+
+ifneq ($(LSSL_BUILDER),)
+   LSSLDEFS = $(shell $(LSSL_BUILDER) --cflags)
+   LSSLLIBS = $(shell $(LSSL_BUILDER) --libs)
+
+ifneq ($(CRYPTO_BUILDER),)
+   LCRYPTODEFS = $(shell $(LCRYPTO_BUILDER) --cflags)
+   LCRYPTOLIBS = $(shell $(LCRYPTO_BUILDER) --libs)
+endif
+
+else
+   LSSLDEFS = -I$(LOCALBASE)/ssl/include
+   LSSLLIBS = -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
+   -L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
+   -lssl -lcrypto
+   LCRYPTODEFS =
+   LCRYPTOLIBS =
+endif
+
+
+
+DEFS+=$(LNGHTTP2DEFS) $(LEVENTDEFS) $(LEVENTSSLDEFS) $(LSSLDEFS) $(LCRYPTODEFS)
+LIBS=$(LNGHTTP2LIBS) $(LEVENTLIBS) $(LEVENTSSLLIBS) $(LSSLLIBS) $(LCRYPTOLIBS)
 
 include ../../Makefile.modules

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


[sr-dev] git:master:6333db8f: nghttp2: compatibility with older libnghttp2 versions

2024-04-09 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 6333db8fb19bd8684476914b3fe4d3ebda36940a
URL: 
https://github.com/kamailio/kamailio/commit/6333db8fb19bd8684476914b3fe4d3ebda36940a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-09T17:10:47+02:00

nghttp2: compatibility with older libnghttp2 versions

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

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

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


[sr-dev] git:master:d55cd7e6: http_client: docs for http_client_response_headers_clear()

2024-04-08 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: d55cd7e613c787ce0dd91abad036d4ecd7556023
URL: 
https://github.com/kamailio/kamailio/commit/d55cd7e613c787ce0dd91abad036d4ecd7556023

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-08T17:03:19+02:00

http_client: docs for http_client_response_headers_clear()

---

Modified: src/modules/http_client/doc/http_client_admin.xml

---

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

---

diff --git a/src/modules/http_client/doc/http_client_admin.xml 
b/src/modules/http_client/doc/http_client_admin.xml
index 0a8f147eb0e..e81d912c11e 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -1047,6 +1047,26 @@ http_client_response_headers_set("1");
 http_client_request_v2pk("GET", 
"http://api.com/index.php?r_uri=$(ru{s.escape.param})f_uri=$(fu{s.escape.param})",
   "", "X-Token: abc", "$var(result)");
 xinfo("response header: $httprhdr(X-Header)\n");
+...
+   
+   
+   
+   
+   
+   http_client_response_headers_clear()
+   
+   
+   Clear stored response headers, if not 
explicitely done, it happens
+   when the next HTTP request is performed.
+   
+   
+   
http_client_response_headers_clear() usage
+   
+...
+http_client_request_v2pk("GET", 
"http://api.com/index.php?r_uri=$(ru{s.escape.param})f_uri=$(fu{s.escape.param})",
+  "", "X-Token: abc", "$var(result)");
+xinfo("response header: $httprhdr(X-Header)\n");
+http_client_response_headers_clear();
 ...



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


[sr-dev] git:master:cdf0633b: http_client: added http_client_response_headers_clear()

2024-04-08 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: cdf0633b6b51bbfb7eb785715358c88aeb4c6a40
URL: 
https://github.com/kamailio/kamailio/commit/cdf0633b6b51bbfb7eb785715358c88aeb4c6a40

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-08T14:14:58+02:00

http_client: added http_client_response_headers_clear()

- clear response headers
- if not explicitely done, it happens when next http request is
  performed

---

Modified: src/modules/http_client/http_client.c

---

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

---

diff --git a/src/modules/http_client/http_client.c 
b/src/modules/http_client/http_client.c
index c8af2f64901..27310829d0e 100644
--- a/src/modules/http_client/http_client.c
+++ b/src/modules/http_client/http_client.c
@@ -160,6 +160,8 @@ static int w_http_query_request_v2pk(struct sip_msg *_m, 
char *_met, char *_url,
char *_body, char *_hdrs, char *_result);
 static int w_http_client_response_headers_set(
sip_msg_t *_m, char *_pval, char *_p2);
+static int w_http_client_response_headers_clear(
+   sip_msg_t *_m, char *_p1, char *_p2);
 
 /* forward function */
 static int curl_con_param(modparam_t type, void *val);
@@ -205,6 +207,9 @@ static cmd_export_t cmds[] = {
{"http_client_response_headers_set",
(cmd_function)w_http_client_response_headers_set, 1, 
fixup_igp_null,
fixup_free_igp_null, ANY_ROUTE},
+   {"http_client_response_headers_clear",
+   (cmd_function)w_http_client_response_headers_clear, 1, 0,
+   0, ANY_ROUTE},
{"bind_http_client",  (cmd_function)bind_httpc_api,  0, 0, 0, 0},
{0,0,0,0,0,0}
 };
@@ -1184,6 +1189,16 @@ static int w_http_client_response_headers_set(
return ki_http_client_response_headers_set(_m, ival);
 }
 
+/*!
+ *
+ */
+static int w_http_client_response_headers_clear(
+   sip_msg_t *_m, char *_pval, char *_p2)
+{
+   http_client_response_headers_reset();
+   return 1;
+}
+
 /*!
  * Parse arguments to  pv $curlerror
  */

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


[sr-dev] git:master:5ba76f65: nghttp2: new module for supporting direct http2 connections

2024-04-08 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 5ba76f65f5c2ea522a2e6629bd845918258a80cf
URL: 
https://github.com/kamailio/kamailio/commit/5ba76f65f5c2ea522a2e6629bd845918258a80cf

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-08T21:25:11+02:00

nghttp2: new module for supporting direct http2 connections

- initial import version

---

Added: src/modules/nghttp2/Makefile
Added: src/modules/nghttp2/README
Added: src/modules/nghttp2/doc/Makefile
Added: src/modules/nghttp2/doc/nghttp2.xml
Added: src/modules/nghttp2/doc/nghttp2_admin.xml
Added: src/modules/nghttp2/nghttp2_mod.c
Added: src/modules/nghttp2/nghttp2_server.c
Added: src/modules/nghttp2/nghttp2_server.h

---

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

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


[sr-dev] Re: [kamailio/kamailio] pike: fix documentation for reqs_density_per_unit (PR #3806)

2024-04-08 Thread Daniel-Constantin Mierla via sr-dev
Probably the code has to be checked, it used to be some warming up based on ip 
address prefix (no longer sure, but something in the direction of: for x.y.z.w, 
first keep x, then x.y, then x.y.z and then block the traffic), but the it was 
the merge with SER modules and not sure what ended up to be. Also, maybe it 
block immediately if it is in the same subnetwork, source code should be 
authoritative here and should be checked before merging.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3806#issuecomment-2042548893
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:b3562c6b: http_client: docs for http_client_response_headers_set()

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: b3562c6b10accec829a15c25fd56e53c8c89a87e
URL: 
https://github.com/kamailio/kamailio/commit/b3562c6b10accec829a15c25fd56e53c8c89a87e

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T15:50:33+02:00

http_client: docs for http_client_response_headers_set()

---

Modified: src/modules/http_client/doc/http_client_admin.xml

---

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

---

diff --git a/src/modules/http_client/doc/http_client_admin.xml 
b/src/modules/http_client/doc/http_client_admin.xml
index 6424582074c..0a8f147eb0e 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -1026,6 +1026,27 @@ http_client_request_v2pk("GET", 
"http://api.com/index.php?r_uri=$(ru{s.escape.pa
 switch ($rc) {
 ...
 }
+...
+   
+   
+   
+   
+   
+   http_client_response_headers_set(mode)
+   
+   
+   Set if the HTTP response header should be 
stored (when mode is 1)
+   or not (when mode is 0). If mode is 0, then it 
also clears previously
+   stored response headers.
+   
+   
+   
http_client_response_headers_set() usage
+   
+...
+http_client_response_headers_set("1");
+http_client_request_v2pk("GET", 
"http://api.com/index.php?r_uri=$(ru{s.escape.param})f_uri=$(fu{s.escape.param})",
+  "", "X-Token: abc", "$var(result)");
+xinfo("response header: $httprhdr(X-Header)\n");
 ...



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


[sr-dev] git:master:fdb9c938: http_client: docs for $httprhdr(name)

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: fdb9c938639b3fea29b8c1ba6e6e412a5da8a7f3
URL: 
https://github.com/kamailio/kamailio/commit/fdb9c938639b3fea29b8c1ba6e6e412a5da8a7f3

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T10:27:11+02:00

http_client: docs for $httprhdr(name)

---

Modified: src/modules/http_client/doc/http_client_admin.xml

---

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

---

diff --git a/src/modules/http_client/doc/http_client_admin.xml 
b/src/modules/http_client/doc/http_client_admin.xml
index f5eb42f7b91..6424582074c 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -716,7 +716,8 @@ modparam("http_client", "netinterface", "eth0")

response_headers (int)

-   Set to 1 in order to store HTTP response headers.
+   Set to 1 in order to store HTTP response headers. A 
header value
+   can be retrieved with $httprhdr(name).



@@ -1031,7 +1032,7 @@ switch ($rc) {



-   Pseudovariables
+   Pseudo-Variables


$curlerror(error)
@@ -1044,6 +1045,15 @@ switch ($rc) {
http://curl.haxx.se/libcurl/c/libcurl-errors.html


+   
+   
+   $httprhdr(name)
+   
+   
+   Return response header value. It requires 
response_headers parameter
+   to be set to 1.
+   
+   


RPC Commands

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


[sr-dev] git:master:00198b8d: http_client: added http_client_response_headers_set(mode)

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 00198b8d863a94ea593b7473c88c35e6cad67014
URL: 
https://github.com/kamailio/kamailio/commit/00198b8d863a94ea593b7473c88c35e6cad67014

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T10:41:22+02:00

http_client: added http_client_response_headers_set(mode)

- control if http response header should be set or not

---

Modified: src/modules/http_client/http_client.c

---

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

---

diff --git a/src/modules/http_client/http_client.c 
b/src/modules/http_client/http_client.c
index 4bea581d50f..c8af2f64901 100644
--- a/src/modules/http_client/http_client.c
+++ b/src/modules/http_client/http_client.c
@@ -158,6 +158,8 @@ static int w_http_query_request(struct sip_msg *_m, char 
*_met, char *_url,
char *_body, char *_hdrs, char *_result);
 static int w_http_query_request_v2pk(struct sip_msg *_m, char *_met, char 
*_url,
char *_body, char *_hdrs, char *_result);
+static int w_http_client_response_headers_set(
+   sip_msg_t *_m, char *_pval, char *_p2);
 
 /* forward function */
 static int curl_con_param(modparam_t type, void *val);
@@ -200,6 +202,9 @@ static cmd_export_t cmds[] = {
{"http_get_redirect", (cmd_function)w_curl_get_redirect, 2, 
fixup_curl_get_redirect,
fixup_free_curl_get_redirect,
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE},
+   {"http_client_response_headers_set",
+   (cmd_function)w_http_client_response_headers_set, 1, 
fixup_igp_null,
+   fixup_free_igp_null, ANY_ROUTE},
{"bind_http_client",  (cmd_function)bind_httpc_api,  0, 0, 0, 0},
{0,0,0,0,0,0}
 };
@@ -1149,6 +1154,36 @@ static int w_http_query_request(sip_msg_t *_m, char 
*_met, char *_url,
return ki_http_request_helper(_m, , , , , 0, dst);
 }
 
+/*!
+ *
+ */
+static int ki_http_client_response_headers_set(sip_msg_t *_m, int ival)
+{
+   if(ival == 0) {
+   http_client_response_headers_reset();
+   http_client_response_headers_param = 0;
+   } else {
+   http_client_response_headers_param = 1;
+   }
+
+   return 1;
+}
+
+/*!
+ *
+ */
+static int w_http_client_response_headers_set(
+   sip_msg_t *_m, char *_pval, char *_p2)
+{
+   int ival = 0;
+
+   if(fixup_get_ivalue(_m, (gparam_t *)_pval, ) < 0) {
+   LM_ERR("failed to get parameter value\n");
+   return -1;
+   }
+   return ki_http_client_response_headers_set(_m, ival);
+}
+
 /*!
  * Parse arguments to  pv $curlerror
  */

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


[sr-dev] git:master:90d78b7b: http_clinet: added variable $httprhdr(name) - get response header value

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 90d78b7b2bfc1899c1b64c2db8a353d43df68218
URL: 
https://github.com/kamailio/kamailio/commit/90d78b7b2bfc1899c1b64c2db8a353d43df68218

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T10:15:41+02:00

http_clinet: added variable $httprhdr(name) - get response header value

---

Modified: src/modules/http_client/functions.c
Modified: src/modules/http_client/functions.h
Modified: src/modules/http_client/http_client.c

---

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

---

diff --git a/src/modules/http_client/functions.c 
b/src/modules/http_client/functions.c
index e910b514bbf..0004eb3ddc1 100644
--- a/src/modules/http_client/functions.c
+++ b/src/modules/http_client/functions.c
@@ -39,6 +39,7 @@
 #include "../../core/pvar.h"
 #include "../../core/route_struct.h"
 #include "../../core/ut.h"
+#include "../../core/trim.h"
 #include "../../core/mem/mem.h"
 #include "../../core/parser/msg_parser.h"
 
@@ -127,6 +128,46 @@ void http_client_response_headers_reset(void)
_http_client_response_headers = NULL;
 }
 
+/**
+ *
+ */
+int http_client_response_headers_get(str *hname, str *hbody)
+{
+   httpc_hdr_t *it;
+   char *p;
+
+   if(_http_client_response_headers == NULL) {
+   return -1;
+   }
+   if(hname == NULL || hname->len <= 0 || hbody == NULL) {
+   return -1;
+   }
+   for(it = _http_client_response_headers; it != NULL; it = it->next) {
+   if(it->name.len == 0 && it->hbuf.s[0] != ' ' && it->hbuf.s[0] 
!= '\t'
+   && it->hbuf.s[0] != '\r' && it->hbuf.s[0] != 
'\n') {
+   /* parsing */
+   p = strchr(it->hbuf.s, ':');
+   if(p == NULL) {
+   continue;
+   }
+   it->name.s = it->hbuf.s;
+   it->name.len = p - it->name.s;
+   trim(>name);
+   p++;
+   it->body.s = p;
+   it->body.len = it->hbuf.s + it->hbuf.len - it->body.s;
+   trim(>body);
+   }
+   if(it->name.len == hname->len
+   && strncasecmp(it->name.s, hname->s, 
hname->len) == 0) {
+   hbody->s = it->body.s;
+   hbody->len = it->body.len;
+   return 0;
+   }
+   }
+   return -1;
+}
+
 /*
  * curl write function that saves received data as zero terminated
  * to stream. Returns the amount of data taken care of.
diff --git a/src/modules/http_client/functions.h 
b/src/modules/http_client/functions.h
index d0c66c64e66..30c326bd0f8 100644
--- a/src/modules/http_client/functions.h
+++ b/src/modules/http_client/functions.h
@@ -78,4 +78,7 @@ int http_client_request_c(sip_msg_t *_m, char *_url, str 
*_dst, char *_body,
 
 char *http_get_content_type(const str *connection);
 
+int http_client_response_headers_get(str *hname, str *hbody);
+void http_client_response_headers_reset(void);
+
 #endif /* CURL_FUNCTIONS_H */
diff --git a/src/modules/http_client/http_client.c 
b/src/modules/http_client/http_client.c
index d640d772ad3..4bea581d50f 100644
--- a/src/modules/http_client/http_client.c
+++ b/src/modules/http_client/http_client.c
@@ -164,6 +164,8 @@ static int curl_con_param(modparam_t type, void *val);
 static int pv_parse_curlerror(pv_spec_p sp, str *in);
 static int pv_get_curlerror(
struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
+static int pv_parse_httprhdr(pv_spec_p sp, str *in);
+static int pv_get_httprhdr(sip_msg_t *msg, pv_param_t *param, pv_value_t *res);
 
 /* clang-format off */
 /* Exported functions */
@@ -237,6 +239,8 @@ static param_export_t params[] = {
 static pv_export_t mod_pvs[] = {
{{"curlerror", (sizeof("curlerror")-1)}, /* Curl error codes */
PVT_OTHER, pv_get_curlerror, 0, pv_parse_curlerror, 0, 0, 0},
+   {{"httprhdr", (sizeof("httprhdr")-1)}, /* HTTP response header */
+   PVT_OTHER, pv_get_httprhdr, 0, pv_parse_httprhdr, 0, 0, 0},
 
{{0, 0}, 0, 0, 0, 0, 0, 0, 0}
 };
@@ -1193,6 +1197,35 @@ static int pv_get_curlerror(
return pv_get_strval(msg, param, res, );
 }
 
+/**
+ *
+ */
+static int pv_parse_httprhdr(pv_spec_p sp, str *in)
+{
+   if(sp == NULL || in == NULL || in->len <= 0)
+   return -1;
+
+   sp->pvp.pvn.type = PV_NAME_INTSTR;
+   sp->pvp.pvn.u.isname.type = AVP_VAL_STR;
+

[sr-dev] git:master:f7e0a189: http_client: docs for modparam response_headers

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f7e0a189362cc9f5ab8962868496c4b49b72a76c
URL: 
https://github.com/kamailio/kamailio/commit/f7e0a189362cc9f5ab8962868496c4b49b72a76c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T09:33:04+02:00

http_client: docs for modparam response_headers

---

Modified: src/modules/http_client/doc/http_client_admin.xml

---

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

---

diff --git a/src/modules/http_client/doc/http_client_admin.xml 
b/src/modules/http_client/doc/http_client_admin.xml
index 2fb918d5997..f5eb42f7b91 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -709,6 +709,25 @@ http_follow_redirect = no

 ...
 modparam("http_client", "netinterface", "eth0")
+...
+   
+   
+   
+   
+   response_headers (int)
+   
+   Set to 1 in order to store HTTP response headers.
+   
+   
+   
+   Default value is 0.
+   
+   
+   
+   Set response_headers 
parameter
+   
+...
+modparam("http_client", "response_headers", 1)
 ...



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


[sr-dev] git:master:8f364976: http_client: option to store http response headers

2024-04-07 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 8f364976a81358de39cb5d675b3703f3f65a0d59
URL: 
https://github.com/kamailio/kamailio/commit/8f364976a81358de39cb5d675b3703f3f65a0d59

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-07T09:20:33+02:00

http_client: option to store http response headers

- new modparam response_headers has to be set to 1

---

Modified: src/modules/http_client/functions.c
Modified: src/modules/http_client/http_client.c
Modified: src/modules/http_client/http_client.h

---

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

---

diff --git a/src/modules/http_client/functions.c 
b/src/modules/http_client/functions.c
index df6b8233b51..e910b514bbf 100644
--- a/src/modules/http_client/functions.c
+++ b/src/modules/http_client/functions.c
@@ -75,6 +75,58 @@ typedef struct
 } curl_query_t;
 
 
+/**
+ *
+ */
+typedef struct httpc_hdr
+{
+   str hbuf;
+   str name;
+   str body;
+   struct httpc_hdr *next;
+} httpc_hdr_t;
+
+/**
+ *
+ */
+httpc_hdr_t *_http_client_response_headers = NULL;
+
+/**
+ *
+ */
+httpc_hdr_t *httpc_hdr_block_add(httpc_hdr_t **head, char *s, int len)
+{
+   httpc_hdr_t *nv;
+   nv = pkg_mallocxz(sizeof(httpc_hdr_t) + (len + 1) * sizeof(char));
+   if(!nv) {
+   PKG_MEM_ERROR;
+   return 0;
+   }
+   nv->hbuf.s = (char *)nv + sizeof(httpc_hdr_t);
+   memcpy(nv->hbuf.s, s, len);
+   nv->hbuf.len = len;
+   nv->next = *head;
+   *head = nv;
+
+   return nv;
+}
+
+/**
+ *
+ */
+void http_client_response_headers_reset(void)
+{
+   httpc_hdr_t *it0;
+   httpc_hdr_t *it1;
+   it0 = _http_client_response_headers;
+   while(it0 != NULL) {
+   it1 = it0->next;
+   pkg_free(it0);
+   it0 = it1;
+   }
+   _http_client_response_headers = NULL;
+}
+
 /*
  * curl write function that saves received data as zero terminated
  * to stream. Returns the amount of data taken care of.
@@ -112,6 +164,20 @@ size_t write_function(void *ptr, size_t size, size_t 
nmemb, void *stream_ptr)
 }
 
 
+size_t http_client_response_header_cb(
+   char *b, size_t size, size_t nitems, void *userdata)
+{
+   size_t numbytes;
+
+   numbytes = size * nitems;
+   LM_DBG("http response header [%.*s]\n", (int)numbytes, b);
+
+   httpc_hdr_block_add(&_http_client_response_headers, b, (int)numbytes);
+
+   return numbytes;
+   ;
+}
+
 /*! Send query to server, optionally post data.
  */
 static int curL_request_url(struct sip_msg *_m, const char *_met,
@@ -288,6 +354,12 @@ static int curL_request_url(struct sip_msg *_m, const char 
*_met,
res |= curl_easy_setopt(curl, CURLOPT_INTERFACE, 
params->netinterface);
}
 
+   if(http_client_response_headers_param != 0) {
+   http_client_response_headers_reset();
+   res |= curl_easy_setopt(
+   curl, CURLOPT_HEADERFUNCTION, 
http_client_response_header_cb);
+   }
+
res |= curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_function);
res |= curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)());
 
diff --git a/src/modules/http_client/http_client.c 
b/src/modules/http_client/http_client.c
index 91573425990..d640d772ad3 100644
--- a/src/modules/http_client/http_client.c
+++ b/src/modules/http_client/http_client.c
@@ -117,6 +117,8 @@ unsigned int default_query_result = 1;
 /*!< Default download size for result of query function. 0=disabled (no limit) 
*/
 unsigned int default_query_maxdatasize = 0;
 
+int http_client_response_headers_param = 0;
+
 str http_client_config_file = STR_NULL;
 
 static curl_version_info_data *curl_info;
@@ -224,6 +226,7 @@ static param_export_t params[] = {
{"query_result", PARAM_INT, _query_result },
{"query_maxdatasize", PARAM_INT, _query_maxdatasize },
{"netinterface", PARAM_STRING,  _netinterface },
+   {"response_headers", PARAM_INT, _client_response_headers_param },
{0, 0, 0}
 };
 
diff --git a/src/modules/http_client/http_client.h 
b/src/modules/http_client/http_client.h
index c56f411df1f..42ee1e914f8 100644
--- a/src/modules/http_client/http_client.h
+++ b/src/modules/http_client/http_client.h
@@ -75,6 +75,8 @@ extern counter_handle_t connfail;  /* Failed Connection 
attempts */
 
 extern char *default_netinterface;
 
+extern int http_client_response_headers_param; /* store http response headers 
*/
+
 /* Curl  stream object  */
 typedef struct
 {

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


[sr-dev] git:master:9b3b8ec9: corex: docs for dns_file parameter

2024-04-06 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 9b3b8ec968c6f7bda0d10a0d4fe593a92560ee7d
URL: 
https://github.com/kamailio/kamailio/commit/9b3b8ec968c6f7bda0d10a0d4fe593a92560ee7d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-06T08:35:19+02:00

corex: docs for dns_file parameter

---

Modified: src/modules/corex/doc/corex_admin.xml

---

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

---

diff --git a/src/modules/corex/doc/corex_admin.xml 
b/src/modules/corex/doc/corex_admin.xml
index d5cfe1db477..3cdad0aa2a5 100644
--- a/src/modules/corex/doc/corex_admin.xml
+++ b/src/modules/corex/doc/corex_admin.xml
@@ -162,6 +162,41 @@ modparam("corex", "alias_subdomains", 
"udp:sip-router.org:5060")
 modparam("corex", "dns_cache", 
"type=A;name=kamailio.org;addr=193.22.119.66;ttl=360;flags=0")
 modparam("corex", "dns_cache", 
"type=;name=kamailio.org;addr=2a00:d60:0:400::2;ttl=360;flags=0")
 ...
+
+   
+   
+   
+   dns_file (string)
+   
+   Path to the file from where to load dns_cache records. It can 
be set
+   many times to add more than one file.
+   
+   
+   Inside the file, the dns_cache record has to be in a single line, 
with
+   the format of the dns_cache module parameter (see above). Empty 
lines
+   or lines with whitespaces only are ignored. Comment lines have to 
start
+   with '#'. Comments are not accepted after dns_cache records, only on
+   separate lines.
+   
+   
+   
+   Default value is NULL.
+   
+   
+   
+   Set dns_file parameter
+   
+...
+# content of /etc/kamailio/kamailio-cache.dns
+
+# IPv4 record
+type=A;name=kamailio.org;addr=193.22.119.66;ttl=360;flags=0
+# IPv6 record
+type=;name=kamailio.org;addr=2a00:d60:0:400::2;ttl=360;flags=0
+...
+...
+modparam("corex", "dns_file", "/etc/kamailio/kamailio-cache.dns")
+...
 


@@ -1291,4 +1326,3 @@ sub do_uncompress() {
 
 
 
-

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


[sr-dev] git:master:c8cf642c: corex: added dns_file modparam

2024-04-06 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: c8cf642c21169bcaee82347db858d8f3bcb6a42c
URL: 
https://github.com/kamailio/kamailio/commit/c8cf642c21169bcaee82347db858d8f3bcb6a42c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-06T08:19:19+02:00

corex: added dns_file modparam

- can be set to the path of a file containing dns_cache records
- each line has to contain a dns_cache-param-formatted record
- empty lines are allowed
- comment line has to start with #, comments can be only on separate
  line, not supported after dns_cache record

---

Modified: src/modules/corex/corex_mod.c

---

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

---

diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index 4152fbf5df4..6739e4cee16 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -32,6 +32,7 @@
 #include "../../core/fmsg.h"
 #include "../../core/kemi.h"
 #include "../../core/str_list.h"
+#include "../../core/trim.h"
 #include "../../core/events.h"
 #include "../../core/onsend.h"
 #include "../../core/forward.h"
@@ -82,12 +83,15 @@ static int corex_evrt_reply_out_no = -1;
 
 int corex_alias_subdomains_param(modparam_t type, void *val);
 int corex_dns_cache_param(modparam_t type, void *val);
+int corex_dns_file_param(modparam_t type, void *val);
+int corex_dns_file_load(void);
 
 static int mod_init(void);
 static int child_init(int);
 static void mod_destroy(void);
 
 static str_list_t *corex_dns_cache_list = NULL;
+static str_list_t *corex_dns_file_list = NULL;
 
 static int corex_dns_cache_param_add(str *pval);
 
@@ -176,6 +180,8 @@ static param_export_t params[] = {
(void *)corex_alias_subdomains_param},
{"dns_cache", PARAM_STR | USE_FUNC_PARAM,
(void *)corex_dns_cache_param},
+   {"dns_file", PARAM_STR | USE_FUNC_PARAM,
+   (void *)corex_dns_file_param},
{"nio_intercept", INT_PARAM, _intercept},
{"nio_min_msg_len", INT_PARAM, _min_msg_len},
{"nio_msg_avp", PARAM_STR, _msg_avp_param},
@@ -226,6 +232,9 @@ static int mod_init(void)
return -1;
}
}
+   if(corex_dns_file_load() < 0) {
+   return -1;
+   }
 
if((nio_intercept > 0) && (nio_intercept_init() < 0)) {
LM_ERR("failed to register network io intercept callback\n");
@@ -385,6 +394,67 @@ int corex_dns_cache_param(modparam_t type, void *val)
return 0;
 }
 
+int corex_dns_file_param(modparam_t type, void *val)
+{
+   str_list_t *sit;
+
+   if(val == NULL || ((str *)val)->s == NULL || ((str *)val)->len == 0) {
+   LM_ERR("invalid parameter\n");
+   return -1;
+   }
+
+   sit = (str_list_t *)pkg_mallocxz(sizeof(str_list_t));
+   if(sit == NULL) {
+   PKG_MEM_ERROR;
+   return -1;
+   }
+   sit->s = *((str *)val);
+   if(corex_dns_file_list != NULL) {
+   sit->next = corex_dns_file_list;
+   }
+   corex_dns_file_list = sit;
+
+   return 0;
+}
+
+int corex_dns_file_load(void)
+{
+   str_list_t *sit;
+   str sline;
+   char lbuf[512];
+   FILE *FP;
+
+   for(sit = corex_dns_file_list; sit != NULL; sit = sit->next) {
+   FP = fopen(sit->s.s, "r");
+   if(FP == NULL) {
+   LM_ERR("failed to open file '%.*s'\n", sit->s.len, 
sit->s.s);
+   return -1;
+   }
+   while(fgets(lbuf, 512, FP)) {
+   sline.s = lbuf;
+   sline.len = strlen(sline.s);
+   trim();
+   if(sline.len <= 0) {
+   /* empty line */
+   continue;
+   }
+   if(sline.s[0] == '#') {
+   /* comment */
+   continue;
+   }
+   if(corex_dns_cache_param_add() < 0) {
+   LM_ERR("failed to add record: '%.*s' (%.*s)\n", 
sline.len,
+   sline.s, sit->s.len, sit->s.s);
+   fclose(FP);
+   return -1;
+   }
+   }
+   fclose(FP);
+   }
+
+   return 0;
+}
+
 static int corex_dns_cache_param_add(str *pval)
 {
str sval;

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


[sr-dev] git:master:92d3573b: ims_ipsec_pcscf: log error message made info

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 92d3573b500374d100639484e5a84cb640dc6b1d
URL: 
https://github.com/kamailio/kamailio/commit/92d3573b500374d100639484e5a84cb640dc6b1d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T21:42:12+02:00

ims_ipsec_pcscf: log error message made info

---

Modified: src/modules/ims_ipsec_pcscf/cmd.c

---

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

---

diff --git a/src/modules/ims_ipsec_pcscf/cmd.c 
b/src/modules/ims_ipsec_pcscf/cmd.c
index 4f7301b56c1..b5a598b44ba 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -1126,7 +1126,8 @@ 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)) {
+   } 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);
@@ -1143,7 +1144,7 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int 
_cflags)
memcpy(m->dst_uri.s, buf, buf_len);
m->dst_uri.len = buf_len;
m->dst_uri.s[m->dst_uri.len] = '\0';
-   LM_ERR("new destination URI: %.*s\n", m->dst_uri.len, 
m->dst_uri.s);
+   LM_INFO("new destination URI: %.*s\n", m->dst_uri.len, 
m->dst_uri.s);
}
 
// Set send socket

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


[sr-dev] git:master:d1118064: siputils: tel2sip2() - memset to 0 pkg allocs and recompute len of new uri

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: d1118064d04bb77c818540e68edf1766db1d560a
URL: 
https://github.com/kamailio/kamailio/commit/d1118064d04bb77c818540e68edf1766db1d560a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T16:19:42+02:00

siputils: tel2sip2() - memset to 0 pkg allocs and recompute len of new uri

---

Modified: src/modules/siputils/checks.c

---

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

---

diff --git a/src/modules/siputils/checks.c b/src/modules/siputils/checks.c
index 2ba80b5be94..6cc977197fb 100644
--- a/src/modules/siputils/checks.c
+++ b/src/modules/siputils/checks.c
@@ -780,7 +780,7 @@ int tel2sip2(struct sip_msg *_msg, char *_uri, char 
*_hostpart, char *_res)
return 1;
 
/* reserve memory for clean tel uri */
-   tel_uri.s = pkg_malloc(uri.len + 1);
+   tel_uri.s = pkg_mallocxz(uri.len + 1);
if(tel_uri.s == 0) {
LM_ERR("no more pkg memory\n");
return -1;
@@ -839,7 +839,7 @@ int tel2sip2(struct sip_msg *_msg, char *_uri, char 
*_hostpart, char *_res)
 
/* reserve memory for resulting sip uri */
sip_uri.len = 4 + tel_uri.len - 4 + 1 + hostpart.len + 1 + 10;
-   sip_uri.s = pkg_malloc(sip_uri.len + 1);
+   sip_uri.s = pkg_mallocxz(sip_uri.len + 1);
if(sip_uri.s == 0) {
LM_ERR("no more pkg memory\n");
pkg_free(tel_uri.s);
@@ -873,6 +873,8 @@ int tel2sip2(struct sip_msg *_msg, char *_uri, char 
*_hostpart, char *_res)
/* tel_uri is not needed anymore */
pkg_free(tel_uri.s);
 
+   sip_uri.len = strlen(sip_uri.s);
+
/* set result pv value and write sip uri to result pv */
res_val.rs = sip_uri;
res_val.flags = PV_VAL_STR;

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


[sr-dev] git:master:ac22a5c1: textopsx: added msg_changed_route(rname)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: ac22a5c174d4652ae09b779a5384182211700f20
URL: 
https://github.com/kamailio/kamailio/commit/ac22a5c174d4652ae09b779a5384182211700f20

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T13:00:32+02:00

textopsx: added msg_changed_route(rname)

- execute a route block using the changed message, without efectivelly
  changing the current message structure (it stays without changes
  applied)

---

Modified: src/modules/textopsx/textopsx.c

---

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

---

diff --git a/src/modules/textopsx/textopsx.c b/src/modules/textopsx/textopsx.c
index 5710cfeb864..8982924296a 100644
--- a/src/modules/textopsx/textopsx.c
+++ b/src/modules/textopsx/textopsx.c
@@ -46,6 +46,7 @@
 MODULE_VERSION
 
 static int msg_apply_changes_f(sip_msg_t *msg, char *str1, char *str2);
+static int msg_changed_route_f(sip_msg_t *msg, char *str1, char *str2);
 static int msg_set_buffer_f(sip_msg_t *msg, char *p1data, char *p2);
 
 static int change_reply_status_f(sip_msg_t *, char *, char *);
@@ -122,6 +123,8 @@ static pv_export_t mod_pvs[] = {
 static cmd_export_t cmds[] = {
{"msg_apply_changes", (cmd_function)msg_apply_changes_f, 0, 0, 0,
REQUEST_ROUTE | ONREPLY_ROUTE},
+   {"msg_changed_route", (cmd_function)msg_changed_route_f, 1, 
fixup_spve_null,
+   fixup_free_spve_null, ANY_ROUTE},
{"msg_set_buffer", (cmd_function)msg_set_buffer_f, 1, fixup_spve_null,
fixup_free_spve_null, REQUEST_ROUTE | ONREPLY_ROUTE},
{"change_reply_status", change_reply_status_f, 2,
@@ -276,6 +279,92 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, 
char *str2)
return sip_msg_apply_changes(msg);
 }
 
+/**
+ *
+ */
+static int ki_msg_changed_route(sip_msg_t *msg, str *rname)
+{
+   str obuf = STR_NULL;
+   int ridx = -1;
+   sip_msg_t lmsg;
+   sr_kemi_eng_t *keng = NULL;
+   run_act_ctx_t ctx;
+   str evname = str_init("textopsx:msg-changed-route");
+
+   keng = sr_kemi_eng_get();
+   if(keng == NULL) {
+   ridx = route_lookup(_rt, rname->s);
+   if(ridx < 0) {
+   LM_ERR("route block [%.*s] not found\n", rname->len, 
rname->s);
+   return -1;
+   }
+   }
+
+   if(sip_msg_eval_changes(msg, ) < 0 || obuf.s == NULL) {
+   LM_ERR("failed to evaluate msg changes\n");
+   return -1;
+   }
+
+   memset(, 0, sizeof(sip_msg_t));
+   lmsg.buf = obuf.s;
+   lmsg.len = obuf.len;
+   lmsg.id = msg->id;
+   lmsg.pid = msg->pid;
+   lmsg.rcv = msg->rcv;
+   lmsg.set_global_address = msg->set_global_address;
+   lmsg.set_global_port = msg->set_global_port;
+   lmsg.flags = msg->flags;
+   lmsg.msg_flags = msg->msg_flags;
+   memcpy(lmsg.xflags, msg->xflags, KSR_XFLAGS_SIZE * sizeof(flag_t));
+   lmsg.hash_index = msg->hash_index;
+   lmsg.force_send_socket = msg->force_send_socket;
+
+   /* parse the local message */
+   LM_DBG("SIP message content updated - parsing\n");
+   if(parse_msg(lmsg.buf, lmsg.len, ) != 0) {
+   LM_ERR("parsing new sip message failed [[%.*s]]\n", lmsg.len, 
lmsg.buf);
+   return -1;
+   }
+   if(parse_headers(, HDR_FROM_F | HDR_TO_F | HDR_CALLID_F | 
HDR_CSEQ_F, 0)
+   < 0) {
+   LM_ERR("parsing main headers of new sip message failed 
[[%.*s]]\n",
+   lmsg.len, lmsg.buf);
+   return -1;
+   }
+   init_run_actions_ctx();
+
+   if(keng == NULL) {
+   run_top_route(main_rt.rlist[ridx], , );
+   } else {
+   if(sr_kemi_ctx_route(keng, , , get_route_type(),
+  rname, )
+   < 0) {
+   LM_ERR("error running route kemi callback\n");
+   }
+   }
+
+   free_sip_msg();
+
+   pkg_free(obuf.s);
+
+   return 1;
+}
+
+/**
+ *
+ */
+static int msg_changed_route_f(sip_msg_t *msg, char *prname, char *str2)
+{
+   str rname = STR_NULL;
+
+   if(fixup_get_svalue(msg, (gparam_t *)prname, ) < 0) {
+   LM_ERR("could not get route name param value\n");
+   return -1;
+   }
+
+   return ki_msg_changed_route(msg, );
+}
+
 /**
  *
  */

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


[sr-dev] git:master:3208dd82: textopsx: docs for msg_changed_route(...)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 3208dd822f94cff7b28d9682b083f3d144d7368e
URL: 
https://github.com/kamailio/kamailio/commit/3208dd822f94cff7b28d9682b083f3d144d7368e

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T13:00:32+02:00

textopsx: docs for msg_changed_route(...)

---

Modified: src/modules/textopsx/doc/functions.xml

---

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

---

diff --git a/src/modules/textopsx/doc/functions.xml 
b/src/modules/textopsx/doc/functions.xml
index b6b50916051..92666736c86 100644
--- a/src/modules/textopsx/doc/functions.xml
+++ b/src/modules/textopsx/doc/functions.xml
@@ -50,6 +50,33 @@ if(msg_apply_changes())


 
+   
+   
+   msg_changed_route(rname)
+   
+   
+   Execute a route block specified by rname, using a new 
SIP message
+   structure build using the current SIP message with 
applied changes.
+   The current SIP message does not get the changes 
applied.
+   
+   
+   This function can be used from ANY_ROUTE.
+   
+   
+   msg_changed_route() usage
+   
+...
+append_hf("My-Header: yes\r\n");
+msg_changed_route("UPDATEDMSG");
+...
+route[UPDATEDMSG] {
+   xinfo("My-Header-Value: $hdr(My-Header)\n");
+}
+...
+
+   
+   
+


msg_set_buffer(data)

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


[sr-dev] git:master:756f01ee: pv: use core helper to evaluate changes for pv updated message buffer

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 756f01eecec754726c09a7067e11db9781e35ac1
URL: 
https://github.com/kamailio/kamailio/commit/756f01eecec754726c09a7067e11db9781e35ac1

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T13:00:32+02:00

pv: use core helper to evaluate changes for pv updated message buffer

---

Modified: src/modules/pv/pv_core.c

---

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

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 1f998bfc1d3..40557ba4628 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -522,8 +522,6 @@ static str _ksr_pv_msg_buf_updated = STR_NULL;
 int pv_get_msg_buf_updated(
struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 {
-   dest_info_t send_info;
-
if(msg == NULL)
return -1;
 
@@ -533,17 +531,7 @@ int pv_get_msg_buf_updated(
_ksr_pv_msg_buf_updated.len = 0;
}
 
-   init_dest_info(_info);
-   send_info.proto = PROTO_UDP;
-   if(msg->first_line.type == SIP_REPLY) {
-   _ksr_pv_msg_buf_updated.s = generate_res_buf_from_sip_res(msg,
-   (unsigned int *)&_ksr_pv_msg_buf_updated.len,
-   BUILD_NO_VIA1_UPDATE);
-   } else if(msg->first_line.type == SIP_REQUEST) {
-   _ksr_pv_msg_buf_updated.s = build_req_buf_from_sip_req(msg,
-   (unsigned int *)&_ksr_pv_msg_buf_updated.len, 
_info,
-   BUILD_NO_PATH | BUILD_NO_LOCAL_VIA | 
BUILD_NO_VIA1_UPDATE);
-   } else {
+   if(sip_msg_eval_changes(msg, &_ksr_pv_msg_buf_updated) < 0) {
return pv_get_null(msg, param, res);
}
 

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


[sr-dev] git:master:cad94eb7: core: msg translator - helper function to evaluate changes

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: cad94eb73c1223ddcf69aa0d073deb3118b46e3f
URL: 
https://github.com/kamailio/kamailio/commit/cad94eb73c1223ddcf69aa0d073deb3118b46e3f

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T13:00:32+02:00

core: msg translator - helper function to evaluate changes

---

Modified: src/core/msg_translator.c
Modified: src/core/msg_translator.h

---

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

---

diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index acd5911867a..ab02fb7c47c 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -3485,6 +3485,33 @@ int sip_msg_update_buffer(sip_msg_t *msg, str *obuf)
return 1;
 }
 
+/**
+ * evaluate changes and set the output buffer
+ * - obuf->s has to be pkg freed
+ * - return: 1 on success, -1 on failure
+ */
+int sip_msg_eval_changes(sip_msg_t *msg, str *obuf)
+{
+   dest_info_t dst;
+
+   init_dest_info();
+   dst.proto = PROTO_UDP;
+   if(msg->first_line.type == SIP_REPLY) {
+   obuf->s = generate_res_buf_from_sip_res(
+   msg, (unsigned int *)>len, 
BUILD_NO_VIA1_UPDATE);
+   } else {
+   obuf->s = build_req_buf_from_sip_req(msg, (unsigned int 
*)>len,
+   ,
+   BUILD_NO_PATH | BUILD_NO_LOCAL_VIA | 
BUILD_NO_VIA1_UPDATE);
+   }
+   if(obuf->s == NULL) {
+   LM_ERR("couldn't update msg buffer content\n");
+   return -1;
+   }
+
+   return 1;
+}
+
 /**
  *
  */
diff --git a/src/core/msg_translator.h b/src/core/msg_translator.h
index eac64186d56..9d41b472767 100644
--- a/src/core/msg_translator.h
+++ b/src/core/msg_translator.h
@@ -173,6 +173,11 @@ void process_lumps(struct sip_msg *msg, struct lump 
*lumps, char *new_buf,
  */
 int sip_msg_update_buffer(sip_msg_t *msg, str *obuf);
 
+/**
+ * evaluate changes and set the output buffer
+ */
+int sip_msg_eval_changes(sip_msg_t *msg, str *obuf);
+
 /**
  * apply changes to sip msg buffer and reparse
  */

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


[sr-dev] Re: [kamailio/kamailio] DBURL can't read env params (Issue #3800)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Closed #3800 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3800#event-12370611447
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] DBURL can't read env params (Issue #3800)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
@whosgonna gave good answers, if there is anything left to be clarified, the 
discussion should be done via sr-us...@lists.kamailio.org, not being an issue 
in the C code to stay on tracker.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3800#issuecomment-2039310467
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] Topos breaks early dialog transactions on multi-homed kamailio instances using enable_double_rr and versions >= 5.6.5 (Issue #3757)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Thanks for testing and reporting back!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3757#issuecomment-2039303595
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] Topos breaks early dialog transactions on multi-homed kamailio instances using enable_double_rr and versions >= 5.6.5 (Issue #3757)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Closed #3757 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3757#event-12370564620
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:664190b3: rtpengine: added param write_sdp_pv_mode

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 664190b31303b52728f957113d97bd77a7ab4f8d
URL: 
https://github.com/kamailio/kamailio/commit/664190b31303b52728f957113d97bd77a7ab4f8d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T10:55:09+02:00

rtpengine: added param write_sdp_pv_mode

- if set to 1, write the returned sdp in pv and set the body
- default 0, write only in pv (existing behaviour so far)

---

Modified: src/modules/rtpengine/rtpengine.c

---

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

---

diff --git a/src/modules/rtpengine/rtpengine.c 
b/src/modules/rtpengine/rtpengine.c
index 8a2f9f82d89..c51b4742081 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -322,6 +322,7 @@ static int_str setid_avp;
 
 static str write_sdp_pvar_str = {NULL, 0};
 static pv_spec_t *write_sdp_pvar = NULL;
+static int write_sdp_pvar_mode = 0;
 
 static str read_sdp_pvar_str = {NULL, 0};
 static pv_spec_t *read_sdp_pvar = NULL;
@@ -504,6 +505,7 @@ static param_export_t params[] = {
{"force_send_interface", PARAM_STRING, _send_ip_str},
{"rtp_inst_pvar", PARAM_STR, _inst_pv_param},
{"write_sdp_pv", PARAM_STR, _sdp_pvar_str},
+   {"write_sdp_pv_mode", PARAM_INT, _sdp_pvar_mode},
{"read_sdp_pv", PARAM_STR, _sdp_pvar_str},
{"hash_table_tout", INT_PARAM, _table_tout},
{"hash_table_size", INT_PARAM, _table_size},
@@ -4708,9 +4710,11 @@ static int rtpengine_offer_answer(
goto error_free;
}
 
-   pkg_free(newbody.s);
-
-   } else {
+   if(write_sdp_pvar_mode == 0) {
+   pkg_free(newbody.s);
+   }
+   }
+   if(write_sdp_pvar == NULL || write_sdp_pvar_mode != 0) {
if(cl_field.len) {
anchor = del_lump(msg, cl_field.s - msg->buf, 
cl_field.len, 0);
cl_repl.s = pkg_malloc(10);

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


[sr-dev] git:master:8330158b: rtpengine: docs for write_sdp_pv_mode parameter

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 8330158b88815f28326fc5293831c83cebc2e41c
URL: 
https://github.com/kamailio/kamailio/commit/8330158b88815f28326fc5293831c83cebc2e41c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T11:06:53+02:00

rtpengine: docs for write_sdp_pv_mode parameter

---

Modified: src/modules/rtpengine/doc/rtpengine_admin.xml

---

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

---

diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml 
b/src/modules/rtpengine/doc/rtpengine_admin.xml
index 6d79abfaeff..f898aa32979 100644
--- a/src/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/src/modules/rtpengine/doc/rtpengine_admin.xml
@@ -478,6 +478,32 @@ route {


 
+   
+   write_sdp_pv_mode (int)
+   
+   If this parameter is set to 1, the returned SDP is 
written to pv
+   and also set to message body.
+   
+   
+   Default value: 0 (write SDP only to pv).
+   
+   
+   Set write_sdp_pv_mode 
parameter
+
+...
+modparam("rtpengine", "write_sdp_pv", "$avp(sdp)")
+modparam("rtpengine", "write_sdp_pv_mode", 1)
+...
+route {
+   ...
+   rtpengine_manage();
+   xinfo("new sdp: $avp(sdp)\n");
+}
+
+   
+   
+
+

rtp_inst_pvar (string)


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


[sr-dev] Re: [kamailio/kamailio] kamailio tls connection uses too much shared memory (Issue #3803)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
TLS is known to be greedy in memory, depending also on the encryption algorithm 
negotiated. Also, kamailio does many times speed optimisations at the expense 
of some memory (e.g., static buffers or allocated at startup to avoid often 
alloc/dealoc at runtime).

If you think there is room for improvement here, on this particular case, feel 
free to make a PR and if the results are good overall, then it will be merged.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3803#issuecomment-2039134251
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] app_python module still needs Python 2 (Issue #3805)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Use app_python3/s if want python3. For more assistance to compile/use kamailio, 
use the sr-us...@lists.kamailio.org mailing list.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3805#issuecomment-2039128398
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] app_python module still needs Python 2 (Issue #3805)

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Closed #3805 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3805#event-12369134152
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:368661cc: core: parser/sdp - function to find sdp line with start EoL check option

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 368661cc15251af4cbf295d1f5fad5a42d1b647b
URL: 
https://github.com/kamailio/kamailio/commit/368661cc15251af4cbf295d1f5fad5a42d1b647b

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T08:10:11+02:00

core: parser/sdp - function to find sdp line with start EoL check option

---

Modified: src/core/parser/sdp/sdp_helpr_funcs.c
Modified: src/core/parser/sdp/sdp_helpr_funcs.h

---

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

---

diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c 
b/src/core/parser/sdp/sdp_helpr_funcs.c
index d5cb359b40f..a5dffd9c398 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -733,9 +733,10 @@ int extract_sess_version(str *oline, str *sess_version)
 
 /*
  * Auxiliary for some functions.
+ * - smode: if 1, pstart is pointing inside msg body
  * Returns pointer to first character of found line, or NULL if no such line.
  */
-char *find_sdp_line(char *pstart, char *plimit, char linechar)
+char *find_sdp_line_start(char *pstart, char *plimit, char linechar, int smode)
 {
static char linehead[3] = "x=";
char *cp, *cp1;
@@ -749,11 +750,14 @@ char *find_sdp_line(char *pstart, char *plimit, char 
linechar)
if(cp1 == NULL)
return NULL;
/*
-* As it is body, we assume it has previous line and we can
-* lookup previous character.
+* smode==1 means it is msg body, thus it has previous line and 
it can
+* lookup previous character even when cp1==pstart.
 */
-   if(cp1[-1] == '\n' || cp1[-1] == '\r')
-   return cp1;
+   if(cp1 > pstart || smode == 1) {
+   if(cp1[-1] == '\n' || cp1[-1] == '\r') {
+   return cp1;
+   }
+   }
/*
 * Having such data, but not at line beginning.
 * Skip them and reiterate. ser_memmem() will find next
@@ -765,6 +769,14 @@ char *find_sdp_line(char *pstart, char *plimit, char 
linechar)
}
 }
 
+/*
+ * Auxiliary for some functions - expect pstart to point inside SIP message 
body.
+ * Returns pointer to first character of found line, or NULL if no such line.
+ */
+char *find_sdp_line(char *pstart, char *plimit, char linechar)
+{
+   return find_sdp_line_start(pstart, plimit, linechar, 1);
+}
 
 /* This function assumes pstart points to a line of requested type. */
 char *find_next_sdp_line(
diff --git a/src/core/parser/sdp/sdp_helpr_funcs.h 
b/src/core/parser/sdp/sdp_helpr_funcs.h
index e8ce6f7e60a..20d3ebd882d 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.h
+++ b/src/core/parser/sdp/sdp_helpr_funcs.h
@@ -65,6 +65,7 @@ int extract_accept_wrapped_types(str *body, str 
*accept_wrapped_types);
 int extract_max_size(str *body, str *max_size);
 int extract_path(str *body, str *path);
 
+char *find_sdp_line_start(char *pstart, char *plimit, char linechar, int 
smode);
 char *find_sdp_line(char *p, char *plimit, char linechar);
 char *find_next_sdp_line(char *p, char *plimit, char linechar, char *defptr);
 

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


[sr-dev] git:master:b03ec735: core: parser/sdp - rename parameter to suggest better its role

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: b03ec73589c12e566b11ce2c653401daa915c805
URL: 
https://github.com/kamailio/kamailio/commit/b03ec73589c12e566b11ce2c653401daa915c805

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T07:54:12+02:00

core: parser/sdp - rename parameter to suggest better its role

---

Modified: src/core/parser/sdp/sdp_helpr_funcs.c

---

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

---

diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c 
b/src/core/parser/sdp/sdp_helpr_funcs.c
index b15ddeaa4bd..d5cb359b40f 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -735,14 +735,13 @@ int extract_sess_version(str *oline, str *sess_version)
  * Auxiliary for some functions.
  * Returns pointer to first character of found line, or NULL if no such line.
  */
-
-char *find_sdp_line(char *p, char *plimit, char linechar)
+char *find_sdp_line(char *pstart, char *plimit, char linechar)
 {
static char linehead[3] = "x=";
char *cp, *cp1;
linehead[0] = linechar;
/* Iterate through body */
-   cp = p;
+   cp = pstart;
for(;;) {
if(cp >= plimit)
return NULL;
@@ -767,13 +766,14 @@ char *find_sdp_line(char *p, char *plimit, char linechar)
 }
 
 
-/* This function assumes p points to a line of requested type. */
-char *find_next_sdp_line(char *p, char *plimit, char linechar, char *defptr)
+/* This function assumes pstart points to a line of requested type. */
+char *find_next_sdp_line(
+   char *pstart, char *plimit, char linechar, char *defptr)
 {
char *t;
-   if(p >= plimit || plimit - p < 3)
+   if(pstart >= plimit || plimit - pstart < 3)
return defptr;
-   t = find_sdp_line(p + 2, plimit, linechar);
+   t = find_sdp_line(pstart + 2, plimit, linechar);
return t ? t : defptr;
 }
 

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


[sr-dev] git:master:30f620ae: sdpops: use find_sdp_line_start() to find start of attribute line

2024-04-05 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 30f620ae2254888c0d8d7edc375cb312e33de124
URL: 
https://github.com/kamailio/kamailio/commit/30f620ae2254888c0d8d7edc375cb312e33de124

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-05T08:23:29+02:00

sdpops: use find_sdp_line_start() to find start of attribute line

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 30de5dfc543..f40062420a7 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2059,6 +2059,9 @@ int bind_sdpops(struct sdpops_binds *sob)
return 0;
 }
 
+/**
+ *
+ */
 int sdpops_attr_val(str *payload, str *attr, str *val)
 {
char *sline;
@@ -2066,16 +2069,9 @@ int sdpops_attr_val(str *payload, str *attr, str *val)
 
val->s = NULL;
val->len = 0;
-   sline = find_sdp_line(payload->s, payload->s + payload->len, 
attr->s[0]);
+   sline = find_sdp_line_start(
+   payload->s, payload->s + payload->len, attr->s[0], 0);
while(sline != NULL) {
-   /* check start of line */
-   if(sline > payload->s) {
-   if(eline[-1] != '\n' && eline[-1] != '\r') {
-   sline = find_next_sdp_line(
-   sline, payload->s + 
payload->len, attr->s[0], NULL);
-   continue;
-   }
-   }
/* find EoL or EoData */
eline = sline;
while(eline < payload->s + payload->len) {

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


[sr-dev] git:master:c4b81393: sdpops: function to parse path for sdp content

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T16:29:05+02:00

sdpops: function to parse path for sdp content

---

Added: src/modules/sdpops/sdpops_path.c
Added: src/modules/sdpops/sdpops_path.h

---

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

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


[sr-dev] git:master:359a442e: sdpops: reformat the codecs map

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 359a442e14a156b0bcf60dc5b2580cbc57924e34
URL: 
https://github.com/kamailio/kamailio/commit/359a442e14a156b0bcf60dc5b2580cbc57924e34

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T16:29:05+02:00

sdpops: reformat the codecs map

---

Modified: src/modules/sdpops/sdpops_data.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_data.c b/src/modules/sdpops/sdpops_data.c
index 25d7de178ed..c158511b60e 100644
--- a/src/modules/sdpops/sdpops_data.c
+++ b/src/modules/sdpops/sdpops_data.c
@@ -91,19 +91,29 @@ Registration Procedures: Standards Action Process or expert 
approval
 
 */
 
-typedef struct _codecsmap
-{
+/* clang-format off */
+typedef struct _codecsmap {
str name;
str ids;
 } codecsmap_t;
 
-codecsmap_t sdpops_codecsmap_table[] = {{{"PCMU", 4}, {"0", 1}},
-   {{"GSM", 3}, {"3", 1}}, {{"G723", 4}, {"4", 1}},
-   {{"DVI4", 4}, {"5,6,16,17", 9}}, {{"LPC", 3}, {"7", 1}},
-   {{"PCMA", 4}, {"8", 1}}, {{"G722", 4}, {"9", 1}},
-   {{"L16", 3}, {"10,11", 5}}, {{"QCELP", 5}, {"12", 2}},
-   {{"CN", 2}, {"13", 5}}, {{"MPA", 3}, {"14", 2}},
-   {{"G728", 4}, {"15", 2}}, {{"G729", 4}, {"18", 2}}, {{0, 0}, 
{0, 0}}};
+codecsmap_t sdpops_codecsmap_table[] = {
+   {{"PCMU", 4}, {"0", 1}},
+   {{"GSM", 3}, {"3", 1}},
+   {{"G723", 4}, {"4", 1}},
+   {{"DVI4", 4}, {"5,6,16,17", 9}},
+   {{"LPC", 3}, {"7", 1}},
+   {{"PCMA", 4}, {"8", 1}},
+   {{"G722", 4}, {"9", 1}},
+   {{"L16", 3}, {"10,11", 5}},
+   {{"QCELP", 5}, {"12", 2}},
+   {{"CN", 2}, {"13", 5}},
+   {{"MPA", 3}, {"14", 2}},
+   {{"G728", 4}, {"15", 2}},
+   {{"G729", 4}, {"18", 2}},
+   {{0, 0}, {0, 0}}
+};
+/* clang-format on */
 
 /**
  * set the string with the IDs mapped to codec name

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


[sr-dev] Re: [kamailio/kamailio] core: dprint - include time in stderr json log (PR #3795)

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Merged #3795 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3795#event-12356481214
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:c3e8860f: core: dprint - include time in stderr json log

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

Author: Alexander Bakker 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T13:21:54+02:00

core: dprint - include time in stderr json log

This patch introduces a new "time" field for JSON logging to stderr. The
CEE format already includes this field, but the Kamailio-specific format
doesn't. If you need timestamps in your structured logs, but don't want
to use the CEE format due to its limitations, this patch'd give you the
best of both worlds.

---

Modified: src/core/dprint.c

---

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

---

diff --git a/src/core/dprint.c b/src/core/dprint.c
index 724d3445370..83d1e30f3ca 100644
--- a/src/core/dprint.c
+++ b/src/core/dprint.c
@@ -573,31 +573,31 @@ static int _ksr_slog_json_flags = 0;
".callid\": \"%.*s\"%s%s%.*s%s," \
" \"%smessage\": %s%.*s%s }%s"
 
-#define KSR_SLOG_STDERR_JSON_FMT \
-   "{ \"idx\": %d, \"pid\": %d, \"level\": \"%s\"," \
-   " \"module\": \"%s\", \"file\": \"%s\"," \
-   " \"line\": %d, \"function\": \"%s\"%.*s%s%s%.*s%s, \"%smessage\": " \
+#define KSR_SLOG_STDERR_JSON_FMT  \
+   "{ \"time\": \"%s.%09luZ\", \"idx\": %d, \"pid\": %d, \"level\": 
\"%s\"," \
+   " \"module\": \"%s\", \"file\": \"%s\","
  \
+   " \"line\": %d, \"function\": \"%s\"%.*s%s%s%.*s%s, \"%smessage\": "
  \
"%s%.*s%s }%s"
 
-#define KSR_SLOG_STDERR_JSON_CFMT   \
-   "{ \"idx\": %d, \"pid\": %d, \"level\": \"%s\","
\
-   " \"module\": \"%s\", \"file\": \"%s\","
\
-   " \"line\": %d, \"function\": \"%s\", \"callid\": \"%.*s\"%s%s%.*s%s, " 
\
+#define KSR_SLOG_STDERR_JSON_CFMT \
+   "{ \"time\": \"%s.%09luZ\", \"idx\": %d, \"pid\": %d, \"level\": 
\"%s\"," \
+   " \"module\": \"%s\", \"file\": \"%s\","
  \
+   " \"line\": %d, \"function\": \"%s\", \"callid\": \"%.*s\"%s%s%.*s%s, " 
  \
"\"%smessage\": %s%.*s%s }%s"
 
-#define KSR_SLOG_STDERR_JSON_PFMT  \
-   "{ \"" NAME ".idx\": %d, \"" NAME ".pid\": %d, \"" NAME\
-   ".level\": \"%s\","\
-   " \"" NAME ".module\": \"%s\", \"" NAME ".file\": \"%s\"," \
-   " \"" NAME ".line\": %d, \"" NAME  \
+#define KSR_SLOG_STDERR_JSON_PFMT   \
+   "{ \"" NAME ".time\": \"%s.%09luZ\", \"" NAME ".idx\": %d, \"" NAME \
+   ".pid\": %d, \"" NAME ".level\": \"%s\","   \
+   " \"" NAME ".module\": \"%s\", \"" NAME ".file\": \"%s\","  \
+   " \"" NAME ".line\": %d, \"" NAME   \
".function\": \"%s\"%.*s\"%s%s%.*s%s, \"%smessage\": %s%.*s%s }%s"
 
-#define KSR_SLOG_STDERR_JSON_CPFMT   \
-   "{ \"" NAME ".idx\": %d, \"" NAME ".pid\": %d, \"" NAME  \
-   ".level\": \"%s\","  \
-   " \"" NAME ".module\": \"%s\", \"" NAME ".file\": \"%s\","  

[sr-dev] Re: [kamailio/kamailio] xhttp_prom: export pkg mem statistics (PR #3793)

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Merged #3793 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3793#event-12356211255
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:24d77c23: xhttp_prom: export pkg stats

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 24d77c23e1c0a528289d611c16916caeb9992008
URL: 
https://github.com/kamailio/kamailio/commit/24d77c23e1c0a528289d611c16916caeb9992008

Author: Ovidiu Sas 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T13:00:14+02:00

xhttp_prom: export pkg stats

---

Modified: src/modules/xhttp_prom/prom.c
Modified: src/modules/xhttp_prom/xhttp_prom.c
Modified: src/modules/xhttp_prom/xhttp_prom.h

---

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

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


[sr-dev] git:master:b0d16caf: kex: expose access to pkg stats

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

Author: Ovidiu Sas 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T13:00:14+02:00

kex: expose access to pkg stats

---

Added: src/modules/kex/api.c
Added: src/modules/kex/api.h
Modified: src/modules/kex/kex_mod.c
Modified: src/modules/kex/pkg_stats.c
Modified: src/modules/kex/pkg_stats.h

---

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

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


[sr-dev] Re: [kamailio/kamailio] ndb_redis: docs - refine docs regarding client certificates (PR #3804)

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Thanks!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3804#issuecomment-2036844831
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:6faa1806: ndb_redis: docs - refine docs regarding client certificates [skip ci]

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 6faa180661e799187eff3a498f8b13e96719fa92
URL: 
https://github.com/kamailio/kamailio/commit/6faa180661e799187eff3a498f8b13e96719fa92

Author: Jannik Volkland 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T12:55:38+02:00

ndb_redis: docs - refine docs regarding client certificates [skip ci]

The created ssl context does not use client certificates [1,2] which is against 
the default in current Redis configurations [3]. The used Redis server 
therefore needs to be configured to not use tls-auth-clients [3].

There is also a small typo in "ac_path" which was fixed to "ca_path".

[1]: 
https://github.com/kamailio/kamailio/blob/8047c958b42ea5af2e8f9ede0152f892ac0eea3a/src/modules/db_redis/redis_connection.c#L168
[2]: 
https://github.com/kamailio/kamailio/blob/8047c958b42ea5af2e8f9ede0152f892ac0eea3a/src/modules/db_redis/redis_connection.c#L212
[3]: 
https://redis.io/docs/management/security/encryption/#client-certificate-authentication

---

Modified: src/modules/ndb_redis/doc/ndb_redis_admin.xml

---

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

---

diff --git a/src/modules/ndb_redis/doc/ndb_redis_admin.xml 
b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
index 74d35c75cc9..024b01315ac 100644
--- a/src/modules/ndb_redis/doc/ndb_redis_admin.xml
+++ b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
@@ -75,6 +75,12 @@
many REDIS servers, just give different attributes and 
use the specific
server name when querying the REDIS instance.

+   
+   If tls is enabled, the module will validate the REDIS 
server certificate against the
+   ca_path. There is currently no way to connect with a 
specified client certificate, the
+   https://redis.io/docs/management/security/encryption/#client-certificate-authentication;>corresponding
 configuration
+   to check client certificates in the REDIS server must 
therefore be turned off.
+   


Default value is NULL.
@@ -330,9 +336,9 @@ modparam("ndb_redis", "debug", 1)



-   ac_path (string)
+   ca_path (string)

-   Sets the path where Certificates Authorities certs are 
stored.
+   Sets the path where Certificates Authorities certs for 
the REDIS server certificate are stored.


Default value: "" (empty).

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


[sr-dev] Re: [kamailio/kamailio] ndb_redis: docs - refine docs regarding client certificates (PR #3804)

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Merged #3804 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3804#event-12356152415
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:40a50243: db_redis: docs - refine docs regarding client certificates [skip ci]

2024-04-04 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 40a50243f0bae782b7acd97cf0a9b1138185068b
URL: 
https://github.com/kamailio/kamailio/commit/40a50243f0bae782b7acd97cf0a9b1138185068b

Author: Jannik Volkland 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T12:55:38+02:00

db_redis: docs - refine docs regarding client certificates [skip ci]

The created ssl context does not use client certificates [1,2] which is against 
the default in current Redis configurations [3]. The used Redis server 
therefore needs to be configured to not use tls-auth-clients [3].

There is also a small typo in "ac_path" which was fixed to "ca_path".

[1]: 
https://github.com/kamailio/kamailio/blob/8047c958b42ea5af2e8f9ede0152f892ac0eea3a/src/modules/db_redis/redis_connection.c#L168
[2]: 
https://github.com/kamailio/kamailio/blob/8047c958b42ea5af2e8f9ede0152f892ac0eea3a/src/modules/db_redis/redis_connection.c#L212
[3]: 
https://redis.io/docs/management/security/encryption/#client-certificate-authentication

---

Modified: src/modules/db_redis/doc/db_redis_admin.xml

---

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

---

diff --git a/src/modules/db_redis/doc/db_redis_admin.xml 
b/src/modules/db_redis/doc/db_redis_admin.xml
index a7e7c3bb3a9..15ed0ca61e2 100644
--- a/src/modules/db_redis/doc/db_redis_admin.xml
+++ b/src/modules/db_redis/doc/db_redis_admin.xml
@@ -224,6 +224,12 @@ modparam("db_redis", "verbosity", 0)
Controls TLS usage while connecting to a remote 
DB.
If set to 1, TLS is used to connect to the DB.

+   
+   If TLS is enabled, the module will validate the 
Redis server certificate against the
+   ca_path. There is currently no way to connect 
with a specified client certificate, the
+   https://redis.io/docs/management/security/encryption/#client-certificate-authentication;>corresponding
 configuration
+   to check client certificates in the Redis 
server must therefore be turned off.
+   

Default value: 0.

@@ -256,9 +262,9 @@ modparam("db_redis", "db_pass", "r3d1sPass")

 

-   ac_path (string)
+   ca_path (string)

-   Sets the path where Certificates Authorities 
certs are stored.
+   Sets the path where Certificates Authorities 
certs for the Redis server certificate are stored.


Default value: "" (empty).

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


[sr-dev] git:master:eb8027f9: sdpops: added $sdp(m0:b:AS), $sdp(m0:b:RR) and $sdp(m0:b:RS)

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-04T12:16:24+02:00

sdpops: added $sdp(m0:b:AS), $sdp(m0:b:RR) and $sdp(m0:b:RS)

- return string values for b=AS:.., b=RR:.., b=RS:..

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

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


[sr-dev] git:master:8047c958: sdpops: aliased $sdp(raw) to $sdp(body)

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T20:16:21+02:00

sdpops: aliased $sdp(raw) to $sdp(body)

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index b443d1f84ac..96d0bd202b8 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2259,6 +2259,12 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
return -1;
 
switch(in->len) {
+   case 3:
+   if(strncmp(in->s, "raw", 3) == 0)
+   sp->pvp.pvn.u.isname.name.n = 0;
+   else
+   goto error;
+   break;
case 4:
if(strncmp(in->s, "body", 4) == 0)
sp->pvp.pvn.u.isname.name.n = 0;

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


[sr-dev] git:master:3e73dbc6: sdpops: added $sdp(m0:raw) - get all lines of the first m= stream

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T19:19:27+02:00

sdpops: added $sdp(m0:raw) - get all lines of the first m= stream

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index b7ee2482616..b443d1f84ac 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2201,6 +2201,21 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
}
}
+   case 7:
+   /* m0:raw - all (raw) lines for m0 stream */
+   if(sdp->sessions == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams->raw_stream.s != NULL
+   && 
sdp->sessions->streams->raw_stream.len > 0) {
+   return pv_get_strval(
+   msg, param, res, 
>sessions->streams->raw_stream);
+   }
+   return pv_get_null(msg, param, res);
+   break;
 
default:
return pv_get_null(msg, param, res);
@@ -2256,6 +2271,12 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
else
goto error;
break;
+   case 6:
+   if(strncmp(in->s, "m0:raw", 6) == 0)
+   sp->pvp.pvn.u.isname.name.n = 7;
+   else
+   goto error;
+   break;
case 11:
if(strncmp(in->s, "m0:rtp:port", 11) == 0)
sp->pvp.pvn.u.isname.name.n = 4;

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


[sr-dev] git:master:ed60be16: pv: transformation to escape/unescape cr lf

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T18:52:58+02:00

pv: transformation to escape/unescape cr lf

- {s.escape.crlf}, {s.unescape.crlf}

---

Modified: src/modules/pv/pv_trans.c
Modified: src/modules/pv/pv_trans.h

---

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

---

diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index 0cc6f8f2e2c..a3ce0f0ace3 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -566,6 +566,32 @@ int tr_eval_string(
val->rs.s = _tr_buffer;
val->rs.len = i;
break;
+   case TR_S_ESCAPECRLF:
+   if(!(val->flags & PV_VAL_STR))
+   val->rs.s = int2str(val->ri, >rs.len);
+   if(val->rs.len > TR_BUFFER_SIZE / 2 - 1)
+   return -1;
+   st.s = _tr_buffer;
+   st.len = TR_BUFFER_SIZE;
+   if(escape_crlf(>rs, ))
+   return -1;
+   memset(val, 0, sizeof(pv_value_t));
+   val->flags = PV_VAL_STR;
+   val->rs = st;
+   break;
+   case TR_S_UNESCAPECRLF:
+   if(!(val->flags & PV_VAL_STR))
+   val->rs.s = int2str(val->ri, >rs.len);
+   if(val->rs.len > TR_BUFFER_SIZE - 1)
+   return -1;
+   st.s = _tr_buffer;
+   st.len = TR_BUFFER_SIZE;
+   if(unescape_crlf(>rs, ))
+   return -1;
+   memset(val, 0, sizeof(pv_value_t));
+   val->flags = PV_VAL_STR;
+   val->rs = st;
+   break;
case TR_S_ESCAPEUSER:
if(!(val->flags & PV_VAL_STR))
val->rs.s = int2str(val->ri, >rs.len);
@@ -2768,6 +2794,12 @@ char *tr_parse_string(str *in, trans_t *t)
  && strncasecmp(name.s, "unescape.common", 15) == 0) {
t->subtype = TR_S_UNESCAPECOMMON;
goto done;
+   } else if(name.len == 11 && strncasecmp(name.s, "escape.crlf", 11) == 
0) {
+   t->subtype = TR_S_ESCAPECRLF;
+   goto done;
+   } else if(name.len == 13 && strncasecmp(name.s, "unescape.crlf", 13) == 
0) {
+   t->subtype = TR_S_UNESCAPECRLF;
+   goto done;
} else if(name.len == 11 && strncasecmp(name.s, "escape.user", 11) == 
0) {
t->subtype = TR_S_ESCAPEUSER;
goto done;
diff --git a/src/modules/pv/pv_trans.h b/src/modules/pv/pv_trans.h
index 827f74feb49..662d5a2b578 100644
--- a/src/modules/pv/pv_trans.h
+++ b/src/modules/pv/pv_trans.h
@@ -60,6 +60,8 @@ enum _tr_s_subtype
TR_S_DECODEBASE64,
TR_S_ESCAPECOMMON,
TR_S_UNESCAPECOMMON,
+   TR_S_ESCAPECRLF,
+   TR_S_UNESCAPECRLF,
TR_S_ESCAPEUSER,
TR_S_UNESCAPEUSER,
TR_S_ESCAPEPARAM,

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


[sr-dev] git:master:6992c9ee: core: helper functions to escape/unescape cr lf

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T18:48:29+02:00

core: helper functions to escape/unescape cr lf

---

Modified: src/core/strutils.c
Modified: src/core/strutils.h

---

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

---

diff --git a/src/core/strutils.c b/src/core/strutils.c
index 73e713cb451..475150dc0f7 100644
--- a/src/core/strutils.c
+++ b/src/core/strutils.c
@@ -109,6 +109,68 @@ int unescape_common(char *dst, char *src, int src_len)
return j;
 }
 
+/*! \brief
+ * add backslashes for CR LF
+ */
+int escape_crlf(str *sin, str *sout)
+{
+   int i, j;
+
+   if(sout == 0 || sin == 0 || sin->len <= 0)
+   return -1;
+   j = 0;
+   for(i = 0; i < sin->len; i++) {
+   switch(sin->s[i]) {
+   case '\n':
+   sout->s[j++] = '\\';
+   sout->s[j++] = 'n';
+   break;
+   case '\r':
+   sout->s[j++] = '\\';
+   sout->s[j++] = 'r';
+   break;
+   default:
+   sout->s[j++] = sin->s[i];
+   }
+   }
+   sout->len = j;
+   return 0;
+}
+
+/*! \brief
+ * remove backslashes for CR LF
+ */
+int unescape_crlf(str *sin, str *sout)
+{
+   int i, j;
+
+   if(sout == 0 || sin == 0 || sin->len <= 0)
+   return -1;
+   j = 0;
+   i = 0;
+   while(i < sin->len) {
+   if(sin->s[i] == '\\' && i + 1 < sin->len) {
+   switch(sin->s[i + 1]) {
+   case 'n':
+   sout->s[j++] = '\n';
+   i++;
+   break;
+   case 'r':
+   sout->s[j++] = '\r';
+   i++;
+   break;
+   default:
+   sout->s[j++] = sin->s[i];
+   }
+   } else {
+   sout->s[j++] = sin->s[i];
+   }
+   i++;
+   }
+   sout->len = j;
+   return 0;
+}
+
 /*! \brief Unscape all printable ASCII characters */
 int unescape_user(str *sin, str *sout)
 {
diff --git a/src/core/strutils.h b/src/core/strutils.h
index b32e610512c..5781943dacb 100644
--- a/src/core/strutils.h
+++ b/src/core/strutils.h
@@ -56,6 +56,8 @@ int escape_common(char *dst, char *src, int src_len);
 
 /* remove backslashes to special characters */
 int unescape_common(char *dst, char *src, int src_len);
+int escape_crlf(str *sin, str *sout);
+int unescape_crlf(str *sin, str *sout);
 int escape_user(str *sin, str *sout);
 int unescape_user(str *sin, str *sout);
 int escape_param(str *sin, str *sout);

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


[sr-dev] git:master:ec7f3a21: sdops: typo fixed for $sdp(m0:rtcp:port)

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T17:02:14+02:00

sdops: typo fixed for $sdp(m0:rtcp:port)

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 644ded5b064..b7ee2482616 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2265,7 +2265,7 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
case 12:
if(strncmp(in->s, "sess_version", 12) == 0)
sp->pvp.pvn.u.isname.name.n = 1;
-   else if(strncmp(in->s, "m0:rctp:port", 12) == 0)
+   else if(strncmp(in->s, "m0:rtcp:port", 12) == 0)
sp->pvp.pvn.u.isname.name.n = 5;
else
goto error;

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


[sr-dev] Kamailio v5.8.1 Released

2024-04-03 Thread Daniel-Constantin Mierla via sr-dev
Hello,

Kamailio SIP Server v5.8.1 stable release is out.

This is a maintenance release of the latest stable branch, 5.8, that
includes fixes since the release of v5.8.0. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.8.x. Deployments running previous v5.8.x
versions are strongly recommended to be upgraded to v5.8.1.

For more details about version 5.8.1 (including links and guidelines to
download the tarball or from GIT repository), visit:

  * https://www.kamailio.org/w/2024/04/kamailio-v5-8-1-released/

RPM, Debian/Ubuntu packages will be available soon as well.

Many thanks to all contributing and using Kamailio!

Cheers,
Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, April 18-19, 2024, Berlin -- kamailioworld.com

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


[sr-dev] git:5.8:384843ce: ChangeLog: content updated for v5.8.1

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:26:52+02:00

ChangeLog: content updated for v5.8.1

---

Modified: ChangeLog

---

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

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


[sr-dev] git:5.8:1caec71a: core: xavp - added missing closing parenthesis in log messages

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:21:26+02:00

core: xavp - added missing closing parenthesis in log messages

(cherry picked from commit 3b09fd343575c56d9658a61efebd4851662de338)

---

Modified: src/core/xavp.c

---

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

---

diff --git a/src/core/xavp.c b/src/core/xavp.c
index 128ea631013..21a8197080b 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -1151,7 +1151,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
avp->name.len, avp->name.s, 
(unsigned long)avp->val.v.l,
sf);
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize long int 
value (%d/%d\n",
+   LM_ERR("failed to serialize long int 
value (%d/%d)\n",
ostr.len, olen - rlen);
return -1;
}
@@ -1162,7 +1162,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
avp->name.len, avp->name.s,
(unsigned long 
long)avp->val.v.ll, sf);
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize long long 
value (%d/%d\n",
+   LM_ERR("failed to serialize long long 
value (%d/%d)\n",
ostr.len, olen - rlen);
return -1;
}
@@ -1178,7 +1178,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
qs, avp->val.v.s.len, 
avp->val.v.s.s, qs, sf);
}
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize int value 
(%d/%d\n", ostr.len,
+   LM_ERR("failed to serialize str value 
(%d/%d)\n", ostr.len,
olen - rlen);
return -1;
}

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


[sr-dev] git:5.8:69f667fe: core: msg translator - duplicate reply via xavp params and handle errors

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:21:37+02:00

core: msg translator - duplicate reply via xavp params and handle errors

(cherry picked from commit 5f83d4f9c447f5a7e3de8336dc0e076b10e43833)

---

Modified: src/core/msg_translator.c

---

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

---

diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index b54eded3f89..acd5911867a 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -2362,6 +2362,7 @@ char *generate_res_buf_from_sip_res(
char *buf;
unsigned int len;
str xparams;
+   str sdup;
sr_lump_t *anchor;
 
buf = msg->buf;
@@ -2393,11 +2394,18 @@ char *generate_res_buf_from_sip_res(
anchor = anchor_lump(msg,
msg->via2->params.s + 
msg->via2->params.len - msg->buf, 0,
0);
-   if(anchor != NULL) {
-   if(insert_new_lump_after(anchor, xparams.s, 
xparams.len, 0)
-   == 0) {
-   LM_ERR("unable to add via reply xavp 
params\n");
-   }
+   if(anchor == NULL) {
+   LM_ERR("unable to get the anchor\n");
+   goto error;
+   }
+   if(pkg_str_dup(, ) < 0) {
+   PKG_MEM_ERROR;
+   goto error;
+   }
+   if(insert_new_lump_after(anchor, sdup.s, sdup.len, 0) 
== 0) {
+   LM_ERR("unable to add via reply xavp params\n");
+   pkg_free(sdup.s);
+   goto error;
}
}
}

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


[sr-dev] git:5.8:e8aa9871: Makefile.defs: version set to 5.8.1

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:23:42+02:00

Makefile.defs: version set to 5.8.1

---

Modified: src/Makefile.defs

---

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

---

diff --git a/src/Makefile.defs b/src/Makefile.defs
index f5e8b0da653..0f960b4478e 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -106,7 +106,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 # version number
 VERSION = 5
 PATCHLEVEL = 8
-SUBLEVEL =  0
+SUBLEVEL = 1
 EXTRAVERSION = 
 
 # memory manager switcher

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


[sr-dev] git:master:3b09fd34: core: xavp - added missing closing parenthesis in log messages

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:16:18+02:00

core: xavp - added missing closing parenthesis in log messages

---

Modified: src/core/xavp.c

---

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

---

diff --git a/src/core/xavp.c b/src/core/xavp.c
index 128ea631013..21a8197080b 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -1151,7 +1151,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
avp->name.len, avp->name.s, 
(unsigned long)avp->val.v.l,
sf);
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize long int 
value (%d/%d\n",
+   LM_ERR("failed to serialize long int 
value (%d/%d)\n",
ostr.len, olen - rlen);
return -1;
}
@@ -1162,7 +1162,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
avp->name.len, avp->name.s,
(unsigned long 
long)avp->val.v.ll, sf);
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize long long 
value (%d/%d\n",
+   LM_ERR("failed to serialize long long 
value (%d/%d)\n",
ostr.len, olen - rlen);
return -1;
}
@@ -1178,7 +1178,7 @@ int xavp_serialize_fields_style(str *rname, int mode, 
char *obuf, int olen)
qs, avp->val.v.s.len, 
avp->val.v.s.s, qs, sf);
}
if(ostr.len <= 0 || ostr.len >= olen - rlen) {
-   LM_ERR("failed to serialize int value 
(%d/%d\n", ostr.len,
+   LM_ERR("failed to serialize str value 
(%d/%d)\n", ostr.len,
olen - rlen);
return -1;
}

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


[sr-dev] git:master:5f83d4f9: core: msg translator - duplicate reply via xavp params and handle errors

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T12:18:47+02:00

core: msg translator - duplicate reply via xavp params and handle errors

---

Modified: src/core/msg_translator.c

---

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

---

diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index b54eded3f89..acd5911867a 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -2362,6 +2362,7 @@ char *generate_res_buf_from_sip_res(
char *buf;
unsigned int len;
str xparams;
+   str sdup;
sr_lump_t *anchor;
 
buf = msg->buf;
@@ -2393,11 +2394,18 @@ char *generate_res_buf_from_sip_res(
anchor = anchor_lump(msg,
msg->via2->params.s + 
msg->via2->params.len - msg->buf, 0,
0);
-   if(anchor != NULL) {
-   if(insert_new_lump_after(anchor, xparams.s, 
xparams.len, 0)
-   == 0) {
-   LM_ERR("unable to add via reply xavp 
params\n");
-   }
+   if(anchor == NULL) {
+   LM_ERR("unable to get the anchor\n");
+   goto error;
+   }
+   if(pkg_str_dup(, ) < 0) {
+   PKG_MEM_ERROR;
+   goto error;
+   }
+   if(insert_new_lump_after(anchor, sdup.s, sdup.len, 0) 
== 0) {
+   LM_ERR("unable to add via reply xavp params\n");
+   pkg_free(sdup.s);
+   goto error;
}
}
}

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


[sr-dev] Re: [kamailio/kamailio] ipops: Add PTR query support (PR #3802)

2024-04-03 Thread Daniel-Constantin Mierla via sr-dev
@miconda commented on this pull request.



> @@ -883,6 +883,57 @@ if(dns_query("test.com", "xyz"))
 
 
 
+
+  
+ptr_query(ip, pvid)
+  
+
+  
+ Store the hostname that correspond to ip
+ in a config variable $ptrquery(pvid=>hostname).

I use both terms config variables and pseudo variables, and I am referring to 
the same concept. Historically the term pseudo-variables was used from 
developer's perspective, trying to differentiate them from C-style variables. 
Over the time, I noticed that config-variables are easier to "understand" what 
one refers to, specially by those coming new to use Kamailio.

In other words, pseudo-variables tries to define them from technical point of 
view (i.e., no declaration, no explicit type association, automatically 
available by loading various modules, some read-only, other read-write). The 
config-variables indicates where these variables are available/can be used.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3802#discussion_r1549330031
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.8:4708758f: pkg: deb specs updated for v5.8.1

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T08:22:44+02:00

pkg: deb specs updated for v5.8.1

---

Modified: pkg/kamailio/deb/bionic/changelog
Modified: pkg/kamailio/deb/bookworm/changelog
Modified: pkg/kamailio/deb/bullseye/changelog
Modified: pkg/kamailio/deb/buster/changelog
Modified: pkg/kamailio/deb/debian/changelog
Modified: pkg/kamailio/deb/focal/changelog
Modified: pkg/kamailio/deb/jammy/changelog
Modified: pkg/kamailio/deb/jessie/changelog
Modified: pkg/kamailio/deb/precise/changelog
Modified: pkg/kamailio/deb/sid/changelog
Modified: pkg/kamailio/deb/stretch/changelog
Modified: pkg/kamailio/deb/trusty/changelog
Modified: pkg/kamailio/deb/wheezy/changelog
Modified: pkg/kamailio/deb/xenial/changelog

---

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

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


[sr-dev] git:5.8:3b00630c: pkg/kamailio: version set 5.8.1 for rpms and alpine

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T08:20:49+02:00

pkg/kamailio: version set 5.8.1 for rpms and alpine

---

Modified: pkg/kamailio/alpine/APKBUILD
Modified: pkg/kamailio/obs/kamailio.spec

---

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

---

diff --git a/pkg/kamailio/alpine/APKBUILD b/pkg/kamailio/alpine/APKBUILD
index eaa70ccd5ff..4b56df12b49 100644
--- a/pkg/kamailio/alpine/APKBUILD
+++ b/pkg/kamailio/alpine/APKBUILD
@@ -4,7 +4,7 @@
 # Maintainer: Nathan Angelacos 
 
 pkgname=kamailio
-pkgver=5.8.0
+pkgver=5.8.1
 pkgrel=0
 
 # If building from a git snapshot, specify the gitcommit
diff --git a/pkg/kamailio/obs/kamailio.spec b/pkg/kamailio/obs/kamailio.spec
index d8811a2d1f9..ee339c02d99 100644
--- a/pkg/kamailio/obs/kamailio.spec
+++ b/pkg/kamailio/obs/kamailio.spec
@@ -1,5 +1,5 @@
 %define namekamailio
-%define ver 5.8.0
+%define ver 5.8.1
 %define rel dev1.0%{dist}
 
 %if 0%{?fedora}

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


[sr-dev] git:master:42c76096: sdpops: added $sdp(c:af) - address family of first media connection

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T08:07:15+02:00

sdpops: added $sdp(c:af) - address family of first media connection

- can be compared with $K(IPv4) or $K(IPv6)

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 507e7dbe81b..644ded5b064 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2174,6 +2174,33 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
return pv_get_strval(msg, param, res, );
}
return pv_get_null(msg, param, res);
+   case 6:
+   /* c:af - connection address family */
+   if(sdp->sessions == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams == NULL) {
+   if(sdp->sessions->ip_addr.s != NULL
+   && sdp->sessions->ip_addr.len > 
0) {
+   return pv_get_sintval(msg, param, res, 
sdp->sessions->pf);
+   } else {
+   return pv_get_null(msg, param, res);
+   }
+   } else {
+   if(sdp->sessions->streams->ip_addr.s != NULL
+   && 
sdp->sessions->streams->ip_addr.len > 0) {
+   return pv_get_sintval(
+   msg, param, res, 
sdp->sessions->streams->pf);
+   } else {
+   if(sdp->sessions->ip_addr.s != NULL
+   && 
sdp->sessions->ip_addr.len > 0) {
+   return pv_get_sintval(
+   msg, param, 
res, sdp->sessions->pf);
+   } else {
+   return pv_get_null(msg, param, 
res);
+   }
+   }
+   }
 
default:
return pv_get_null(msg, param, res);
@@ -,6 +2249,8 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 0;
else if(strncmp(in->s, "c:ip", 4) == 0)
sp->pvp.pvn.u.isname.name.n = 2;
+   else if(strncmp(in->s, "c:af", 4) == 0)
+   sp->pvp.pvn.u.isname.name.n = 6;
else if(strncmp(in->s, "o:ip", 4) == 0)
sp->pvp.pvn.u.isname.name.n = 3;
else

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


[sr-dev] git:master:e7b207e9: pv: $K(IP4) and $K(IP6) - support SDP style for address family

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-03T08:11:07+02:00

pv: $K(IP4) and $K(IP6) - support SDP style for address family

---

Modified: src/modules/pv/pv_core.c

---

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

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 129247f2688..1f998bfc1d3 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -3894,6 +3894,10 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 4;
else if(strncmp(in->s, "WSS", 3) == 0)
sp->pvp.pvn.u.isname.name.n = 7;
+   else if(strncmp(in->s, "IP4", 3) == 0)
+   sp->pvp.pvn.u.isname.name.n = 0;
+   else if(strncmp(in->s, "IP6", 3) == 0)
+   sp->pvp.pvn.u.isname.name.n = 1;
else
goto error;
break;

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


[sr-dev] Re: Releasing v5.8.1

2024-04-03 Thread Daniel-Constantin Mierla via sr-dev
Hello,

short reminder that today is planned to release v5.8.1. As usual, until
the announcement is out, any commit that should go to branch 5.8 has to
be announced to sr-dev mailing list and wait for ack before pushing to
git repository in order to avoid conflicts with release building process.

Cheers,
Daniel

On 26.03.24 12:01, Daniel-Constantin Mierla wrote:
> Hello,
>
> with many countries having public holidays around Catholic Easter, I am
> considering to release Kamailio v5.8.1 (out of branch 5.8) on Wednesday,
> April 3, 2024. If anyone is aware of issues not yet on the bug tracker,
> report them there asap in order to have a better chance to be fixed.
>
> Cheers,
> Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, April 18-19, 2024, Berlin -- kamailioworld.com

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


[sr-dev] git:master:cbe13bed: sdpops: added $sdp(m0:rtcp:port) - rtcp port of first media stream

2024-04-02 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: cbe13bedc13278235ec66cde5938cd92e45e454b
URL: 
https://github.com/kamailio/kamailio/commit/cbe13bedc13278235ec66cde5938cd92e45e454b

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-02T21:22:39+02:00

sdpops: added $sdp(m0:rtcp:port) - rtcp port of first media stream

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 3675d48718e..507e7dbe81b 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2067,6 +2067,9 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
sdp_info_t *sdp = NULL;
str sess_version = STR_NULL;
long sess_version_num = 0;
+   unsigned int uport = 0;
+   static char uport_buf[INT2STR_MAX_LEN];
+   str s = STR_NULL;
 
if(msg == NULL || param == NULL)
return -1;
@@ -2150,6 +2153,27 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
msg, param, res, 
>sessions->streams->port);
}
return pv_get_null(msg, param, res);
+   case 5:
+   /* m0:rtcp:port */
+   if(sdp->sessions == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams->rtcp_port.s != NULL
+   && 
sdp->sessions->streams->rtcp_port.len > 0) {
+   return pv_get_strval(
+   msg, param, res, 
>sessions->streams->rtcp_port);
+   }
+   if(sdp->sessions->streams->port.s != NULL
+   && sdp->sessions->streams->port.len > 
0) {
+   str2int(>sessions->streams->port, );
+   uport++;
+   s.s = int2strbuf(uport, uport_buf, 
INT2STR_MAX_LEN, );
+   return pv_get_strval(msg, param, res, );
+   }
+   return pv_get_null(msg, param, res);
 
default:
return pv_get_null(msg, param, res);
@@ -2212,6 +2236,8 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
case 12:
if(strncmp(in->s, "sess_version", 12) == 0)
sp->pvp.pvn.u.isname.name.n = 1;
+   else if(strncmp(in->s, "m0:rctp:port", 12) == 0)
+   sp->pvp.pvn.u.isname.name.n = 5;
else
goto error;
break;

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


[sr-dev] git:master:238219f1: sdpops: implemented $sdp(o:ip) - origin ip

2024-04-02 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 238219f126e3a155d109fab415d58f8903ee618d
URL: 
https://github.com/kamailio/kamailio/commit/238219f126e3a155d109fab415d58f8903ee618d

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-02T17:06:58+02:00

sdpops: implemented $sdp(o:ip) - origin ip

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 63243c3c3f6..3675d48718e 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2098,7 +2098,7 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
return pv_get_null(msg, param, res);
case 2:
-   /* connection ip */
+   /* c:ip - connection ip */
if(sdp->sessions == NULL) {
return pv_get_null(msg, param, res);
}
@@ -2125,6 +2125,17 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
}
}
+   case 3:
+   /* o:ip - origin ip */
+   if(sdp->sessions == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->o_ip_addr.s != NULL
+   && sdp->sessions->o_ip_addr.len > 0) {
+   return pv_get_strval(
+   msg, param, res, 
>sessions->o_ip_addr);
+   }
+   return pv_get_null(msg, param, res);
case 4:
/* m0:rtp:port */
if(sdp->sessions == NULL) {

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


[sr-dev] git:master:f2f3c57c: spdops: added $sdp(m0:rtp:port) - port of first media stream

2024-04-02 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f2f3c57c2a9bc4bcdc829aaab743427cb349b7ab
URL: 
https://github.com/kamailio/kamailio/commit/f2f3c57c2a9bc4bcdc829aaab743427cb349b7ab

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-02T17:06:58+02:00

spdops: added $sdp(m0:rtp:port) - port of first media stream

---

Modified: src/modules/sdpops/sdpops_mod.c

---

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

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 980c275068b..63243c3c3f6 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2125,6 +2125,20 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
}
}
+   case 4:
+   /* m0:rtp:port */
+   if(sdp->sessions == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams == NULL) {
+   return pv_get_null(msg, param, res);
+   }
+   if(sdp->sessions->streams->port.s != NULL
+   && sdp->sessions->streams->port.len > 
0) {
+   return pv_get_strval(
+   msg, param, res, 
>sessions->streams->port);
+   }
+   return pv_get_null(msg, param, res);
 
default:
return pv_get_null(msg, param, res);
@@ -2178,6 +2192,12 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
else
goto error;
break;
+   case 11:
+   if(strncmp(in->s, "m0:rtp:port", 11) == 0)
+   sp->pvp.pvn.u.isname.name.n = 4;
+   else
+   goto error;
+   break;
case 12:
if(strncmp(in->s, "sess_version", 12) == 0)
sp->pvp.pvn.u.isname.name.n = 1;

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


[sr-dev] git:5.8:3f3c1940: db_mysql: right position for define KSR_MYSQL_OPT_RECONNECT

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 3f3c1940788a4713705169f8d96ae9a13ee2bad1
URL: 
https://github.com/kamailio/kamailio/commit/3f3c1940788a4713705169f8d96ae9a13ee2bad1

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:07:44+02:00

db_mysql: right position for define KSR_MYSQL_OPT_RECONNECT

- follow up of previous commit

(cherry picked from commit 14dc277e29a170b9ac51e7dda07fa25cbd9be048)

---

Modified: src/modules/db_mysql/km_my_con.c

---

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

---

diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 49f7f7e1f7e..4c756db66ff 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -48,10 +48,10 @@ extern char *db_mysql_opt_ssl_ca;
 #define KSR_MYSQL_OPT_RECONNECT
 #else
 #if MYSQL_VERSION_ID < 80034
-#endif
 #define KSR_MYSQL_OPT_RECONNECT
 #endif
 #endif
+#endif
 
 /*! \brief
  * Create a new connection structure,

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


[sr-dev] git:5.8:557d7e83: db_mysql: MYSQL_OPT_RECONNECT is deprecated by MySQL 8.0.34

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 557d7e83c01c930df608b9d96791553d8f2bf724
URL: 
https://github.com/kamailio/kamailio/commit/557d7e83c01c930df608b9d96791553d8f2bf724

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:07:34+02:00

db_mysql: MYSQL_OPT_RECONNECT is deprecated by MySQL 8.0.34

- https://dev.mysql.com/doc/c-api/8.0/en/c-api-auto-reconnect.html
- MariaDB seems to still have it

(cherry picked from commit da3d6e9a74b63fdb7b1c4063d6be017f1ce42bea)

---

Modified: src/modules/db_mysql/km_my_con.c
Modified: src/modules/http_async_client/http_async_client_mod.c

---

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

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


[sr-dev] git:5.8:0e00ae1d: core: socket info - parse advertise ip part to get address family

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 0e00ae1db0242fc01e6f8c332e3920fd9465b3f9
URL: 
https://github.com/kamailio/kamailio/commit/0e00ae1db0242fc01e6f8c332e3920fd9465b3f9

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:06:21+02:00

core: socket info - parse advertise ip part to get address family

(cherry picked from commit 5f901c3557f9f875545d82a7ab00f6d0c5c1fe52)

---

Modified: src/core/socket_info.c

---

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

---

diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index e048e0e2c4b..ab59df73dd6 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -338,6 +338,11 @@ static inline struct socket_info *new_sock_info(char *name,
p = si->useinfo.name.s + 1;
si->useinfo.af = AF_INET6;
} else {
+   ip_addr_t *ipv = NULL;
+   ipv = str2ipx(>useinfo.name);
+   if(ipv != NULL) {
+   si->useinfo.af = ipv->af;
+   }
si->useinfo.address_str.len = si->useinfo.name.len;
p = si->useinfo.name.s;
}

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


[sr-dev] git:5.8:b21a7aaa: smsops: reformat module exports structures

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: b21a7aaa467f2b76a52308557657c65274e34087
URL: 
https://github.com/kamailio/kamailio/commit/b21a7aaa467f2b76a52308557657c65274e34087

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:07:55+02:00

smsops: reformat module exports structures

(cherry picked from commit 9848d43cb367d6901a0b8c727759feb8a8fad930)

---

Modified: src/modules/smsops/smsops.c

---

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

---

diff --git a/src/modules/smsops/smsops.c b/src/modules/smsops/smsops.c
index 3e2cb88bc58..d8354af2319 100644
--- a/src/modules/smsops/smsops.c
+++ b/src/modules/smsops/smsops.c
@@ -30,31 +30,36 @@
 
 MODULE_VERSION
 
-static pv_export_t mod_pvs[] = {{{"smsack", sizeof("smsack") - 1}, PVT_OTHER,
-   
pv_sms_ack, 0, 0, 0, 0, 0},
-   {{"rpdata", sizeof("rpdata") - 1}, PVT_OTHER, pv_get_sms, 
pv_set_sms,
-   pv_parse_rpdata_name, 0, 0, 0},
-   {{"tpdu", sizeof("tpdu") - 1}, PVT_OTHER, pv_get_sms, 
pv_set_sms,
+/* clang-format off */
+static pv_export_t mod_pvs[] = {
+   {{"smsack", sizeof("smsack") - 1}, PVT_OTHER, pv_sms_ack, 0, 0, 0, 0, 
0},
+   {{"rpdata", sizeof("rpdata") - 1}, PVT_OTHER, pv_get_sms, pv_set_sms,
+   pv_parse_rpdata_name, 0, 0, 0},
+   {{"tpdu", sizeof("tpdu") - 1}, PVT_OTHER, pv_get_sms, pv_set_sms,
pv_parse_tpdu_name, 0, 0, 0},
-   {{"smsbody", sizeof("smsbody") - 1}, PVT_OTHER, pv_sms_body, 0, 
0, 0, 0,
-   0},
-   {{0, 0}, 0, 0, 0, 0, 0, 0, 0}};
+   {{"smsbody", sizeof("smsbody") - 1}, PVT_OTHER, pv_sms_body, 0, 0, 0, 
0, 0},
+
+   {{0, 0}, 0, 0, 0, 0, 0, 0, 0}
+};
 
 static cmd_export_t cmds[] = {
-   {"smsdump", (cmd_function)smsdump, 0, 0, 0, REQUEST_ROUTE},
-   {"isRPDATA", (cmd_function)isRPDATA, 0, 0, 0, REQUEST_ROUTE},
-   {0, 0, 0, 0, 0, 0}};
+   {"smsdump", (cmd_function)smsdump, 0, 0, 0, REQUEST_ROUTE},
+   {"isRPDATA", (cmd_function)isRPDATA, 0, 0, 0, REQUEST_ROUTE},
+
+   {0, 0, 0, 0, 0, 0}
+};
 
 /** module exports */
 struct module_exports exports = {
-   "smsops",/* module name */
-   DEFAULT_DLFLAGS, /* dlopen flags */
-   cmds,/* exported functions */
-   0,   /* exported parameters */
-   0,   /* exported rpc functions */
-   mod_pvs, /* exported pseudo-variables */
-   0,   /* response handling function*/
-   0,   /* module init function */
-   0,   /* per-child init function */
-   0/* module destroy function */
+   "smsops",/* module name */
+   DEFAULT_DLFLAGS, /* dlopen flags */
+   cmds,/* exported functions */
+   0,   /* exported parameters */
+   0,   /* exported rpc functions */
+   mod_pvs, /* exported pseudo-variables */
+   0,   /* response handling function*/
+   0,   /* module init function */
+   0,   /* per-child init function */
+   0/* module destroy function */
 };
+/* clang-format on */

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


[sr-dev] git:5.8:e394a051: blst: reformat exported structures

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: e394a05152b29d4009c9cb963bced72526c7651b
URL: 
https://github.com/kamailio/kamailio/commit/e394a05152b29d4009c9cb963bced72526c7651b

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:08:46+02:00

blst: reformat exported structures

(cherry picked from commit e39557c96d2f419184c826d779f1a3309acc4269)

---

Modified: src/modules/blst/blst.c

---

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

---

diff --git a/src/modules/blst/blst.c b/src/modules/blst/blst.c
index 6a2c1d625b6..148a9a9d9d0 100644
--- a/src/modules/blst/blst.c
+++ b/src/modules/blst/blst.c
@@ -49,37 +49,44 @@ static int blst_rpl_set_ignore_f(struct sip_msg *, char *, 
char *);
 static int blst_rpl_clear_ignore_f(struct sip_msg *, char *, char *);
 
 
-static cmd_export_t cmds[] = {{"blst_add", blst_add0_f, 0, 0, 0, ANY_ROUTE},
-   {"blst_add", blst_add1_f, 1, fixup_var_int_1, 0, ANY_ROUTE},
-   {"blst_add_retry_after", blst_add_retry_after_f, 2, 
fixup_var_int_12, 0,
+/* clang-format off */
+static cmd_export_t cmds[] = {
+   {"blst_add", blst_add0_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_add", blst_add1_f, 1, fixup_var_int_1, 0, ANY_ROUTE},
+   {"blst_add_retry_after", blst_add_retry_after_f, 2, fixup_var_int_12, 0,
ANY_ROUTE},
-   {"blst_del", blst_del_f, 0, 0, 0, ANY_ROUTE},
-   {"blst_is_blocklisted", blst_is_blocklisted_f, 0, 0, 0, 
ANY_ROUTE},
-   {"blst_set_ignore", blst_set_ignore_f, 0, 0, 0, ANY_ROUTE},
-   {"blst_set_ignore", blst_set_ignore_f, 1, fixup_var_int_1, 0,
+   {"blst_del", blst_del_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_is_blocklisted", blst_is_blocklisted_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_set_ignore", blst_set_ignore_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_set_ignore", blst_set_ignore_f, 1, fixup_var_int_1, 0,
ANY_ROUTE},
-   {"blst_clear_ignore", blst_clear_ignore_f, 0, 0, 0, ANY_ROUTE},
-   {"blst_clear_ignore", blst_clear_ignore_f, 1, fixup_var_int_1, 
0,
+   {"blst_clear_ignore", blst_clear_ignore_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_clear_ignore", blst_clear_ignore_f, 1, fixup_var_int_1, 0,
ANY_ROUTE},
-   {"blst_rpl_set_ignore", blst_rpl_set_ignore_f, 0, 0, 0, 
ANY_ROUTE},
-   {"blst_rpl_set_ignore", blst_rpl_set_ignore_f, 1, 
fixup_var_int_1, 0,
+   {"blst_rpl_set_ignore", blst_rpl_set_ignore_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_rpl_set_ignore", blst_rpl_set_ignore_f, 1, fixup_var_int_1, 0,
ANY_ROUTE},
-   {"blst_rpl_clear_ignore", blst_rpl_clear_ignore_f, 0, 0, 0, 
ANY_ROUTE},
-   {"blst_rpl_clear_ignore", blst_rpl_clear_ignore_f, 1, 
fixup_var_int_1,
+   {"blst_rpl_clear_ignore", blst_rpl_clear_ignore_f, 0, 0, 0, ANY_ROUTE},
+   {"blst_rpl_clear_ignore", blst_rpl_clear_ignore_f, 1, fixup_var_int_1,
0, ANY_ROUTE},
-   {0, 0, 0, 0, 0, 0}};
+   {0, 0, 0, 0, 0, 0}
+};
 
 static param_export_t params[] = {{0, 0, 0}}; /* no params */
 
 struct module_exports exports = {
-   "blst", DEFAULT_DLFLAGS, /* dlopen flags */
-   cmds, params, 0, /* RPC methods */
-   0,   /* 
pseudo-variables exports */
-   0,   /* response 
function */
-   0,   /* module 
initialization function */
-   0,   /* per-child 
init function */
-   0/* destroy 
function */
+   "blst",
+   DEFAULT_DLFLAGS, /* dlopen flags */
+   cmds,
+   params,
+   0,   /* RPC methods */
+   0,   /* pseudo-variables exports */
+   0,   /* response function */
+   0,   /* module initialization function */
+   0,   /* per-child init function */
+   0/* destroy function */
 };
+/* clang-format on */
 
 
 /**

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


[sr-dev] git:5.8:c0c8ee05: smsops: short reference section about variables

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: c0c8ee05ab25256b9154d2056ee04b07f3f2290a
URL: 
https://github.com/kamailio/kamailio/commit/c0c8ee05ab25256b9154d2056ee04b07f3f2290a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:08:38+02:00

smsops: short reference section about variables

(cherry picked from commit 9a94930ae1168d5df79e3dc1414841cdf23a2eba)

---

Modified: src/modules/smsops/doc/smsops_admin.xml

---

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

---

diff --git a/src/modules/smsops/doc/smsops_admin.xml 
b/src/modules/smsops/doc/smsops_admin.xml
index fa19ebfc79c..da95e37c012 100644
--- a/src/modules/smsops/doc/smsops_admin.xml
+++ b/src/modules/smsops/doc/smsops_admin.xml
@@ -95,5 +95,19 @@ smsdump();


 
+   
+   Variables
+   Several variables are exported by the module to access the
+   attributes of the SMS.
+   
+   
+   $smsack
+   $smsbody
+   $rpdata(key)
+   $tpdu(key)
+   
+   
+   
+
 
 

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


[sr-dev] git:5.8:dbf9208f: core: resolve/create_srv_pref_list() - insert at correct position in list

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: dbf9208f3a402844c9981fb7ed09493a1338dfdd
URL: 
https://github.com/kamailio/kamailio/commit/dbf9208f3a402844c9981fb7ed09493a1338dfdd

Author: Elena-Ramona Modroiu 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:06:56+02:00

core: resolve/create_srv_pref_list() - insert at correct position in list

(cherry picked from commit f35cf8904119dcf582ea2451648de5fef095466b)

---

Modified: src/core/resolve.c

---

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

---

diff --git a/src/core/resolve.c b/src/core/resolve.c
index b6ee8592697..6d581f4915f 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -1526,8 +1526,8 @@ size_t create_srv_pref_list(char *proto, struct 
dns_srv_proto *list)
if(naptr_proto_supported(i) == 0) {
continue;
} else {
-   list[i - 1].proto_pref = tmp.proto_pref;
-   list[i - 1].proto = i;
+   list[list_len].proto_pref = tmp.proto_pref;
+   list[list_len].proto = i;
list_len++;
}
};

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


[sr-dev] git:5.8:c48fbea9: gcrypt: docs - module name used for section ids

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: c48fbea981c7b0bd281cd1fc2abedcda41d92c13
URL: 
https://github.com/kamailio/kamailio/commit/c48fbea981c7b0bd281cd1fc2abedcda41d92c13

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:05:20+02:00

gcrypt: docs - module name used for section ids

(cherry picked from commit 68c69966c38b56775a3966d07c33ff94c2a8ba95)

---

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

---

Diff:  
https://github.com/kamailio/kamailio/commit/c48fbea981c7b0bd281cd1fc2abedcda41d92c13.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c48fbea981c7b0bd281cd1fc2abedcda41d92c13.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:master:baa17755: crupto: replace local fixup functions with core helpers

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T07:56:26+02:00

crupto: replace local fixup functions with core helpers

---

Modified: src/modules/crypto/crypto_mod.c

---

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

---

diff --git a/src/modules/crypto/crypto_mod.c b/src/modules/crypto/crypto_mod.c
index b3fba9c005a..f3e644000f9 100644
--- a/src/modules/crypto/crypto_mod.c
+++ b/src/modules/crypto/crypto_mod.c
@@ -58,10 +58,8 @@ static void mod_destroy(void);
 
 static int w_crypto_aes_encrypt(
sip_msg_t *msg, char *inb, char *keyb, char *outb);
-static int fixup_crypto_aes_encrypt(void **param, int param_no);
 static int w_crypto_aes_decrypt(
sip_msg_t *msg, char *inb, char *keyb, char *outb);
-static int fixup_crypto_aes_decrypt(void **param, int param_no);
 
 static int w_crypto_nio_in(sip_msg_t *msg, char *p1, char *p2);
 static int w_crypto_nio_out(sip_msg_t *msg, char *p1, char *p2);
@@ -86,9 +84,9 @@ str _crypto_netio_key = STR_NULL;
 
 static cmd_export_t cmds[] = {
{"crypto_aes_encrypt", (cmd_function)w_crypto_aes_encrypt, 3,
-   fixup_crypto_aes_encrypt, 0, ANY_ROUTE},
+   fixup_spve2_pvar, fixup_free_spve2_pvar, 
ANY_ROUTE},
{"crypto_aes_decrypt", (cmd_function)w_crypto_aes_decrypt, 3,
-   fixup_crypto_aes_decrypt, 0, ANY_ROUTE},
+   fixup_spve2_pvar, fixup_free_spve2_pvar, 
ANY_ROUTE},
{"crypto_netio_in", (cmd_function)w_crypto_nio_in, 0, 0, 0, 
ANY_ROUTE},
{"crypto_netio_out", (cmd_function)w_crypto_nio_out, 0, 0, 0,
ANY_ROUTE},
@@ -345,28 +343,6 @@ static int w_crypto_aes_encrypt(
return ki_crypto_aes_encrypt_helper(msg, , , dst);
 }
 
-/**
- *
- */
-static int fixup_crypto_aes_encrypt(void **param, int param_no)
-{
-   if(param_no == 1 || param_no == 2) {
-   if(fixup_spve_null(param, 1) < 0)
-   return -1;
-   return 0;
-   } else if(param_no == 3) {
-   if(fixup_pvar_null(param, 1) != 0) {
-   LM_ERR("failed to fixup result pvar\n");
-   return -1;
-   }
-   if(((pv_spec_t *)(*param))->setf == NULL) {
-   LM_ERR("result pvar is not writeble\n");
-   return -1;
-   }
-   }
-   return 0;
-}
-
 /**
  *
  */
@@ -590,29 +566,6 @@ static int w_crypto_aes_decrypt(
return ki_crypto_aes_decrypt_helper(msg, , , dst);
 }
 
-/**
- *
- */
-static int fixup_crypto_aes_decrypt(void **param, int param_no)
-{
-   if(param_no == 1 || param_no == 2) {
-   if(fixup_spve_null(param, 1) < 0)
-   return -1;
-   return 0;
-   } else if(param_no == 3) {
-   if(fixup_pvar_null(param, 1) != 0) {
-   LM_ERR("failed to fixup result pvar\n");
-   return -1;
-   }
-   if(((pv_spec_t *)(*param))->setf == NULL) {
-   LM_ERR("result pvar is not writeble\n");
-   return -1;
-   }
-   }
-   return 0;
-}
-
-
 /**
  * testing function
  */

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


[sr-dev] git:5.8:3f44cabc: corex: fix conditions for dns_cache modparam srv attributes

2024-04-01 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: 5.8
Commit: 3f44cabcfc0abc83ae1971ac74fbb0bd36829ce4
URL: 
https://github.com/kamailio/kamailio/commit/3f44cabcfc0abc83ae1971ac74fbb0bd36829ce4

Author: Elena-Ramona Modroiu 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-01T08:07:14+02:00

corex: fix conditions for dns_cache modparam srv attributes

(cherry picked from commit 8114b2016d032484edafe4edd04fb02d52cfd058)

---

Modified: src/modules/corex/corex_mod.c

---

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

---

diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index ed37b22c757..4152fbf5df4 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -454,7 +454,7 @@ static int corex_dns_cache_param_add(str *pval)
}
} else if(pit->name.len == 8
  && strncasecmp(pit->name.s, "priority", 8) == 
0) {
-   if(dns_flags == 0) {
+   if(dns_priority == 0) {
if(str2sint(>body, _priority) < 0) {
LM_ERR("invalid priority: %.*s\n", 
pit->body.len,
pit->body.s);
@@ -463,7 +463,7 @@ static int corex_dns_cache_param_add(str *pval)
}
} else if(pit->name.len == 6
  && strncasecmp(pit->name.s, "weight", 6) == 
0) {
-   if(dns_flags == 0) {
+   if(dns_weight == 0) {
if(str2sint(>body, _weight) < 0) {
LM_ERR("invalid weight: %.*s\n", 
pit->body.len,
pit->body.s);
@@ -472,7 +472,7 @@ static int corex_dns_cache_param_add(str *pval)
}
} else if(pit->name.len == 4
  && strncasecmp(pit->name.s, "port", 4) == 0) {
-   if(dns_flags == 0) {
+   if(dns_port == 0) {
if(str2sint(>body, _port) < 0) {
LM_ERR("invalid port: %.*s\n", 
pit->body.len, pit->body.s);
return -1;

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


<    1   2   3   4   5   6   7   8   9   10   >