[sr-dev] git:master:c836bca7: Makefile.groups: added build group for nats module

2021-06-28 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: c836bca76551b76836f03a612c2a913284729622
URL: 
https://github.com/kamailio/kamailio/commit/c836bca76551b76836f03a612c2a913284729622

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2021-06-28T23:03:47+02:00

Makefile.groups: added build group for nats module

---

Modified: src/Makefile.groups

---

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

---

diff --git a/src/Makefile.groups b/src/Makefile.groups
index 42c036d670..4eea749671 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -223,6 +223,9 @@ mod_list_kafka=kafka
 # - modules depending on mqtt mosquitto and ev library
 mod_list_mqtt=mqtt
 
+# - modules depending on nats and ev library
+mod_list_nats=nats
+
 # - modules depending on secsipid library
 mod_list_secsipid=secsipid secsipid_proc
 
@@ -264,6 +267,7 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \
   $(mod_list_phonenum) \
   $(mod_list_kafka) \
   $(mod_list_mqtt) \
+  $(mod_list_nats) \
   $(mod_list_secsipid) \
   $(mod_list_jwt) \
   $(mod_list_lwsc) \
@@ -497,6 +501,9 @@ module_group_kkafka=$(mod_list_kafka)
 # K mqtt modules
 module_group_kmqtt=$(mod_list_mqtt)
 
+# K nats modules
+module_group_knats=$(mod_list_nats)
+
 # K secsipid modules
 module_group_ksecsipid=$(mod_list_secsipid)
 


___
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] nats: new nats message consumer module (#2790)

2021-06-28 Thread Sergey Safarov
Maybe
q_

On Mon, Jun 28, 2021, 2:15 PM Henning Westerholt  wrote:

> Think the same, as we have already three modules implementing message
> queues:
>
>
>
> - mqtt
>
> - rabbitmq
>
> - kazoo
>
>
>
> I was thinking of “mq_” prefix, but this obviously do not fit well to the
> existing names.
>
>
>
> Cheers,
>
>
>
> Henning
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-dev  *On Behalf Of *Olle E.
> Johansson
> *Sent:* Monday, June 28, 2021 1:10 PM
> *To:* Kamailio (SER) - Development Mailing List  >
> *Subject:* Re: [sr-dev] [kamailio/kamailio] nats: new nats message
> consumer module (#2790)
>
>
>
> I find the name with potential to create confusion, being closed to NAT and
> we all know how popular that is and what it refers to in VoIP, but at the
> end I am fine with it given that it is the name of the external project.
> Maybe in the future if we end up with many distributed messaging platform
> modules, we can add a common prefix to all of them like we added for db
> module in the past.
>
> “msg_”
>
> “mbr_”
>
> “mbus_”
>
>
>
> Adding a prefix is a good thing.
>
>
>
> /O
>
>
>
> On 28 Jun 2021, at 09:42, Daniel-Constantin Mierla <
> notificati...@github.com> wrote:
>
>
>
>
>
> Thanks for the new module!
>
> I find the name with potential to create confusion, being closed to NAT
> and we all know how popular that is and what it refers to in VoIP, but at
> the end I am fine with it given that it is the name of the external
> project. Maybe in the future if we end up with many distributed messaging
> platform modules, we can add a common prefix to all of them like we added
> for db module in the past.
>
> Regarding the code, I noticed that shm/pkg_malloc() results are not
> checked for NULL, which will result in crashes on low/out of memory cases.
> @eschmidbauer  has already git commit
> access, so I am fine to merge it and then push follow up commits for memory
> allocation checks.
>
> —
> 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
>
___
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] nats: make sure pkg & shm memory is allocated; check pointers before freeing memory (#2792)

2021-06-28 Thread Emmanuel Schmidbauer
@eschmidbauer pushed 1 commit.

b95b2448d7e968c2bff59e1d820764defee104aa  nats: make sure pkg & shm memory is 
allocated; check pointers before freeing memory


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/2792/files/9fb784f5e8f24fcab5f1d2cf7ccdd83d0089b44d..b95b2448d7e968c2bff59e1d820764defee104aa
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] nats: make sure pkg & shm memory is allocated; check pointers before freeing memory (#2792)

2021-06-28 Thread Emmanuel Schmidbauer
…freeing memory

!-- Kamailio Pull Request Template --

!--
IMPORTANT:
  - for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
  - pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
  - backports to stable branches must be done with git cherry-pick -x 
...
  - code is contributed under BSD for core and main components (tm, sl, auth, 
tls)
  - code is contributed GPLv2 or a compatible license for the other components
  - GPL code is contributed with OpenSSL licensing exception
--

 Pre-Submission Checklist
!-- Go over all points below, and after creating the PR, tick all the 
checkboxes that apply --
!-- All points should be verified, otherwise, read the CONTRIBUTING 
guidelines from above--
!-- If youre unsure about any of these, dont hesitate to ask on 
sr-dev mailing list --
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:
!-- Go over all points below, and after creating the PR, tick the 
checkboxes that apply --
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description
!-- Describe your changes in detail --
as per @micondas suggestion, added memory checks

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2792

-- Commit Summary --

  * nats: make sure pkg  shm memory is allocated; check pointers before 
freeing memory

-- File Changes --

M src/modules/nats/nats_mod.c (69)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/2792.patch
https://github.com/kamailio/kamailio/pull/2792.diff

-- 
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/2792
___
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] nats: new nats message consumer module (#2790)

2021-06-28 Thread Emmanuel Schmidbauer
Merged #2790 into master.

-- 
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/2790#event-4946634762___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:480969f2: Merge pull request #2790 from kamailio/nats-module

2021-06-28 Thread GitHub
Module: kamailio
Branch: master
Commit: 480969f28d2b539b31df5d4ff292c0ab95f30d17
URL: 
https://github.com/kamailio/kamailio/commit/480969f28d2b539b31df5d4ff292c0ab95f30d17

Author: Emmanuel Schmidbauer 
Committer: GitHub 
Date: 2021-06-28T06:44:52-04:00

Merge pull request #2790 from kamailio/nats-module

nats: new nats message consumer module

---

Added: src/modules/nats/Makefile
Added: src/modules/nats/doc/Makefile
Added: src/modules/nats/doc/nats.xml
Added: src/modules/nats/doc/nats_admin.xml
Added: src/modules/nats/nats_mod.c
Added: src/modules/nats/nats_mod.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/480969f28d2b539b31df5d4ff292c0ab95f30d17.diff
Patch: 
https://github.com/kamailio/kamailio/commit/480969f28d2b539b31df5d4ff292c0ab95f30d17.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] add debuginfo on dist other then x86 (#2789)

2021-06-28 Thread sergey-safarov
```
[root@logger-west kamailio]# make cfg
make -C src/ cfg 
make[1]: Entering directory '/root/kamailio/src'
target architecture , host architecture 
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory '/root/kamailio/src'
```
**config.mak**
```
[root@logger-west kamailio]# cat src/config.mak 
# this file is autogenerated by make cfg
MAIN_NAME= kamailio
CFG_NAME= kamailio
SCR_NAME= sip-router
FLAVOUR= kamailio
INSTALL_FLAVOUR= kamailio
SRC_NAME= sip-router
RELEASE= 5.6.0-dev0
OS= linux
ARCH= aarch64
C_DEFS=   -DNAME='"kamailio"' -DVERSION='"5.6.0-dev0"' -DARCH='"aarch64"' 
-DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 8.4.1"' -D__CPU_aarch64 
-D__OS_linux -DVERSIONVAL=5006000 -DCFG_DIR='"/usr/local/etc/kamailio/"' 
-DSHARE_DIR='"/usr/local/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' 
-DPKG_MALLOC -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE 
-DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST 
-DUSE_NAPTR -DWITH_XAVP  -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC 
-DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS 
-DMALLOC_STATS -DUSE_SCTP -g -DNOSMP  -DFAST_LOCK -DADAPTIVE_WAIT 
-DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN 
-DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL 
-DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN 
-DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND 
-DUSE_FUTEX -DHAVE_SELECT
DEFS_RM= 
PROFILE= 
CC= gcc
LD= gcc
MKDEP= gcc -MM -MG
MKTAGS= ctags
LDFLAGS=  -Wl,-O2 -Wl,-E   -pthread -rdynamic "-ldl" -Wl,-Bsymbolic-functions
C_INCLUDES= 
CC_NAME= gcc
CC_MKDEP_OPTS= -MMD -MP
MOD_LDFLAGS= -shared  -Wl,-O2 -Wl,-E   -pthread -rdynamic "-ldl" 
-Wl,-Bsymbolic-functions
LIB_LDFLAGS= -shared  -Wl,-O2 -Wl,-E   -pthread -rdynamic "-ldl" 
-Wl,-Bsymbolic-functions
UTILS_LDFLAGS=  -Wl,-O2 -Wl,-E   -pthread -rdynamic "-ldl" 
-Wl,-Bsymbolic-functions
LIB_SONAME= -Wl,-soname,
LD_RPATH= -Wl,-rpath,
LIB_SUFFIX= .so
LIB_PREFIX= lib
LIBS= -ldl -lresolv -lm
LEX= flex
YACC= bison
YACC_FLAGS= -d -b core/cfg
PREFIX= /usr/local
LOCALBASE= /usr/local
TAR= tar
INSTALL= install
INSTALL_CFG= install -m 644
INSTALL_BIN= install -m 755
INSTALL_MODULES= install -m 755
INSTALL_DOC= install -m 644
INSTALL_MAN= install -m 644
INSTALL_LIB= install -m 755
INSTALL_TOUCH= touch  
INSTALL_SHARE= install -m 644
Q= 1
CC_EXTRA_OPTS= 
CC_PMUTEX_OPTS= -pthread -DKSR_PTHREAD_MUTEX_SHARED
CPUTYPE= 
CFLAGS_RM= -malign-double
CFLAGS=  $(CC_EXTRA_OPTS) $(CC_PMUTEX_OPTS) -Wall
MOD_CFLAGS= -fPIC -DPIC $(CFLAGS)
LIB_CFLAGS= -fPIC -DPIC $(CFLAGS)
UTILS_CFLAGS= $(CFLAGS)
BASEDIR= $(DESTDIR)
basedir= $(BASEDIR)
DESTDIR= 
LIBDIR= lib64
RUNBASEDIR= $(DESTDIR)
runbasedir= $(RUNBASEDIR)
PREFIX= $(LOCALBASE)
prefix= $(PREFIX)
cfg_prefix= $(basedir)$(prefix)
cfg_dir= etc/$(MAIN_NAME)/
bin_prefix= $(basedir)$(prefix)
bin_dir= sbin/
modules_prefix= $(basedir)$(prefix)
modules_dir= $(LIBDIR)/$(MAIN_NAME)/
doc_prefix= $(basedir)$(prefix)
doc_dir= share/doc/$(MAIN_NAME)/
man_prefix= $(basedir)$(prefix)
man_dir= share/man/
ut_prefix= $(basedir)$(prefix)
ut_dir= 
share_prefix= $(basedir)$(prefix)
share_dir= share/$(MAIN_NAME)/
lib_prefix= $(basedir)$(prefix)
lib_dir= $(LIBDIR)/$(MAIN_NAME)/
data_prefix= $(basedir)$(prefix)
data_dir= share/$(MAIN_NAME)/
cfg_target= $(prefix)/$(cfg_dir)
lib_target= $(prefix)/$(lib_dir)
data_target= $(prefix)/$(data_dir)
run_prefix= $(runbasedir)
run_dir= var/run/$(MAIN_NAME)/
run_target= $(run_prefix)/$(run_dir)
share_target= $(prefix)/$(share_dir)
override makefile_defs:=1
C_DEFS:=$(filter-out $(DEFS_RM) $(extra_defs),$(C_DEFS)) $(extra_defs)
CFLAGS:=$(filter-out $(CFLAGS_RM) $(CC_EXTRA_OPTS), $(CFLAGS)) $(CC_EXTRA_OPTS)
```

-- 
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/2789#issuecomment-869566338___
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] kazoo : fix routing of reply events (#2786)

2021-06-28 Thread sergey-safarov
Hi @kageds 
Think I misled in the message above. My issue because I try to use the latest 
`kazoo-config-kamailio` with old "kazoo erlang" code.
Please ignore my message above.

-- 
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/2786#issuecomment-869558131___
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] tls: allow export session keys (#2785)

2021-06-28 Thread sergey-safarov
To free memory applied patch
```diff
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -627,8 +627,9 @@ int prepare_keylog_file(str session_keylog_filename)
* the tool is run multiple times.
*/
bio_keylog = BIO_new_file(keylog_file, "a");
+   pkg_free(keylog_file);
if (bio_keylog == NULL) {
-   LOG(tls_log, "Error writing keylog file: %s\n", keylog_file);
+   LOG(tls_log, "Error writing keylog file: %.*s\n", 
session_keylog_filename.len, session_keylog_filename.s);
return 1;
}
 
```
As session keys may be refreshed during TLS session, then the file open and 
close operation needs use on each `keylog_callback`.
Will it be trick on a server with a lot of connected TLS clients?

-- 
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/2785#issuecomment-869541733___
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] tls: allow export session keys (#2785)

2021-06-28 Thread sergey-safarov
@sergey-safarov pushed 1 commit.

b6ac6e2b7297ee7830d96290014b36c0dadb7651  tls: keylog_file variable freed after 
use


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/2785/files/368c13945d6d1d78541a72b29d260e50cd2fdeb4..b6ac6e2b7297ee7830d96290014b36c0dadb7651
___
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] add debuginfo on dist other then x86 (#2789)

2021-06-28 Thread Henning Westerholt
Thanks, can you also quickly quote "make cfg" output?

-- 
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/2789#issuecomment-869527954___
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] kazoo : fix routing of reply events (#2786)

2021-06-28 Thread kageds
> 
> 
> I have tested this PR.
> Looks as when `registrar` response returns an error then Kamailio properly 
> handles this response.

@sergey-safarov I'm sorry I don't know what you mean by this comment, do you 
agree that this fix is required? I'm using the 2600hz kamailio configuration to 
do the validation 
https://github.com/2600hz/kazoo-configs-kamailio/blob/4.3/kamailio/registrar-role.cfg

-- 
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/2786#issuecomment-869524312___
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] tls: allow export session keys (#2785)

2021-06-28 Thread Daniel-Constantin Mierla
> I have checked openssl sources, look as `BIO_printf` and `BIO_write` function 
> to not use lock mechanism.
> 
> > The solution would be to either have a lock around and do every time: lock, 
> > open file, write, close, unlock;
> 
> Why we cannot open the file once and use logic inside childrens
> 
> ```
> lock, write, unlock
> ```

You can read more on the net about opening a file before fork() and what 
happens after forking, etc ... In short, if you do not want to complicate the 
life a lot, it is not a good idea at all. Each process will have a clone of the 
file descriptor, with managing own states after fork ...

> 
> > I also noticed that the file name is reallocated in pkg using a local 
> > variable in a function and not freed.
> 
> is memory allocated here and not freed?
> 
> ```diff
> @@ -636,6 +710,7 @@ int tls_h_mod_pre_init_f(void)
>  #endif
> SSL_load_error_strings();
> tls_mod_preinitialized=1;
> +   prepare_keylog_file(cfg_get(tls, tls_cfg, session_keylog_filename));
> return 0;
>  }
> ```

I meant the `keylog_file` variable which is local to the function and then lost:

```
+int prepare_keylog_file(str session_keylog_filename)
+{
+   char *keylog_file = NULL;
```

I couldn't spot where is freed.



-- 
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/2785#issuecomment-869505360___
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] tls: allow export session keys (#2785)

2021-06-28 Thread sergey-safarov
I have checked openssl sources, loogs as `BIO_printf` and `BIO_write` function 
to not use lock mechanism.

> The solution would be to either have a lock around and do every time: lock, 
> open file, write, close, unlock; 

Why we cannot open file once and use logic inside childs
```
lock, write, unlock
```

> I also noticed that the file name is reallocated in pkg using a local 
> variable in a function and not freed.

is memory allocated here and not freed?
```diff
@@ -636,6 +710,7 @@ int tls_h_mod_pre_init_f(void)
 #endif
SSL_load_error_strings();
tls_mod_preinitialized=1;
+   prepare_keylog_file(cfg_get(tls, tls_cfg, session_keylog_filename));
return 0;
 }

```

-- 
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/2785#issuecomment-869498796___
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] add debuginfo on dist other then x86 (#2789)

2021-06-28 Thread sergey-safarov
@henningw here is requested info
```
[root@sbc-b2 ~]# kamailio -I
Print out of kamailio internals
  Version: kamailio 5.6.0-dev0 (aarch64/linux) 936350-dirty
  Default config: /etc/kamailio/kamailio.cfg
  Default paths to modules: /usr/lib64/kamailio/modules
  Compile flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT-NOSMP, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
  MAX_RECV_BUFFER_SIZE=262144
  MAX_URI_SIZE=1024
  BUF_SIZE=65535
  DEFAULT PKG_SIZE=8MB
  DEFAULT SHM_SIZE=64MB
  ADAPTIVE_WAIT_LOOPS=1024
  TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select
  Source code revision ID: 936350 -dirty
  Compiled with: gcc 8.4.1
  Compiled architecture: aarch64
  Compiled on: 13:51:40 Jun 23 2021
Thank you for flying kamailio!
```

-- 
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/2789#issuecomment-869476171___
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] add debuginfo on dist other then x86 (#2789)

2021-06-28 Thread Henning Westerholt
@sergey-safarov the logic for the "-g" flag for other architectures is a bit 
different in the Makefile.def, and i am not sure if its maybe also need another 
extension for this architecture. 
Can you please quote the output of "kamailio -I" to this ticket?

-- 
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/2789#issuecomment-869465955___
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] nats: new nats message consumer module (#2790)

2021-06-28 Thread Daniel-Constantin Mierla
Thanks for the new module!

I find the name with potential to create confusion, being closed to `NAT` and 
we all know how popular that is and what it refers to in VoIP, but at the end I 
am fine with it given that it is the name of the external project. Maybe in the 
future if we end up with many distributed messaging platform modules, we can 
add a common prefix to all of them like we added for db module in the past.

Regarding the code, I noticed that shm/pkg_malloc() results are not checked for 
NULL, which will result in crashes on low/out of memory cases. @eschmidbauer 
has already git commit access, so I am fine to merge it and then push follow up 
commits for memory allocation checks.

-- 
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/2790#issuecomment-869451310___
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] core on start (#2788)

2021-06-28 Thread Daniel-Constantin Mierla
The `pv_get_buffer()` return the pointer of the allocated buffer, which should 
be aligned:

```
3593p = pv_get_buffer();
3594memcpy(p, in->s, in->len);
```

That means there is a buffer overflow/memory overwrite in one of the components 
you use. If you can narrow it down to a minimal config, it would help a lot. 
Also, knowing if default `kamailio.cfg` + `append_hf_value()` works or not 
would help to rule out many modules.

-- 
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/2788#issuecomment-869430944___
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] db_redis: fix broken pipe issue, if redis server with timeout setting. (#2791)

2021-06-28 Thread Andreas Granig
Thanks for the patch, looks good! I'll take care merging it.

-- 
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/2791#issuecomment-869429213___
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] add debuginfo on dist other then x86 (#2789)

2021-06-28 Thread Daniel-Constantin Mierla
You can push this change to Makefile.defs, fine for me.

-- 
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/2789#issuecomment-869427948___
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] db_redis: fix broken pipe issue, if redis server with timeout setting. (#2791)

2021-06-28 Thread Daniel-Constantin Mierla
Thanks! Not sure if @agranig is still interested in this module and look at 
this PR, knowing that he focuses on other things these days. 

Anyhow, we can wait a bit to see if someone else wants to check, before 
merging. From my point of view, the patch is simple enough, only changing 
return codes checking, but I can't test it easily at this moment, so if no 
other comments soon, it can be merged.

-- 
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/2791#issuecomment-869427301___
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] nats: new nats message consumer module (#2790)

2021-06-28 Thread Henning Westerholt
Think the same, as we have already three modules implementing message queues:

- mqtt
- rabbitmq
- kazoo

I was thinking of “mq_” prefix, but this obviously do not fit well to the 
existing names.

Cheers,

Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: sr-dev  On Behalf Of Olle E. Johansson
Sent: Monday, June 28, 2021 1:10 PM
To: Kamailio (SER) - Development Mailing List 
Subject: Re: [sr-dev] [kamailio/kamailio] nats: new nats message consumer 
module (#2790)

I find the name with potential to create confusion, being closed to NAT and we 
all know how popular that is and what it refers to in VoIP, but at the end I am 
fine with it given that it is the name of the external project. Maybe in the 
future if we end up with many distributed messaging platform modules, we can 
add a common prefix to all of them like we added for db module in the past.
“msg_”
“mbr_”
“mbus_”

Adding a prefix is a good thing.

/O


On 28 Jun 2021, at 09:42, Daniel-Constantin Mierla 
mailto:notificati...@github.com>> wrote:


Thanks for the new module!
I find the name with potential to create confusion, being closed to NAT and we 
all know how popular that is and what it refers to in VoIP, but at the end I am 
fine with it given that it is the name of the external project. Maybe in the 
future if we end up with many distributed messaging platform modules, we can 
add a common prefix to all of them like we added for db module in the past.
Regarding the code, I noticed that shm/pkg_malloc() results are not checked for 
NULL, which will result in crashes on low/out of memory cases. 
@eschmidbauer has already git commit access, 
so I am fine to merge it and then push follow up commits for memory allocation 
checks.
—
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


Re: [sr-dev] [kamailio/kamailio] nats: new nats message consumer module (#2790)

2021-06-28 Thread Olle E. Johansson
> I find the name with potential to create confusion, being closed to NAT and 
> we all know how popular that is and what it refers to in VoIP, but at the end 
> I am fine with it given that it is the name of the external project. Maybe in 
> the future if we end up with many distributed messaging platform modules, we 
> can add a common prefix to all of them like we added for db module in the 
> past.
> 
“msg_”
“mbr_”
“mbus_”

Adding a prefix is a good thing.

/O

> On 28 Jun 2021, at 09:42, Daniel-Constantin Mierla  
> wrote:
> 
> 
> Thanks for the new module!
> 
> I find the name with potential to create confusion, being closed to NAT and 
> we all know how popular that is and what it refers to in VoIP, but at the end 
> I am fine with it given that it is the name of the external project. Maybe in 
> the future if we end up with many distributed messaging platform modules, we 
> can add a common prefix to all of them like we added for db module in the 
> past.
> 
> Regarding the code, I noticed that shm/pkg_malloc() results are not checked 
> for NULL, which will result in crashes on low/out of memory cases. 
> @eschmidbauer  has already git commit 
> access, so I am fine to merge it and then push follow up commits for memory 
> allocation checks.
> 
> —
> 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] [kamailio/kamailio] db_redis: fix broken pipe issue, if redis server with timeout setting. (#2791)

2021-06-28 Thread FredWH
- issue #2764

!-- Kamailio Pull Request Template --

!--
IMPORTANT:
  - for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
  - pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
  - backports to stable branches must be done with git cherry-pick -x 
...
  - code is contributed under BSD for core and main components (tm, sl, auth, 
tls)
  - code is contributed GPLv2 or a compatible license for the other components
  - GPL code is contributed with OpenSSL licensing exception
--

 Pre-Submission Checklist
!-- Go over all points below, and after creating the PR, tick all the 
checkboxes that apply --
!-- All points should be verified, otherwise, read the CONTRIBUTING 
guidelines from above--
!-- If youre unsure about any of these, dont hesitate to ask on 
sr-dev mailing list --
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, 
...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [*] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:
!-- Go over all points below, and after creating the PR, tick the 
checkboxes that apply --
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description
!-- Describe your changes in detail --

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2791

-- Commit Summary --

  * db_redis: fix broken pipe issue, if redis server with timeout setting.

-- File Changes --

M src/modules/db_redis/redis_connection.c (12)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/2791.patch
https://github.com/kamailio/kamailio/pull/2791.diff

-- 
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/2791
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:6078dbf6: nats: new nats message consumer module

2021-06-28 Thread Emmanuel Schmidbauer
Module: kamailio
Branch: master
Commit: 6078dbf6a7aa8eac8c3c4a57d939716f232799f5
URL: 
https://github.com/kamailio/kamailio/commit/6078dbf6a7aa8eac8c3c4a57d939716f232799f5

Author: Emmanuel Schmidbauer 
Committer: Emmanuel Schmidbauer 
Date: 2021-06-27T07:58:58-04:00

nats: new nats message consumer module

---

Added: src/modules/nats/Makefile
Added: src/modules/nats/doc/Makefile
Added: src/modules/nats/doc/nats.xml
Added: src/modules/nats/doc/nats_admin.xml
Added: src/modules/nats/nats_mod.c
Added: src/modules/nats/nats_mod.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/6078dbf6a7aa8eac8c3c4a57d939716f232799f5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6078dbf6a7aa8eac8c3c4a57d939716f232799f5.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] tls: allow export session keys (#2785)

2021-06-28 Thread Daniel-Constantin Mierla
In my opinion there are issues of concurrency in writing to the file. It seems 
to be open in the main process, during the initialisation and then write to it 
during runtime from kamailio processes. Writing from multiple processes to the 
same file is going to have unpredictable content.

The solution would be to either have a lock around and do every time: lock, 
open file, write, close unlock; or create a consumer process that write to the 
file and the others produce data that is sent to it. Another option would be 
that each process writes to dedicated file (e.g., filename-pid).

I also noticed that the file name is reallocated in pkg using a local variable 
in a function and not freed.

-- 
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/2785#issuecomment-869404475___
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] tls: allow export session keys (#2785)

2021-06-28 Thread sergey-safarov
To get working session keys embedding and description required to record TLS 
connection from start (TCP SYN/ACK).
If TLS connection is long-term and the start of the connection not recorded, 
then traffic cannot be decrypted.

>From my point view, need to try utilize `SSL_key_update()` with 
>`SSL_KEY_UPDATE_REQUESTED`. [More 
>info](https://www.openssl.org/docs/man1.1.1/man3/SSL_renegotiate.html).

-- 
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/2785#issuecomment-869337683___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev