Re: [sr-dev] [kamailio/kamailio] Support SCTP associations created towards same endpoint primary and secondary IP addresses on RHEL/Centos 8 (#2429)

2020-09-09 Thread Piotr Grabowski
FYI we had issue with other application using SCTP on RHEL 8.2 the result it 
that there will be a fix in Linux kernel shipped with RHEL.

https://github.com/netty/netty/issues/10455


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2429#issuecomment-689786931___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Segmentation fault occured in rpc_mod_print function in runtime. (#2460)

2020-09-09 Thread Andrey Deykunov
Thanks Daniel, I'll be testing it as soon as I deal with my current tasks.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2460#issuecomment-689740277___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Segmentation fault occured in rpc_mod_print function in runtime. (#2460)

2020-09-09 Thread Daniel-Constantin Mierla
I pushed a few commits in master branch trying to address this issue. I haven't 
implemented the memory mod stats, but as I could see in the code, it didn't 
seem to be protected for races on accessing the shm fragments.

You would need to test with master branch or by using patches from the next 
commits:

  * aa458a62f034c2cb57639bdc713ed3c51b0292c7
  * 761eb0616fea2a859a2c0abb652b22feb6f59859
  * 9645be245f899fa8ae11a6be045d2ef83fd66bf5


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2460#issuecomment-689687340___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Segmentation fault in rpc_mod_print function while shutting down server. (#2433)

2020-09-09 Thread Daniel-Constantin Mierla
I pushed a few commits in master branch trying to address this issue. I haven't 
implemented the memory mod stats, but as I could see in the code, it didn't 
seem to be protected for races on accessing the shm fragments.

You would need to test with master branch or by using patches from the next 
commits:

  * aa458a62f034c2cb57639bdc713ed3c51b0292c7
  * 761eb0616fea2a859a2c0abb652b22feb6f59859
  * 9645be245f899fa8ae11a6be045d2ef83fd66bf5



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2433#issuecomment-689687081___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:9645be24: core: mem - use own functions for shm mod stats get operation

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 9645be245f899fa8ae11a6be045d2ef83fd66bf5
URL: 
https://github.com/kamailio/kamailio/commit/9645be245f899fa8ae11a6be045d2ef83fd66bf5

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T18:44:46+02:00

core: mem - use own functions for shm mod stats get operation

- protect with global lock for shm stats

---

Modified: src/core/mem/f_malloc.c
Modified: src/core/mem/q_malloc.c
Modified: src/core/mem/tlsf_malloc.c

---

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

---

diff --git a/src/core/mem/f_malloc.c b/src/core/mem/f_malloc.c
index 2363700c0b..38f686ff2c 100644
--- a/src/core/mem/f_malloc.c
+++ b/src/core/mem/f_malloc.c
@@ -1367,6 +1367,16 @@ void fm_shm_sums(void* qmp)
fm_sums(qmp);
fm_shm_unlock();
 }
+void fm_shm_mod_get_stats(void *qmp, void **qm_rootp)
+{
+   fm_shm_lock();
+   fm_mod_get_stats(qmp, qm_rootp);
+   fm_shm_unlock();
+}
+void fm_shm_mod_free_stats(void *qm_rootp)
+{
+   fm_mod_free_stats(qm_rootp);
+}
 
 
 /**
@@ -1413,8 +1423,8 @@ int fm_malloc_init_shm_manager(void)
ma.xavailable = fm_shm_available;
ma.xsums  = fm_shm_sums;
ma.xdestroy   = fm_malloc_destroy_shm_manager;
-   ma.xmodstats  = fm_mod_get_stats;
-   ma.xfmodstats = fm_mod_free_stats;
+   ma.xmodstats  = fm_shm_mod_get_stats;
+   ma.xfmodstats = fm_shm_mod_free_stats;
ma.xglock = fm_shm_glock;
ma.xgunlock   = fm_shm_gunlock;
 
diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c
index b518bfab81..94f972eae9 100644
--- a/src/core/mem/q_malloc.c
+++ b/src/core/mem/q_malloc.c
@@ -1350,7 +1350,16 @@ void qm_shm_sums(void* qmp)
qm_sums(qmp);
qm_shm_unlock();
 }
-
+void qm_shm_mod_get_stats(void *qmp, void **qm_rootp)
+{
+   qm_shm_lock();
+   qm_mod_get_stats(qmp, qm_rootp);
+   qm_shm_unlock();
+}
+void qm_shm_mod_free_stats(void *qm_rootp)
+{
+   qm_mod_free_stats(qm_rootp);
+}
 
 /**
  * \brief Destroy memory pool
@@ -1396,8 +1405,8 @@ int qm_malloc_init_shm_manager(void)
ma.xavailable = qm_shm_available;
ma.xsums  = qm_shm_sums;
ma.xdestroy   = qm_malloc_destroy_shm_manager;
-   ma.xmodstats  = qm_mod_get_stats;
-   ma.xfmodstats = qm_mod_free_stats;
+   ma.xmodstats  = qm_shm_mod_get_stats;
+   ma.xfmodstats = qm_shm_mod_free_stats;
ma.xglock = qm_shm_glock;
ma.xgunlock   = qm_shm_gunlock;
 
diff --git a/src/core/mem/tlsf_malloc.c b/src/core/mem/tlsf_malloc.c
index 33bbf4869d..10db30264b 100644
--- a/src/core/mem/tlsf_malloc.c
+++ b/src/core/mem/tlsf_malloc.c
@@ -1607,6 +1607,16 @@ void tlsf_shm_sums(void* tlsfmp)
tlsf_sums(tlsfmp);
tlsf_shm_unlock();
 }
+void tlsf_shm_mod_get_stats(void *qmp, void **qm_rootp)
+{
+   tlsf_shm_lock();
+   tlsf_mod_get_stats(qmp, qm_rootp);
+   tlsf_shm_unlock();
+}
+void tlsf_shm_mod_free_stats(void *qm_rootp)
+{
+   tlsf_mod_free_stats(qm_rootp);
+}
 
 
 /**
@@ -1653,8 +1663,8 @@ int tlsf_malloc_init_shm_manager(void)
ma.xavailable = tlsf_shm_available;
ma.xsums  = tlsf_shm_sums;
ma.xdestroy   = tlsf_malloc_destroy_shm_manager;
-   ma.xmodstats  = tlsf_mod_get_stats;
-   ma.xfmodstats = tlsf_mod_free_stats;
+   ma.xmodstats  = tlsf_shm_mod_get_stats;
+   ma.xfmodstats = tlsf_shm_mod_free_stats;
ma.xglock = tlsf_shm_glock;
ma.xgunlock   = tlsf_shm_gunlock;
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:761eb061: kex: use mutex to sync the mod mem stats rpc commands

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 761eb0616fea2a859a2c0abb652b22feb6f59859
URL: 
https://github.com/kamailio/kamailio/commit/761eb0616fea2a859a2c0abb652b22feb6f59859

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T17:57:10+02:00

kex: use mutex to sync the mod mem stats rpc commands

- related to GH #2433

---

Modified: src/modules/kex/mod_stats.c

---

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

---

diff --git a/src/modules/kex/mod_stats.c b/src/modules/kex/mod_stats.c
index a19a3ed3c3..25e3285c78 100644
--- a/src/modules/kex/mod_stats.c
+++ b/src/modules/kex/mod_stats.c
@@ -35,7 +35,9 @@
 #include "../../core/pt.h"
 #include "../../core/sr_module.h"
 #include "../../core/events.h"
-#include "../../core/mem/f_malloc.h"
+#include "../../core/mem/pkg.h"
+#include "../../core/mem/shm.h"
+#include "../../core/locking.h"
 #include "../../core/rpc.h"
 #include "../../core/rpc_lookup.h"
 
@@ -47,6 +49,9 @@
 #define DBG_MOD_ALL_FLAG   3 /* 1|2  - print pkg+shm (1+2) memory 
stats */
 #define DBG_MOD_INF_FLAG   4 /* 1<<2 - print more info in the 
