[sr-dev] git:master:16302854: db_redis: replace use of grep -P

2023-12-21 Thread Victor Seva via sr-dev
Module: kamailio
Branch: master
Commit: 163028549df3abd3173a7c0ac8a9dc666c0e4879
URL: 
https://github.com/kamailio/kamailio/commit/163028549df3abd3173a7c0ac8a9dc666c0e4879

Author: Victor Seva 
Committer: Victor Seva 
Date: 2023-12-22T08:53:32+01:00

db_redis: replace use of grep -P

PCRE option is been removed in BusyBox #3686

---

Modified: src/modules/db_redis/Makefile

---

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

---

diff --git a/src/modules/db_redis/Makefile b/src/modules/db_redis/Makefile
index 815cd056b9d..85d9b9a956f 100644
--- a/src/modules/db_redis/Makefile
+++ b/src/modules/db_redis/Makefile
@@ -30,7 +30,7 @@ else
HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
HIREDISLIBSPATH = $(shell $(HIREDIS_BUILDER) --libs-only-L | cut -c 3-)
 ifeq ($(HIREDISLIBSPATH),)
-GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Po 
'^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ')
+GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Eo 
'^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ')
 ifneq ($(shell find $(GCCSEARCHDIRS) -name libhiredis_ssl.so 
2>/dev/null),)
HIREDISDEFS += -DWITH_SSL
HIREDISLIBS += -lhiredis_ssl

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


[sr-dev] git:master:ca450901: ndb_redis: replace use of grep -P

2023-12-21 Thread Victor Seva via sr-dev
Module: kamailio
Branch: master
Commit: ca4509013a123f02d6d9c09d016fce3fea3e3dbe
URL: 
https://github.com/kamailio/kamailio/commit/ca4509013a123f02d6d9c09d016fce3fea3e3dbe

Author: Victor Seva 
Committer: Victor Seva 
Date: 2023-12-22T08:53:45+01:00

ndb_redis: replace use of grep -P

PCRE option is been removed in BusyBox #3686

---

Modified: src/modules/ndb_redis/Makefile

---

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

---

diff --git a/src/modules/ndb_redis/Makefile b/src/modules/ndb_redis/Makefile
index ba085ca2735..429b69d6ea3 100644
--- a/src/modules/ndb_redis/Makefile
+++ b/src/modules/ndb_redis/Makefile
@@ -24,7 +24,7 @@ else
HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
HIREDISLIBSPATH = $(shell $(HIREDIS_BUILDER) --libs-only-L | cut -c 3-)
 ifeq ($(HIREDISLIBSPATH),)
-GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Po 
'^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ')
+GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Eo 
'^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ')
 ifneq ($(shell find $(GCCSEARCHDIRS) -name libhiredis_ssl.so 
2>/dev/null),)
 HIREDISDEFS += -DWITH_SSL
 HIREDISLIBS += -lhiredis_ssl

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


[sr-dev] Re: [kamailio/kamailio] build error on Alpine: grep -P not supported in BusyBox anymore (Issue #3686)

2023-12-21 Thread Victor Seva via sr-dev
Closed #3686 as completed.

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

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


[sr-dev] [kamailio/kamailio] build error on Alpine: grep -P not supported in BusyBox anymore (Issue #3686)

2023-12-21 Thread Victor Seva via sr-dev
### Description

It seems PCRE is not supported anymore

```
make[2]: --libs: No such file or directory
grep: unrecognized option: P
BusyBox v1.36.1 (2023-12-20 14:59:51 UTC) multi-call binary.
```



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3686
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] [pua] reginfo_increase_version does nothing (Issue #3234)

2023-12-21 Thread Matteo via sr-dev
Sure, I'll be able to test it in the very beginning of the new year, will keep 
you posted.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3234#issuecomment-1866982085
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] Dialogs loaded from the DB are no longer saved. (Issue #3669)

2023-12-21 Thread Dennis via sr-dev
I have tested all 3 DB modes with my latest modifications, the results look 
correct:

```
=== Test mode 1 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 1)

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

>> make 2 calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 1536
dflags: 1536

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

>> terminate calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

=== Mode 1 looks good.


=== Test mode 2 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_update_period", 5)


# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


>> make 2 calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 1
dflags: 1538
dflags: 1667
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 1536
dflags: 1536

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0


>> terminate calls

... after 5 seconds

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

=== Mode 2 looks good



=== Test mode 3 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 3)

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


>> make 2 calls


# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1667
dflags: 1667

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

>>terminate calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


=== Mode 3 loos good also.
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866618262
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] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)

2023-12-21 Thread Dennis via sr-dev
I have tested all 3 DB modes with my latest modifications, the results look 
correct:

```
=== Test mode 1 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 1)

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

>> make 2 calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 1536
dflags: 1536

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

>> terminate calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

=== Mode 1 looks good.


=== Test mode 2 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_update_period", 5)


# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


>> make 2 calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 1
dflags: 1538
dflags: 1667
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 1536
dflags: 1536

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
dflags: 0
dflags: 0


>> terminate calls

... after 5 seconds

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

=== Mode 2 looks good



=== Test mode 3 ===
modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db")
modparam("dialog", "db_mode", 3)

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


>> make 2 calls


# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1667
dflags: 1667

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

# systemctl restart kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 2
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
dflags: 1
dflags: 1

>>terminate calls

# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0

# systemctl stop kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0
ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such 
file or directory [2]

# systemctl start kamailio
# echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd 
dlg.list|grep dflags
dlgs: 0


=== Mode 3 looks good also.
```




-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866616202
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] Re: [kamailio/kamailio] [pua] reginfo_increase_version does nothing (Issue #3234)

2023-12-21 Thread Xenofon Karamanos via sr-dev
Hey @xadhoom,

A commit has been made in 4c93985 that probably fixes this, can you maybe help 
and confirm it works?

Thanks

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3234#issuecomment-1866586959
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:4c939854: pua: fix possible copy/paste error, we should use reginfo_increase_version for reginfo events (GH #3234)

2023-12-21 Thread Henning Westerholt via sr-dev
Module: kamailio
Branch: master
Commit: 4c93985437122706bc68143b2f96a9d7f35be16d
URL: 
https://github.com/kamailio/kamailio/commit/4c93985437122706bc68143b2f96a9d7f35be16d

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2023-12-21T16:10:25Z

pua: fix possible copy/paste error, we should use reginfo_increase_version for 
reginfo events (GH #3234)

---

Modified: src/modules/pua/add_events.c

---

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

---

diff --git a/src/modules/pua/add_events.c b/src/modules/pua/add_events.c
index e2fc78be3ee..bf4a437e4b4 100644
--- a/src/modules/pua/add_events.c
+++ b/src/modules/pua/add_events.c
@@ -82,7 +82,7 @@ int pua_add_events(void)
}
 
/* add application/reginfo+xml */
-   if(dlginfo_increase_version) {
+   if(reginfo_increase_version) {
if(add_pua_event(REGINFO_EVENT, "reg", 
"application/reginfo+xml",
   reginfo_process_body)
< 0) {

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


[sr-dev] git:master:ac4fa112: tmx: use unsigned for bitwise operations

2023-12-21 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: ac4fa1129f5fbd1a48aad1b7dc21a2c130ecd164
URL: 
https://github.com/kamailio/kamailio/commit/ac4fa1129f5fbd1a48aad1b7dc21a2c130ecd164

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2023-12-21T16:05:04+01:00

tmx: use unsigned for bitwise operations

---

Modified: src/modules/tmx/tmx_pretran.c

---

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

---

diff --git a/src/modules/tmx/tmx_pretran.c b/src/modules/tmx/tmx_pretran.c
index dcaebd1f41b..7600a3c7b4b 100644
--- a/src/modules/tmx/tmx_pretran.c
+++ b/src/modules/tmx/tmx_pretran.c
@@ -72,19 +72,20 @@ static int _tmx_ptran_size = 0;
  */
 int tmx_init_pretran_table(void)
 {
-   int n;
-   int pn;
+   unsigned int n;
+   unsigned int pn;
 
-   pn = get_max_procs();
+   pn = (unsigned int)get_max_procs();
 
-   if(pn <= 0)
+   if(pn == 0)
return -1;
if(_tmx_ptran_table != NULL)
return -1;
+   n = 1;
/* get the highest power of two less than number of processes */
-   n = -1;
-   while(pn >> ++n > 0)
-   ;
+   while((pn >> n) > 0) {
+   n++;
+   }
n--;
if(n <= 1)
n = 2;

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


[sr-dev] Re: [kamailio/kamailio] dmq_usrloc: DMQ also copies and sends attributes related to contacts (PR #3679)

2023-12-21 Thread Xenofon Karamanos via sr-dev
Hey Daniel,
 
Besides the order change of destroy, it copies to the new contact the `xavp` 
from incoming `ucontact_t` argument just like the rest of the fields. 

If the config variable `xavp_contact` is found and not empty, then 
`ucontact_xavp_store` destroy this xavp and fills it up with whatever is 
contained inside. 

Some doubts i had, is whether i shall `c->xavp = _ci->xavp;` or `   
_c->xavp = xavp_clone_level_nodata(_ci->xavp);` or `xavp_add(_ci->xavp, 
>xavp)`. What is the difference between all these methods?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3679#issuecomment-1866272393
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] dmq_usrloc: DMQ also copies and sends attributes related to contacts (PR #3679)

2023-12-21 Thread Xenofon Karamanos via sr-dev
@xkaraman commented on this pull request.



> @@ -825,6 +837,16 @@ int usrloc_dmq_send_contact(
srjson_AddNumberToObject(, jdoc.root, "reg_id", ptr->reg_id);
srjson_AddNumberToObject(, jdoc.root, "server_id", ptr->server_id);
 
+   /*  Loop through Χavp attributes of the contact and and create a json 
object */
+   srjson_t *jdoc_xavp = srjson_CreateObject();

Fixed on some other variables too on the newly static functions.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3679#discussion_r1434085417
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] dmq_usrloc: DMQ also copies and sends attributes related to contacts (PR #3679)

2023-12-21 Thread Xenofon Karamanos via sr-dev
@xkaraman pushed 2 commits.

a192e503f58507fdca4dc5cb861a4dc309873e81  dmq_usrloc: Transfer attributes
6673124597eb94bcf00d81c5e2598d4eee7ee832  usrloc: Modify destroy order and 
contact xavp

-- 
View it on GitHub:
https://github.com/kamailio/kamailio/pull/3679/files/3d79568e13f5fbc947ad1452244bf1cb527b45a2..6673124597eb94bcf00d81c5e2598d4eee7ee832
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:4399fe39: sms: define buffer size for name field

2023-12-21 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 4399fe3966f6774b18e02ea6e54a5ba132c7c4ab
URL: 
https://github.com/kamailio/kamailio/commit/4399fe3966f6774b18e02ea6e54a5ba132c7c4ab

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2023-12-21T13:56:28+01:00

sms: define buffer size for name field

- check size before copy and trucate large messages

---

Modified: src/modules/sms/libsms_getsms.c
Modified: src/modules/sms/sms_funcs.h

---

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

---

diff --git a/src/modules/sms/libsms_getsms.c b/src/modules/sms/libsms_getsms.c
index 0f6df6b7341..ea258ccf673 100644
--- a/src/modules/sms/libsms_getsms.c
+++ b/src/modules/sms/libsms_getsms.c
@@ -279,6 +279,7 @@ static int splitascii(struct modem *mdm, char *source, 
struct incame_sms *sms)
char *end;
char tbuf[TIME_LEN + 1];
char dbuf[DATE_LEN + 1];
+   int l1 = 0;
 
/* the text is after the \r */
for(start = source; *start && *start != '\r'; start++)
@@ -313,7 +314,13 @@ static int splitascii(struct modem *mdm, char *source, 
struct incame_sms *sms)
return 1;
}
*end = 0;
-   strcpy(sms->name, start);
+   l1 = strlen(start);
+   if(l1 >= SMS_NAME_LEN) {
+   /* truncate */
+   l1 = SMS_NAME_LEN - 1;
+   }
+   memcpy(sms->name, start, l1);
+   sms->name[l1] = '\0';
}
/* Get the date */
start = end + 3;
diff --git a/src/modules/sms/sms_funcs.h b/src/modules/sms/sms_funcs.h
index e49427c91b7..4123b92c514 100644
--- a/src/modules/sms/sms_funcs.h
+++ b/src/modules/sms/sms_funcs.h
@@ -91,10 +91,11 @@ struct sms_msg
int ref;
 };
 
+#define SMS_NAME_LEN 64
 struct incame_sms
 {
char sender[31];
-   char name[64];
+   char name[SMS_NAME_LEN];
char date[DATE_LEN];
char time[TIME_LEN];
char ascii[500];

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


[sr-dev] Re: [kamailio/kamailio] dmq_usrloc: DMQ also copies and sends attributes related to contacts (PR #3679)

2023-12-21 Thread Daniel-Constantin Mierla via sr-dev
The commit for usrloc #3d79568 does not only change the destroy order, is it 
also fixing something?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3679#issuecomment-1866178136
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] dmq_usrloc: DMQ also copies and sends attributes related to contacts (PR #3679)

2023-12-21 Thread Daniel-Constantin Mierla via sr-dev
@miconda commented on this pull request.



> @@ -825,6 +837,16 @@ int usrloc_dmq_send_contact(
srjson_AddNumberToObject(, jdoc.root, "reg_id", ptr->reg_id);
srjson_AddNumberToObject(, jdoc.root, "server_id", ptr->server_id);
 
+   /*  Loop through Χavp attributes of the contact and and create a json 
object */
+   srjson_t *jdoc_xavp = srjson_CreateObject();

Variable should be declared at the beginning of the block to be coherent and 
also keep compliant with older C standards.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3679#pullrequestreview-1792886476
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] Dialogs loaded from the DB are no longer saved. (Issue #3669)

2023-12-21 Thread Dennis via sr-dev
> You should probably only do this if:
> if(dlg_db_mode == DB_MODE_SHUTDOWN) {

Yes, i missed it, will test all the db modes.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866163424
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:b2045d55: pv: remove another redunant variable definition related commit 8ed4165fd3b0a33

2023-12-21 Thread Henning Westerholt via sr-dev
Module: kamailio
Branch: master
Commit: b2045d559ed720789df80f543fc00923a07ada83
URL: 
https://github.com/kamailio/kamailio/commit/b2045d559ed720789df80f543fc00923a07ada83

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2023-12-21T11:54:52Z

pv: remove another redunant variable definition related commit 8ed4165fd3b0a33

---

Modified: src/modules/pv/pv_core.c

---

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

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 1c822d014fa..03d025bba2f 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2479,7 +2479,7 @@ int pv_get_hfl(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
while(paib != NULL) {
if(n + paib->num_ids > idx) {
/* Calculate the index within this specific 
list */
-   int innerIndex = idx - n;
+   innerIndex = idx - n;
 
/* Access the desired element within this list 
*/
sval.s = paib->id[innerIndex].body.s;

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


[sr-dev] git:master:0547a4be: pv: remove another redunant variable definition (warning: unused variable ??????innerIndex??????)

2023-12-21 Thread Henning Westerholt via sr-dev
Module: kamailio
Branch: master
Commit: 0547a4becbc6a48fdc473cfd26cdeedfa2a9317d
URL: 
https://github.com/kamailio/kamailio/commit/0547a4becbc6a48fdc473cfd26cdeedfa2a9317d

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2023-12-21T11:34:14Z

pv: remove another redunant variable definition (warning: unused variable 
??innerIndex??)

---

Modified: src/modules/pv/pv_core.c

---

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

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 5375e95c418..1c822d014fa 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2427,7 +2427,7 @@ int pv_get_hfl(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
while(ppib != NULL) {
if(n + ppib->num_ids > idx) {
/* Calculate the index within this specific 
list */
-   int innerIndex = idx - n;
+   innerIndex = idx - n;
 
/* Access the desired element within this list 
*/
sval.s = ppib->id[innerIndex].body.s;

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


[sr-dev] git:master:8ed4165f: pv: remove redunant variable definition (warning: unused variable ??????innerIndex??????)

2023-12-21 Thread Henning Westerholt via sr-dev
Module: kamailio
Branch: master
Commit: 8ed4165fd3b0a331a4580894e2e7f83456b474fa
URL: 
https://github.com/kamailio/kamailio/commit/8ed4165fd3b0a331a4580894e2e7f83456b474fa

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2023-12-21T11:23:51Z

pv: remove redunant variable definition (warning: unused variable 
??innerIndex??)

---

Modified: src/modules/pv/pv_core.c

---

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

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 4b8f98bcfd3..5375e95c418 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2375,7 +2375,7 @@ int pv_get_hfl(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
while(db != NULL) {
if(n + db->num_ids > idx) {
/* Calculate the index within this specific 
list */
-   int innerIndex = idx - n;
+   innerIndex = idx - n;
 
/* Access the desired element within this list 
*/
sval.s = db->id[innerIndex].body.s;

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


[sr-dev] Re: [kamailio/kamailio] [pua] reginfo_increase_version does nothing (Issue #3234)

2023-12-21 Thread Henning Westerholt via sr-dev
@xkaraman 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3234#issuecomment-1866055685
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] Dialogs loaded from the DB are no longer saved. (Issue #3669)

2023-12-21 Thread Morten Tryfoss via sr-dev
I suspect that might cause duplicate entry if any other db mode is used, after 
restore and then something that causes a change to the dialog - or even, not 
being deleted correctly since the DLG_FLAG_NEW flag is set.

Please have a look at the remove_dialog_from_db() function. This will return on 
dialog termination if the flag is set, without deleting from database.

You should probably only do this if:
if(dlg_db_mode == DB_MODE_SHUTDOWN) {

But there may be need to set flags differently for other modes.
It's important to test all modes that can be used when doing such a change.

If opening a pull request, please keep in mind clang-formating of the patch. 
Your commit will fail on this check.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3669#issuecomment-1865922535
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