Re: [sr-dev] [kamailio/kamailio] There is no jwt.so (#2883)

2021-10-14 Thread hance2010
Closed #2883.

-- 
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/2883#event-5466845366___
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] There is no jwt.so (#2883)

2021-10-14 Thread Victor Seva
from the README at src/modules/jwt
```
2.2. External Libraries or Applications

   The following libraries or applications must be installed before
   running Kamailio with this module loaded:
 * libjwt - minimum version 1.12.0.
```
https://packages.debian.org/search?keywords=libjwt

1.10.2-1 is the last version packaged

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


[sr-dev] [kamailio/kamailio] kemi python3: exception occur when import logging module (#2885)

2021-10-14 Thread Minh
### Description
kemi python3: exception occur when import logging module


### Troubleshooting

 Reproduction
very simple to reproduce is add this line to python kemi file
```
import logging
```


 Debugging Data

```
(paste your debugging data here)
```

 Log Messages

```
 0(49) INFO:  [core/tcp_main.c:4983]: init_tcp(): using epoll_lt as the 
io watch method (auto detected)
 0(49) WARNING: outbound [outbound_mod.c:121]: mod_init(): "stun" module is not 
loaded. STUN is required to use outbound with UDP.
 0(49) INFO:  [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO PYTHON3 
APPLICATION INSTANTIATE CLASS OBJECT
 0(49) INFO:  [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO INITIATION
 0(49) INFO:  [main.c:3030]: main(): processes (at least): 25 - shm size: 
268435456 - pkg size: 16777216
 0(49) INFO:  [core/udp_server.c:154]: probe_max_receive_buffer(): 
SO_RCVBUF is initially 212992
 0(49) INFO:  [core/udp_server.c:206]: probe_max_receive_buffer(): 
SO_RCVBUF is finally 425984
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
RuntimeError: cannot release un-acquired lock
Ignoring exception from logging atfork <_StderrHandler  (WARNING)> 
release method: cannot release un-acquired lock
 1(50) INFO:  [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO CHILD 
PROCESS INITIALIZED 1
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
_lock.release()
```

 SIP Traffic



```
(paste your sip traffic here)
```

### Possible Solutions



### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

Test on `5.5.2` and `5.4.7` both occur the issue 

```
root@c011e17b1e00:/opt/siproxy# kamailio -v
version: kamailio 5.5.2 (x86_64/linux) 55e232
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 55e232 
compiled on 11:54:55 Oct 14 2021 with gcc 8.3.0
```

```
root@sgcoordinator1:/opt# kamailio -v
version: kamailio 5.4.5 (x86_64/linux) c46342
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: c46342 
compiled on 07:26:04 Jul 23 2021 with gcc 8.3.0
```

* **Operating System**:
occur on debian or docker as well

```
Linux c011e17b1e00 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 
GNU/Linux
Linux machine 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) 
x86_64 GNU/Linux
```


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


[sr-dev] git:master:f677dea5: lcr: fix build

2021-10-14 Thread Victor Seva
Module: kamailio
Branch: master
Commit: f677dea597db6ceaa66a2755dd6e9e738855dc35
URL: 
https://github.com/kamailio/kamailio/commit/f677dea597db6ceaa66a2755dd6e9e738855dc35

Author: Victor Seva 
Committer: Victor Seva 
Date: 2021-10-14T15:16:52+02:00

lcr: fix build

> lcr_mod.c: In function 'find_gateway_by_ip_and_port':
> lcr_mod.c:930:2: error: 'for' loop initial declarations are only allowed in 
> C99 or C11 mode
>   for (int i = 1; i <= gws[0].ip_addr.u.addr32[0]; i++) {
>   ^
> lcr_mod.c:930:2: note: use option -std=c99, -std=gnu99,   -std=c11 or 
> -std=gnu11 to compile your code
> ../../Makefile.rules:100: recipe for target 'lcr_mod.o' failed
> make[3]: *** [lcr_mod.o] Error 1

---

Modified: src/modules/lcr/lcr_mod.c

---

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

---

diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c
index d796c08c2c..630593bd36 100644
--- a/src/modules/lcr/lcr_mod.c
+++ b/src/modules/lcr/lcr_mod.c
@@ -925,9 +925,9 @@ static int comp_gws(const void *_g1, const void *_g2)
  * Compare a gateway using IP address and the src port
  */
 static struct gw_info * find_gateway_by_ip_and_port(struct gw_info * gw, 
struct gw_info * gws) {
-   int tmp = 0, gw_index = 0;
+   int tmp = 0, gw_index = 0, i;
 
-   for (int i = 1; i <= gws[0].ip_addr.u.addr32[0]; i++) {
+   for (i = 1; i <= gws[0].ip_addr.u.addr32[0]; i++) {
tmp = memcmp(gws[i].ip_addr.u.addr, gw->ip_addr.u.addr, 
gws[i].ip_addr.len);
if (gws[i].ip_addr.af == gw->ip_addr.af &&
gws[i].ip_addr.len == gw->ip_addr.len &&


___
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] dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs (#2884)

2021-10-14 Thread Daniel-Constantin Mierla
Closed #2884.

-- 
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/2884#event-5462214801___
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] dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs (#2884)

2021-10-14 Thread Daniel-Constantin Mierla
Backported.

-- 
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/2884#issuecomment-943140754___
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] There is no jwt.so (#2883)

2021-10-14 Thread Daniel-Constantin Mierla
Maybe @linuxmaniac can comment on it -- not sure if the required library is 
available or simply not added to packaging.

-- 
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/2883#issuecomment-943140516___
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] dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs (#2884)

2021-10-14 Thread MikhailKalashnikov
With this fix it works correctly, returns -1 or count of dialogs

-- 
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/2884#issuecomment-943127917___
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] dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs (#2884)

2021-10-14 Thread Daniel-Constantin Mierla
Thanks for the report! Can you test with the patch from the commit referenced 
above? If works, then I will 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/issues/2884#issuecomment-943121410___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs (#2884)

2021-10-14 Thread MikhailKalashnikov
### Description

dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs.


### Possible Solutions

I guess 
[ki_dlgs_tags_count](https://github.com/kamailio/kamailio/blob/master/src/modules/dlgs/dlgs_mod.c#L350)
 should return `ret` instead of 1. 

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

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

```

-- 
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/2884___
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] cscf_get_ue_via does not return UE via (#2864)

2021-10-14 Thread Aleksandar Yosifov
Hi, again and sorry for the late answer.
I analyzed some log/pcap files and the source code too. Unfortunately,
cscf_get_ue_via is legacy, and I do not know why it is implemented that way.
In conclusion, I believe that the changes proposed by you will not affect
the current implementation.


On Tue, Oct 5, 2021 at 3:03 PM Erhan Onur Sendag 
wrote:

> Hi Aleksandar,
>
> According to Kamalio naming, top via is the first via, and bottom via
> header is the last via.
> For each request, UAC puts its via header to the top of the list. And for
> each response, UAC deletes the top via header.
> So the bottom via (last via) always belongs to the UE's UAC (it doesn't
> matter if it is Request or Response).
> Why we use first Via header to identify the UE?
>
> BR,
> Erhan Sendag
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> Triage notifications on the go with GitHub Mobile for iOS
> 
> or Android
> .
>
> ___
> 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:5.4:4bee0582: dlgs: proper return for tags counting

2021-10-14 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 5.4
Commit: 4bee05821e9a9a1c72b73da8d1aae82735802602
URL: 
https://github.com/kamailio/kamailio/commit/4bee05821e9a9a1c72b73da8d1aae82735802602

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2021-10-14T10:36:45+02:00

dlgs: proper return for tags counting

- GH #2884

(cherry picked from commit 1f12e2a03856f9c2d12cf62c1e65e84380729a06)
(cherry picked from commit b6484e4614ebc0f3fd54224ba9470d6c5b322a6f)

---

Modified: src/modules/dlgs/dlgs_mod.c

---

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

---

diff --git a/src/modules/dlgs/dlgs_mod.c b/src/modules/dlgs/dlgs_mod.c
index 503dd8c197..46de9d5c44 100644
--- a/src/modules/dlgs/dlgs_mod.c
+++ b/src/modules/dlgs/dlgs_mod.c
@@ -344,10 +344,7 @@ static int ki_dlgs_tags_count(sip_msg_t *msg, str *vtags)
int ret;
 
ret = dlgs_tags_count(msg, vtags);
-   if(ret<=0) {
-   return (ret-1);
-   }
-   return 1;
+   return (ret<=0)?(ret-1):ret;
 }
 
 /**


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


[sr-dev] git:5.5:b6484e46: dlgs: proper return for tags counting

2021-10-14 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 5.5
Commit: b6484e4614ebc0f3fd54224ba9470d6c5b322a6f
URL: 
https://github.com/kamailio/kamailio/commit/b6484e4614ebc0f3fd54224ba9470d6c5b322a6f

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2021-10-14T10:35:32+02:00

dlgs: proper return for tags counting

- GH #2884

(cherry picked from commit 1f12e2a03856f9c2d12cf62c1e65e84380729a06)

---

Modified: src/modules/dlgs/dlgs_mod.c

---

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

---

diff --git a/src/modules/dlgs/dlgs_mod.c b/src/modules/dlgs/dlgs_mod.c
index 503dd8c197..46de9d5c44 100644
--- a/src/modules/dlgs/dlgs_mod.c
+++ b/src/modules/dlgs/dlgs_mod.c
@@ -344,10 +344,7 @@ static int ki_dlgs_tags_count(sip_msg_t *msg, str *vtags)
int ret;
 
ret = dlgs_tags_count(msg, vtags);
-   if(ret<=0) {
-   return (ret-1);
-   }
-   return 1;
+   return (ret<=0)?(ret-1):ret;
 }
 
 /**


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


[sr-dev] git:master:1f12e2a0: dlgs: proper return for tags counting

2021-10-14 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 1f12e2a03856f9c2d12cf62c1e65e84380729a06
URL: 
https://github.com/kamailio/kamailio/commit/1f12e2a03856f9c2d12cf62c1e65e84380729a06

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2021-10-14T10:09:32+02:00

dlgs: proper return for tags counting

- GH #2884

---

Modified: src/modules/dlgs/dlgs_mod.c

---

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

---

diff --git a/src/modules/dlgs/dlgs_mod.c b/src/modules/dlgs/dlgs_mod.c
index 503dd8c197..46de9d5c44 100644
--- a/src/modules/dlgs/dlgs_mod.c
+++ b/src/modules/dlgs/dlgs_mod.c
@@ -344,10 +344,7 @@ static int ki_dlgs_tags_count(sip_msg_t *msg, str *vtags)
int ret;
 
ret = dlgs_tags_count(msg, vtags);
-   if(ret<=0) {
-   return (ret-1);
-   }
-   return 1;
+   return (ret<=0)?(ret-1):ret;
 }
 
 /**


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