stats */
 
+
+static gen_lock_t *kex_rpc_mod_mem_stats_lock = NULL;
+
 /**
  *
  */
@@ -248,7 +253,9 @@ static void rpc_mod_mem_stats_mode(rpc_t *rpc, void *ctx, 
int fmode)
  */
 static void rpc_mod_mem_stats(rpc_t *rpc, void *ctx)
 {
-rpc_mod_mem_stats_mode(rpc, ctx, 0);
+   lock_get(kex_rpc_mod_mem_stats_lock);
+   rpc_mod_mem_stats_mode(rpc, ctx, 0);
+   lock_release(kex_rpc_mod_mem_stats_lock);
 }
 
 /**
@@ -256,7 +263,9 @@ static void rpc_mod_mem_stats(rpc_t *rpc, void *ctx)
  */
 static void rpc_mod_mem_statsx(rpc_t *rpc, void *ctx)
 {
-rpc_mod_mem_stats_mode(rpc, ctx, DBG_MOD_INF_FLAG);
+   lock_get(kex_rpc_mod_mem_stats_lock);
+   rpc_mod_mem_stats_mode(rpc, ctx, DBG_MOD_INF_FLAG);
+   lock_release(kex_rpc_mod_mem_stats_lock);
 }
 
 
@@ -275,6 +284,15 @@ rpc_export_t kex_mod_rpc[] = {
  */
 int mod_stats_init_rpc(void)
 {
+   kex_rpc_mod_mem_stats_lock = lock_alloc();
+   if(kex_rpc_mod_mem_stats_lock == NULL) {
+   LM_ERR("failed to allocate the lock\n");
+   return -1;
+   }
+   if(lock_init(kex_rpc_mod_mem_stats_lock) == NULL) {
+   LM_ERR("failed to init the lock\n");
+   return -1;
+   }
if (rpc_register_array(kex_mod_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:aa458a62: core: mem - define mem_counter struct in meminfo

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: aa458a62f034c2cb57639bdc713ed3c51b0292c7
URL: 
https://github.com/kamailio/kamailio/commit/aa458a62f034c2cb57639bdc713ed3c51b0292c7

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T17:50:24+02:00

core: mem - define mem_counter struct in meminfo

- it is the same for f/q/tlsf mallocs

---

Modified: src/core/mem/f_malloc.h
Modified: src/core/mem/meminfo.h
Modified: src/core/mem/q_malloc.h
Modified: src/core/mem/tlsf_malloc.h

---

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

---

diff --git a/src/core/mem/f_malloc.h b/src/core/mem/f_malloc.h
index d338f5c5d3..2bed0b8e53 100644
--- a/src/core/mem/f_malloc.h
+++ b/src/core/mem/f_malloc.h
@@ -241,17 +241,5 @@ void fm_sums(void* qmp);
 void fm_mod_get_stats(void* qm, void **fm_root);
 void fm_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-   const char *file;
-   const char *func;
-   const char *mname;
-   unsigned long line;
-
-   unsigned long size;
-   int count;
-
-   struct _mem_counter *next;
-} mem_counter;
-
 #endif
 #endif
diff --git a/src/core/mem/meminfo.h b/src/core/mem/meminfo.h
index 9c7760db34..8b69daa705 100644
--- a/src/core/mem/meminfo.h
+++ b/src/core/mem/meminfo.h
@@ -42,5 +42,17 @@ struct mem_info{
unsigned long total_frags; /** number of total memory fragments */
 };
 
+typedef struct _mem_counter{
+   const char *file;
+   const char *func;
+   const char *mname;
+   unsigned long line;
+
+   unsigned long size;
+   int count;
+
+   struct _mem_counter *next;
+} mem_counter;
+
 #endif
 
diff --git a/src/core/mem/q_malloc.h b/src/core/mem/q_malloc.h
index 71e248f527..85d3c86e60 100644
--- a/src/core/mem/q_malloc.h
+++ b/src/core/mem/q_malloc.h
@@ -174,17 +174,5 @@ void qm_sums(void* qm);
 void qm_mod_get_stats(void *qm, void **qm_root);
 void qm_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-   const char *file;
-   const char *func;
-   const char *mname;
-   unsigned long line;
-
-   unsigned long size;
-   int count;
-
-   struct _mem_counter *next;
-} mem_counter;
-
 #endif
 #endif
diff --git a/src/core/mem/tlsf_malloc.h b/src/core/mem/tlsf_malloc.h
index 3fce9cd1e9..4112634b95 100644
--- a/src/core/mem/tlsf_malloc.h
+++ b/src/core/mem/tlsf_malloc.h
@@ -89,18 +89,6 @@ unsigned long tlsf_available(tlsf_t pool);
 void tlsf_mod_get_stats(tlsf_t pool, void **root);
 void tlsf_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-   const char *file;
-   const char *func;
-   const char *mname;
-   unsigned long line;
-
-   unsigned long size;
-   int count;
-
-   struct _mem_counter *next;
-} mem_counter;
-
 #if defined(__cplusplus)
 };
 #endif


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.2:916110d5: core: skip abort() in free_lump() for LUMPFLAG_DUPED

2020-09-09 Thread Henning Westerholt
Module: kamailio
Branch: 5.2
Commit: 916110d55a1ec83e142bd5fc2e9df8f9a5505eca
URL: 
https://github.com/kamailio/kamailio/commit/916110d55a1ec83e142bd5fc2e9df8f9a5505eca

Author: Daniel-Constantin Mierla 
Committer: Henning Westerholt 
Date: 2020-09-09T14:43:01Z

core: skip abort() in free_lump() for LUMPFLAG_DUPED

- the LUMPFLAG_DUPED is set when duplicating lumps list for branch route
execution, but some functions such as set_body() may want to clean them
- report and minimal reproducing config by Henning Westerholt

(cherry picked from commit 57ee97f52dd90c86743b6fd6dd682285ef994e80)

---

Modified: src/core/data_lump.c

---

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

---

diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index 6417bee21a..83d04eca8a 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -452,14 +452,17 @@ struct lump* anchor_lump2(struct sip_msg* msg, int 
offset, int len,
 }
 
 
+/**
+ * free lump content
+ */
 void free_lump(struct lump* lmp)
 {
-   if (lmp && (lmp->op==LUMP_ADD)){
-   if (lmp->u.value){
-   if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
+   if (lmp && (lmp->op==LUMP_ADD)) {
+   if (lmp->u.value) {
+   if (lmp->flags & LUMPFLAG_SHMEM) {
LM_CRIT("non free-able lump: %p flags=%x\n", 
lmp, lmp->flags);
abort();
-   }else{
+   } else if(!(lmp->flags & LUMPFLAG_DUPED)) {
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.4:2ca2232b: core: skip abort() in free_lump() for LUMPFLAG_DUPED

2020-09-09 Thread Henning Westerholt
Module: kamailio
Branch: 5.4
Commit: 2ca2232b3cac72f7c03b37ef9db5a198462e6dfa
URL: 
https://github.com/kamailio/kamailio/commit/2ca2232b3cac72f7c03b37ef9db5a198462e6dfa

Author: Daniel-Constantin Mierla 
Committer: Henning Westerholt 
Date: 2020-09-09T14:42:40Z

core: skip abort() in free_lump() for LUMPFLAG_DUPED

- the LUMPFLAG_DUPED is set when duplicating lumps list for branch route
execution, but some functions such as set_body() may want to clean them
- report and minimal reproducing config by Henning Westerholt

(cherry picked from commit 57ee97f52dd90c86743b6fd6dd682285ef994e80)

---

Modified: src/core/data_lump.c

---

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

---

diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index 765dd5f988..a9a4880199 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -456,14 +456,17 @@ struct lump* anchor_lump2(struct sip_msg* msg, int 
offset, int len,
 }
 
 
+/**
+ * free lump content
+ */
 void free_lump(struct lump* lmp)
 {
-   if (lmp && (lmp->op==LUMP_ADD)){
-   if (lmp->u.value){
-   if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
+   if (lmp && (lmp->op==LUMP_ADD)) {
+   if (lmp->u.value) {
+   if (lmp->flags & LUMPFLAG_SHMEM) {
LM_CRIT("non free-able lump: %p flags=%x\n", 
lmp, lmp->flags);
abort();
-   }else{
+   } else if(!(lmp->flags & LUMPFLAG_DUPED)) {
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.3:b7efdb12: core: skip abort() in free_lump() for LUMPFLAG_DUPED

2020-09-09 Thread Henning Westerholt
Module: kamailio
Branch: 5.3
Commit: b7efdb12dd2e98c03c38565556169b553b8b6a0a
URL: 
https://github.com/kamailio/kamailio/commit/b7efdb12dd2e98c03c38565556169b553b8b6a0a

Author: Daniel-Constantin Mierla 
Committer: Henning Westerholt 
Date: 2020-09-09T14:42:25Z

core: skip abort() in free_lump() for LUMPFLAG_DUPED

- the LUMPFLAG_DUPED is set when duplicating lumps list for branch route
execution, but some functions such as set_body() may want to clean them
- report and minimal reproducing config by Henning Westerholt

(cherry picked from commit 57ee97f52dd90c86743b6fd6dd682285ef994e80)

---

Modified: src/core/data_lump.c

---

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

---

diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index 765dd5f988..a9a4880199 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -456,14 +456,17 @@ struct lump* anchor_lump2(struct sip_msg* msg, int 
offset, int len,
 }
 
 
+/**
+ * free lump content
+ */
 void free_lump(struct lump* lmp)
 {
-   if (lmp && (lmp->op==LUMP_ADD)){
-   if (lmp->u.value){
-   if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
+   if (lmp && (lmp->op==LUMP_ADD)) {
+   if (lmp->u.value) {
+   if (lmp->flags & LUMPFLAG_SHMEM) {
LM_CRIT("non free-able lump: %p flags=%x\n", 
lmp, lmp->flags);
abort();
-   }else{
+   } else if(!(lmp->flags & LUMPFLAG_DUPED)) {
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:57ee97f5: core: skip abort() in free_lump() for LUMPFLAG_DUPED

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 57ee97f52dd90c86743b6fd6dd682285ef994e80
URL: 
https://github.com/kamailio/kamailio/commit/57ee97f52dd90c86743b6fd6dd682285ef994e80

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T15:33:18+02:00

core: skip abort() in free_lump() for LUMPFLAG_DUPED

- the LUMPFLAG_DUPED is set when duplicating lumps list for branch route
execution, but some functions such as set_body() may want to clean them
- report and minimal reproducing config by Henning Westerholt

---

Modified: src/core/data_lump.c

---

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

---

diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index 765dd5f988..a9a4880199 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -456,14 +456,17 @@ struct lump* anchor_lump2(struct sip_msg* msg, int 
offset, int len,
 }
 
 
+/**
+ * free lump content
+ */
 void free_lump(struct lump* lmp)
 {
-   if (lmp && (lmp->op==LUMP_ADD)){
-   if (lmp->u.value){
-   if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
+   if (lmp && (lmp->op==LUMP_ADD)) {
+   if (lmp->u.value) {
+   if (lmp->flags & LUMPFLAG_SHMEM) {
LM_CRIT("non free-able lump: %p flags=%x\n", 
lmp, lmp->flags);
abort();
-   }else{
+   } else if(!(lmp->flags & LUMPFLAG_DUPED)) {
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b13431b6: core: more comments about data lump structure fields and options

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b13431b6fc7eec20096c5be46c8ce2e43931c45f
URL: 
https://github.com/kamailio/kamailio/commit/b13431b6fc7eec20096c5be46c8ce2e43931c45f

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T15:32:33+02:00

core: more comments about data lump structure fields and options

---

Modified: src/core/lump_struct.h

---

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


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] uac: contact_addr field added into db uacreg table (#2470)

2020-09-09 Thread Daniel-Constantin Mierla
I pushed your commits manually, then followed up with a few commits making the 
changes:

  * increased the size of contact_addr filed to 255 (it can have parameters and 
then can become long, e.g., cases for ims or mobile devices)
  * contact_addr is optional value on RPC add command, `.` can be provided in 
such case to use the modparam value (to be easier to have the existing mode in 
the future, when one does not want to add per record value
  * contact_addr is last parameter in RPC add command, being the last added 
(you made it the previous last, but existing deployments should be easier to 
upgrade their cli tools by adding at the end instead of in the middle of cli 
parameters)

No testing though, should there be any problem after my additions, just open a 
bug report.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2470#issuecomment-689502842___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:3c643c02: modules: readme files regenerated - uac ... [skip ci]

2020-09-09 Thread Kamailio Dev
Module: kamailio
Branch: master
Commit: 3c643c023626e0de744c4960f2a7af4a401f6df0
URL: 
https://github.com/kamailio/kamailio/commit/3c643c023626e0de744c4960f2a7af4a401f6df0

Author: Kamailio Dev 
Committer: Kamailio Dev 
Date: 2020-09-09T13:31:27+02:00

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

---

Modified: src/modules/uac/README

---

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

---

diff --git a/src/modules/uac/README b/src/modules/uac/README
index a018d29a16..ae8376ab15 100644
--- a/src/modules/uac/README
+++ b/src/modules/uac/README
@@ -524,6 +524,9 @@ modparam("uac", "reg_db_table", "uacreg")
username part of the Contact: URI will be the L_UUID field in the
database.
 
+   A contact_addr value in the uacreg table will override the parameter
+   for this particular entry.
+
Example 1.17. Set reg_contact_addr parameter
 ...
 modparam("uac", "reg_contact_addr", "192.168.1.2:5080")
@@ -,8 +1114,10 @@ event_route[uac:reply] {
  * flags
  * reg_delay
  * socket
+ * contact_addr
 
-   Use a dot (.) if no value should be set for auth_password or auth_ha1.
+   Use a dot (.) if no value should be set for auth_password, auth_ha1, or
+   contact_addr.
 
Example 1.45. uac.reg_add usage
 ...
@@ -1155,6 +1160,11 @@ event_route[uac:reply] {
  * reg_delay - delay initial registration with at least reg_delay
seconds, e.g.,: 3
 
+ * contact_addr - contact address to be used for this record instead
+   of reg_contact_addr module parameter, e.g.:, 192.168.0.125:5060. It
+   can be set to '.' (dot) to skip setting it and then
+   reg_contact_addr modparam is used.
+
  * socket - Used socket for sending out registration requests, e.g.:,
udp:192.168.0.125:5060
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] uac: contact_addr field added into db uacreg table (#2470)

2020-09-09 Thread Daniel-Constantin Mierla
Closed #2470.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2470#event-3745373314___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:177713c6: kamctl: regenerated db creation scripts for uacreg

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 177713c6e0fc51934779bd3e81e7a3278897d503
URL: 
https://github.com/kamailio/kamailio/commit/177713c6e0fc51934779bd3e81e7a3278897d503

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:29:44+02:00

kamctl: regenerated db creation scripts for uacreg

---

Modified: utils/kamctl/db_sqlite/uac-create.sql
Modified: utils/kamctl/mysql/uac-create.sql
Modified: utils/kamctl/oracle/uac-create.sql
Modified: utils/kamctl/postgres/uac-create.sql

---

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

---

diff --git a/utils/kamctl/db_sqlite/uac-create.sql 
b/utils/kamctl/db_sqlite/uac-create.sql
index 764e623e02..6ff05276a5 100644
--- a/utils/kamctl/db_sqlite/uac-create.sql
+++ b/utils/kamctl/db_sqlite/uac-create.sql
@@ -13,7 +13,7 @@ CREATE TABLE uacreg (
 expires INTEGER DEFAULT 0 NOT NULL,
 flags INTEGER DEFAULT 0 NOT NULL,
 reg_delay INTEGER DEFAULT 0 NOT NULL,
-contact_addr VARCHAR(128) DEFAULT '' NOT NULL,
+contact_addr VARCHAR(255) DEFAULT '' NOT NULL,
 socket VARCHAR(128) DEFAULT '' NOT NULL,
 CONSTRAINT uacreg_l_uuid_idx UNIQUE (l_uuid)
 );
diff --git a/utils/kamctl/mysql/uac-create.sql 
b/utils/kamctl/mysql/uac-create.sql
index b6c53f5dcf..a4560e6914 100644
--- a/utils/kamctl/mysql/uac-create.sql
+++ b/utils/kamctl/mysql/uac-create.sql
@@ -13,7 +13,7 @@ CREATE TABLE `uacreg` (
 `expires` INT DEFAULT 0 NOT NULL,
 `flags` INT DEFAULT 0 NOT NULL,
 `reg_delay` INT DEFAULT 0 NOT NULL,
-`contact_addr` VARCHAR(128) DEFAULT '' NOT NULL,
+`contact_addr` VARCHAR(255) DEFAULT '' NOT NULL,
 `socket` VARCHAR(128) DEFAULT '' NOT NULL,
 CONSTRAINT l_uuid_idx UNIQUE (`l_uuid`)
 );
diff --git a/utils/kamctl/oracle/uac-create.sql 
b/utils/kamctl/oracle/uac-create.sql
index fdad9316b1..88eb71c3e7 100644
--- a/utils/kamctl/oracle/uac-create.sql
+++ b/utils/kamctl/oracle/uac-create.sql
@@ -13,7 +13,7 @@ CREATE TABLE uacreg (
 expires NUMBER(10) DEFAULT 0 NOT NULL,
 flags NUMBER(10) DEFAULT 0 NOT NULL,
 reg_delay NUMBER(10) DEFAULT 0 NOT NULL,
-contact_addr VARCHAR2(128) DEFAULT '',
+contact_addr VARCHAR2(255) DEFAULT '',
 socket VARCHAR2(128) DEFAULT '',
 CONSTRAINT uacreg_l_uuid_idx  UNIQUE (l_uuid)
 );
diff --git a/utils/kamctl/postgres/uac-create.sql 
b/utils/kamctl/postgres/uac-create.sql
index 4fcce80f0e..c24c3b8ecc 100644
--- a/utils/kamctl/postgres/uac-create.sql
+++ b/utils/kamctl/postgres/uac-create.sql
@@ -13,7 +13,7 @@ CREATE TABLE uacreg (
 expires INTEGER DEFAULT 0 NOT NULL,
 flags INTEGER DEFAULT 0 NOT NULL,
 reg_delay INTEGER DEFAULT 0 NOT NULL,
-contact_addr VARCHAR(128) DEFAULT '' NOT NULL,
+contact_addr VARCHAR(255) DEFAULT '' NOT NULL,
 socket VARCHAR(128) DEFAULT '' NOT NULL,
 CONSTRAINT uacreg_l_uuid_idx UNIQUE (l_uuid)
 );


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:89656680: uac: docs - updates for uacreg contact addr field

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 89656680c6ff3aae00bbffae03131a1e983198dd
URL: 
https://github.com/kamailio/kamailio/commit/89656680c6ff3aae00bbffae03131a1e983198dd

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:26:54+02:00

uac: docs - updates for uacreg contact addr field

---

Modified: src/modules/uac/doc/uac_admin.xml

---

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

---

diff --git a/src/modules/uac/doc/uac_admin.xml 
b/src/modules/uac/doc/uac_admin.xml
index 42645e891a..d43b8afa0c 100644
--- a/src/modules/uac/doc/uac_admin.xml
+++ b/src/modules/uac/doc/uac_admin.xml
@@ -1359,12 +1359,13 @@ event_route[uac:reply] {
expires
flags
reg_delay
-   contact_addr
socket
+   contact_addr



-   Use a dot (.) if no value should be set for auth_password or 
auth_ha1.
+   Use a dot (.) if no value should be set for 
auth_password, auth_ha1,
+   or contact_addr.

 

@@ -1463,8 +1464,9 @@ event_route[uac:reply] {



-   contact_addr - Used contact 
address for sending out registration requests,
-   e.g.:, 192.168.0.125:5060
+   contact_addr - contact address to 
be used for this record
+   instead of reg_contact_addr module parameter, e.g.:, 
192.168.0.125:5060. It can
+   be set to '.' (dot) to skip setting it and then 
reg_contact_addr modparam is used.





___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b98ff23b: lib/srdb1/schema/entities.xml: increased contact_addr_len entity to 255

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b98ff23bb7acab26a3442925ea563f64db97360c
URL: 
https://github.com/kamailio/kamailio/commit/b98ff23bb7acab26a3442925ea563f64db97360c

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:28:32+02:00

lib/srdb1/schema/entities.xml: increased contact_addr_len entity to 255

- contact can have parameters that could end up being long (e.g., for
ims cases)

---

Modified: src/lib/srdb1/schema/entities.xml

---

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

---

diff --git a/src/lib/srdb1/schema/entities.xml 
b/src/lib/srdb1/schema/entities.xml
index 024851ec00..4ca1b6bfed 100644
--- a/src/lib/srdb1/schema/entities.xml
+++ b/src/lib/srdb1/schema/entities.xml
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:e7275114: uac: allow empty contact addr in rpc add command for uacreg

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: e72751147e0d6b5fd9ed32d23a7412d64fcb65eb
URL: 
https://github.com/kamailio/kamailio/commit/e72751147e0d6b5fd9ed32d23a7412d64fcb65eb

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:20:44+02:00

uac: allow empty contact addr in rpc add command for uacreg

- it has to be set to .
- contact_addr parameter moved to be last, to be easier to just add to
existing commands

---

Modified: src/modules/uac/uac_reg.c

---

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

---

diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c
index c636cc6cfa..379a544a7e 100644
--- a/src/modules/uac/uac_reg.c
+++ b/src/modules/uac/uac_reg.c
@@ -526,7 +526,7 @@ int reg_ht_add(reg_uac_t *reg)
return -1;
}
 
-   if (!reg->contact_addr.s || reg->contact_addr.len == 0) 
+   if (!reg->contact_addr.s || reg->contact_addr.len == 0)
{
reg->contact_addr=reg_contact_addr;
}
@@ -553,7 +553,7 @@ int reg_ht_add(reg_uac_t *reg)
memset(nr, 0, sizeof(reg_uac_t) + len);
nr->expires = reg->expires;
nr->flags   = reg->flags;
-   if (reg->reg_delay) 
+   if (reg->reg_delay)
nr->reg_delay = reg->reg_delay;
else if (reg_random_delay>0)
nr->reg_delay = kam_rand() % reg_random_delay;
@@ -594,9 +594,9 @@ int reg_ht_add(reg_uac_t *reg)
 }
 
 
- /**
-  *
-  */
+/**
+ *
+ */
 int reg_ht_rm(reg_uac_t *reg)
 {
unsigned int slot1, slot2;
@@ -2136,8 +2136,8 @@ static void rpc_uac_reg_add(rpc_t* rpc, void* ctx)
,
,
_delay,
-   _addr,
-   
+   ,
+   _addr
)<1)
{
rpc->fault(ctx, 400, "Invalid Parameters");
@@ -2154,6 +2154,10 @@ static void rpc_uac_reg_add(rpc_t* rpc, void* ctx)
reg.auth_ha1.len = 0;
}
 
+   if(reg.contact_addr.len==1 && reg.contact_addr.s[0] == '.') {
+   reg.contact_addr = reg_contact_addr;
+   }
+
if(uac_reg_check_password() < 0) {
rpc->fault(ctx, 500, "Failed to add record - invalid password 
or ha1");
return;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:2ddc45c1: kamctl: regenerated uacreg table creation scripts

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 2ddc45c10ccb5790b064599ea1aa89ed83abab84
URL: 
https://github.com/kamailio/kamailio/commit/2ddc45c10ccb5790b064599ea1aa89ed83abab84

Author: ovoshlook 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:15:59+02:00

kamctl: regenerated uacreg table creation scripts

---

Modified: utils/kamctl/db_berkeley/kamailio/uacreg
Modified: utils/kamctl/db_redis/kamailio/uacreg
Modified: utils/kamctl/db_sqlite/uac-create.sql
Modified: utils/kamctl/dbtext/kamailio/uacreg
Modified: utils/kamctl/mongodb/kamailio/uacreg.json
Modified: utils/kamctl/mysql/uac-create.sql
Modified: utils/kamctl/oracle/uac-create.sql
Modified: utils/kamctl/postgres/uac-create.sql
Modified: utils/kamctl/xhttp_pi/pi_framework.xml
Modified: utils/kamctl/xhttp_pi/uac-mod
Modified: utils/kamctl/xhttp_pi/uac-table

---

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


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:4ae04d52: lib/srdb1: added contact_addr column to uacreg table

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 4ae04d52d0bd33ee44222f5b7efeca18f52d6413
URL: 
https://github.com/kamailio/kamailio/commit/4ae04d52d0bd33ee44222f5b7efeca18f52d6413

Author: ovoshlook 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:15:27+02:00

lib/srdb1: added contact_addr column to uacreg table

---

Modified: src/lib/srdb1/schema/entities.xml
Modified: src/lib/srdb1/schema/uacreg.xml

---

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

---

diff --git a/src/lib/srdb1/schema/entities.xml 
b/src/lib/srdb1/schema/entities.xml
index acd7028967..024851ec00 100644
--- a/src/lib/srdb1/schema/entities.xml
+++ b/src/lib/srdb1/schema/entities.xml
@@ -1,5 +1,6 @@
 
 
+
 
 
 
diff --git a/src/lib/srdb1/schema/uacreg.xml b/src/lib/srdb1/schema/uacreg.xml
index bf967f2655..1da4d46f60 100644
--- a/src/lib/srdb1/schema/uacreg.xml
+++ b/src/lib/srdb1/schema/uacreg.xml
@@ -135,6 +135,14 @@
 Initial registration delay
 
 
+
+contact_addr
+string
+_addr_len;
+
+Used contact_addr in contact header for sending out 
requests,if not passed reg_contact_addr will be used instead
+
+
 
 socket
 string


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:f9950d1f: uac: support to set contact address in uacreg database record

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f9950d1fe3864cebc9e4249f1a7a28624139e1b9
URL: 
https://github.com/kamailio/kamailio/commit/f9950d1fe3864cebc9e4249f1a7a28624139e1b9

Author: ovoshlook 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:11:59+02:00

uac: support to set contact address in uacreg database record

- enable per registration contact address
- GH #2470

---

Modified: src/modules/uac/doc/uac_admin.xml
Modified: src/modules/uac/uac_reg.c
Modified: src/modules/uac/uac_reg.h

---

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


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] msrp: fixed IPv6 address parsing (#2472)

2020-09-09 Thread Daniel-Constantin Mierla
Can you test with commit 1cda029, I did a different approach to be sure there 
is `[` at beginning of host part, not to find `]` in uri parameters. The for 
the PV field, there is a function that already returns the ipv6 address with 
[]. I haven't tested, thus feedback on how it works is appreciated in order to 
backport.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2472#issuecomment-689490295___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:1cda0298: msrp: proper parsing ipv6 host part in uri

2020-09-09 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 1cda029885dd89e2ec46fe28a0d6f656aad19e7a
URL: 
https://github.com/kamailio/kamailio/commit/1cda029885dd89e2ec46fe28a0d6f656aad19e7a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-09-09T13:01:36+02:00

msrp: proper parsing ipv6 host part in uri

- enclose ipv6 address in square brackets for msrp pv
- related to #2472

---

Modified: src/modules/msrp/msrp_parser.c
Modified: src/modules/msrp/msrp_vars.c

---

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

---

diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c
index a6310cea93..4e5e67e130 100644
--- a/src/modules/msrp/msrp_parser.c
+++ b/src/modules/msrp/msrp_parser.c
@@ -491,10 +491,25 @@ int msrp_parse_uri(char *start, int len, msrp_uri_t *uri)
}
hook = >host;
hook->s = s;
+   if(*s == '[')
+   {
+   /* IPv6 */
+   p = q_memchr(s, ']', e - s);
+   if(p == NULL)
+   {
+   goto error;
+   }
+   s = p + 1;
+   hook->len = s - hook->s;
+   }
p = q_memchr(s, ':', e - s);
if(p!=NULL)
{
-   hook->len = p - hook->s;
+   if(hook->len == 0)
+   {
+   /* host len was not set yet */
+   hook->len = p - hook->s;
+   }
hook = >port;
s = p+1;
if(s>=e) goto error;
diff --git a/src/modules/msrp/msrp_vars.c b/src/modules/msrp/msrp_vars.c
index fddabde189..8384ff0910 100644
--- a/src/modules/msrp/msrp_vars.c
+++ b/src/modules/msrp/msrp_vars.c
@@ -283,7 +283,7 @@ int pv_get_msrp(sip_msg_t *msg,  pv_param_t *param, 
pv_value_t *res)
memcpy(p, "msrp://", 7);
p+=7;
}
-   strcpy(p, ip_addr2a(>tcpinfo->rcv->src_ip));
+   strcpy(p, ip_addr2strz(>tcpinfo->rcv->src_ip));
strcat(p, ":");
strcat(p, int2str(mf->tcpinfo->rcv->src_port, NULL));
s.len = strlen(s.s);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Daniel-Constantin Mierla
Thanks @grumvalski for handling this one!

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#issuecomment-689487821___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Federico Cabiddu
Closed #2466.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#event-3745219476___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.3:794861c8: httpa_asyc_client: set curl memory callbacks in module initialization

2020-09-09 Thread Federico Cabiddu
Module: kamailio
Branch: 5.3
Commit: 794861c8db50846599118fe7583f522200195d8d
URL: 
https://github.com/kamailio/kamailio/commit/794861c8db50846599118fe7583f522200195d8d

Author: Federico Cabiddu 
Committer: Federico Cabiddu 
Date: 2020-09-09T12:49:03+02:00

httpa_asyc_client: set curl memory callbacks in module initialization

---

Modified: src/modules/http_async_client/http_async_client_mod.c
Modified: src/modules/http_async_client/http_multi.c

---

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

---

diff --git a/src/modules/http_async_client/http_async_client_mod.c 
b/src/modules/http_async_client/http_async_client_mod.c
index 7bfbb004c9..d0b99daecb 100644
--- a/src/modules/http_async_client/http_async_client_mod.c
+++ b/src/modules/http_async_client/http_async_client_mod.c
@@ -275,6 +275,8 @@ static int mod_init(void)
return -1;
}
 
+   set_curl_mem_callbacks();
+
/* init faked sip msg */
if(faked_msg_init()<0) {
LM_ERR("failed to init faked sip msg\n");
diff --git a/src/modules/http_async_client/http_multi.c 
b/src/modules/http_async_client/http_multi.c
index 948171b519..cfe9ae9177 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -392,7 +392,6 @@ void set_curl_mem_callbacks(void)
LM_ERR ("invalid memory manager: %d\n", 
curl_memory_manager);
break;
}
-
 }
 
 int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
@@ -400,7 +399,6 @@ int init_http_multi(struct event_base *evbase, struct 
http_m_global *wg)
g = wg;
g->evbase = evbase;
 
-   set_curl_mem_callbacks();
 
g->multi = curl_multi_init();
LM_DBG("curl_multi %p initialized on global %p (evbase %p)\n", 
g->multi, g, evbase);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.4:4e0f9f88: httpa_asyc_client: set curl memory callbacks in module initialization

2020-09-09 Thread Federico Cabiddu
Module: kamailio
Branch: 5.4
Commit: 4e0f9f8869aaf364011413417ff6c95c032af16d
URL: 
https://github.com/kamailio/kamailio/commit/4e0f9f8869aaf364011413417ff6c95c032af16d

Author: Federico Cabiddu 
Committer: Federico Cabiddu 
Date: 2020-09-09T12:48:43+02:00

httpa_asyc_client: set curl memory callbacks in module initialization

---

Modified: src/modules/http_async_client/http_async_client_mod.c
Modified: src/modules/http_async_client/http_multi.c

---

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

---

diff --git a/src/modules/http_async_client/http_async_client_mod.c 
b/src/modules/http_async_client/http_async_client_mod.c
index 7bfbb004c9..d0b99daecb 100644
--- a/src/modules/http_async_client/http_async_client_mod.c
+++ b/src/modules/http_async_client/http_async_client_mod.c
@@ -275,6 +275,8 @@ static int mod_init(void)
return -1;
}
 
+   set_curl_mem_callbacks();
+
/* init faked sip msg */
if(faked_msg_init()<0) {
LM_ERR("failed to init faked sip msg\n");
diff --git a/src/modules/http_async_client/http_multi.c 
b/src/modules/http_async_client/http_multi.c
index b5c2e8d637..9ed1b2dc92 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -385,7 +385,6 @@ void set_curl_mem_callbacks(void)
LM_ERR ("invalid memory manager: %d\n", 
curl_memory_manager);
break;
}
-
 }
 
 int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
@@ -393,7 +392,6 @@ int init_http_multi(struct event_base *evbase, struct 
http_m_global *wg)
g = wg;
g->evbase = evbase;
 
-   set_curl_mem_callbacks();
 
g->multi = curl_multi_init();
LM_DBG("curl_multi %p initialized on global %p (evbase %p)\n", 
g->multi, g, evbase);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Federico Cabiddu
Thanks for testing Joey, the branch is now merged in master. I'll also
backport it to stable branches.

On Wed, Sep 9, 2020 at 11:57 AM Henning Westerholt 
wrote:

> Reopened #2466 .
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> , or
> unsubscribe
> 
> .
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
>
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:66fea7c6: httpa_asyc_client: set curl memory callbacks in module initialization

2020-09-09 Thread Federico Cabiddu
Module: kamailio
Branch: master
Commit: 66fea7c615e01b200b334d5255c90911cfb360fe
URL: 
https://github.com/kamailio/kamailio/commit/66fea7c615e01b200b334d5255c90911cfb360fe

Author: Federico Cabiddu 
Committer: Federico Cabiddu 
Date: 2020-09-08T15:05:37+02:00

httpa_asyc_client: set curl memory callbacks in module initialization

---

Modified: src/modules/http_async_client/http_async_client_mod.c
Modified: src/modules/http_async_client/http_multi.c

---

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

---

diff --git a/src/modules/http_async_client/http_async_client_mod.c 
b/src/modules/http_async_client/http_async_client_mod.c
index 7bfbb004c9..d0b99daecb 100644
--- a/src/modules/http_async_client/http_async_client_mod.c
+++ b/src/modules/http_async_client/http_async_client_mod.c
@@ -275,6 +275,8 @@ static int mod_init(void)
return -1;
}
 
+   set_curl_mem_callbacks();
+
/* init faked sip msg */
if(faked_msg_init()<0) {
LM_ERR("failed to init faked sip msg\n");
diff --git a/src/modules/http_async_client/http_multi.c 
b/src/modules/http_async_client/http_multi.c
index b5c2e8d637..9ed1b2dc92 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -385,7 +385,6 @@ void set_curl_mem_callbacks(void)
LM_ERR ("invalid memory manager: %d\n", 
curl_memory_manager);
break;
}
-
 }
 
 int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
@@ -393,7 +392,6 @@ int init_http_multi(struct event_base *evbase, struct 
http_m_global *wg)
g = wg;
g->evbase = evbase;
 
-   set_curl_mem_callbacks();
 
g->multi = curl_multi_init();
LM_DBG("curl_multi %p initialized on global %p (evbase %p)\n", 
g->multi, g, evbase);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Henning Westerholt
Reopened #2466.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#event-3745003813___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Henning Westerholt
Thanks for the feedback. Re-open this as it still needs to be merged into main 
git branch and probably stable branches.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#issuecomment-689458260___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Joey Golan
Hi @grumvalski, I have tested the branch with your changes and it looks like it 
fixes the problem.
Very well.. Thank you!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#issuecomment-689455733___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 5.4.1 - Crash on startup when TLS is enabled after upgrading from stretch to buster (#2466)

2020-09-09 Thread Joey Golan
Closed #2466.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2466#event-3744983161___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio-5.4.0 : Crashes from keepalive module (#2448)

2020-09-09 Thread sagarmalam
@NGSegovia , While testing latest fixes we have found that Keepalive module is 
leaking memory. We are testing with 7K destinations with time interval of 20 
seconds
This log file has output of : kamcmd mod.stats keepalive shm for every sec : 
[keepalive_memory_consumption.log](https://github.com/kamailio/kamailio/files/5194119/keepalive_memory_consumption.log)

At Wed Sep  9 09:02:07 GMT 2020 it is 3 MB 
At Wed Sep  9 09:33:47 GMT 2020 it is 47 MB
So 42 MB consumed within 30 mins and growing.

Kamailio core dumped after running for 24 hours with 5GB SHM memory.
core dump : 
[coredump.txt](https://github.com/kamailio/kamailio/files/5194043/coredump.txt)

Kamailio logs : 
[kamailio.log](https://github.com/kamailio/kamailio/files/5194055/kamailio.log)

Please get back to me in case you need any more information. 
Thanks a lot

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2448#issuecomment-689451262___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev