IgorrG created an issue (kamailio/kamailio#4268)
### Description
We use RPC dlg.end_dlg command to terminate dialog. In most cases it does operate properly and send BYE from kamailio to both sides of dialog (as show on screenshot).

We found that in some cases we have only first BYE sent to calling party. Second BYE never sent, when called party tries to terminate call by timeout it get responded with 481.


In logs we have such warning:
мая 27 15:11:46 service-proxy.iqtek.ru kamailio[3518388]: 2(3518388) WARNING: {1 1 BYE 541d3f2c-43fd-43b6-af24-bad1fbf85eb6} dialog [dlg_handlers.c:1343]: dlg_onroute(): unable to find dialog for BYE with route param 'e1e.4f22' [3614:8948] and call-id '541d3f2c-43fd-43b6-af24-bad1fbf85eb6'
We also found that in this case this warning shown in logs 0.04 seconds after kamailio receive 200ok.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# ./kamailio -V
version: kamailio 5.8.6 (x86_64/linux) fb71db
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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_SEND_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: fb71db
compiled on 17:38:27 May 26 2025 with gcc 12.2.0
```
* **Operating System**:
```
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
# uname -a
Linux rtp-kamailio2 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4268
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4268(a)github.com>
Maurotb created an issue (kamailio/kamailio#4267)
We have two kamailio in load balancing, mysql is in cluster mode.
We need to use sca, but kamailio db cluster is not supported (i need to specify connection string to sql not cluster name) and if phone1 is registered on kamailio1 and phone2 on kamailio2, sca not work. It is possibile to implement cluster?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4267
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4267(a)github.com>
IgorrG created an issue (kamailio/kamailio#4266)
### Description
While implementing mid-register inspired by pull request (https://github.com/kamailio/kamailio/pull/3360) we found the case when it goes impossible to handle responses for registrar servers. In case some of registrars busy and respond with 401 after 200ok received - it is not possible using any routes and configuration options to handle responses received in branch transactions.
According to documentation I think that setting wt_timer should allow to absorb and handle responses on failure-route while transaction kept in memory. In fact wt_timer does not affect handling responses in any way.

### Troubleshooting
To reproduce this case we have configured sipp to response instant with 200ok on registration request.
#### Reproduction
To reproduce issue SIPP could be setup as one of the dispatcher nodes with instant 200ok reply to register. Kamailio should use following configuration snippet: https://github.com/ovoshlook/kamailio-mid-registrar-config-snippets/blob/ma…
#### Log Messages
REGISTER|401tm [t_lookup.c:912]: t_reply_matching(): t_reply_matching: hash 12337 label 0 branch 1
REGISTER|401tm [t_lookup.c:986]: t_reply_matching(): reply (0x7f1fc67f83a8) matched an active transaction (T=0x7f1fc0f0f740)!
REGISTER|401tm [t_lookup.c:1122]: t_check_msg(): msg (0x7f1fc67f83a8) id=13/1915035 global id=13/1915035 T end=0x7f1fc0f0f740
REGISTER|401tm [t_reply.c:2363]: reply_received(): transaction found - T:0x7f1fc0f0f740 branch:1
REGISTER|401tm [t_reply.c:2376]: reply_received(): original status uas=200, uac[1]=0 local=0 is_invite=0)
REGISTER|401tm [t_reply.c:1363]: t_should_relay_response(): ->>>>>>>>> T_code=200, new_code=401
REGISTER|401tm [t_reply.c:1374]: t_should_relay_response(): final reply already sent
REGISTER|401tm [t_reply.c:1625]: t_should_relay_response(): finished with rps discarded - uas status: 200
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version**
```
version: kamailio 5.6.4 (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_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: unknown
compiled on 16:35:08 Jun 5 2023 with gcc 10.2.1
```
* **Operating System**:
```
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Linux pbxKamaTest 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4266
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4266(a)github.com>
<!-- 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 you're unsure about any of these, don't 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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
- [x] Related to issue #3823
#### Description
<!-- Describe your changes in detail -->
This PR aims to implement what was discussed in [mailing list](https://lists.kamailio.org/mailman3/hyperkitty/list/sr-dev@lists.kama… regarding some `tls.reload` and increasing memory usage.
It adds a new parameter `enable_shared_ctx` in `tls` module that if set to 0, preserves the old behavior and if set to 1 (other than 0 tbh), it creates a single SSL context that is being shared. This have the effect of using way less memory when initialized as well, but also minimizes (can't say it fixes the problem) the `tls.reload` memory increase.
I have also added a small markdown (comparison.md) file, where some comparisons where made between enabled/disabled shared context and with/without CA file (where the initial problem was occurring by the reporter).
Feedback would be necessary to verify whether this patch, acts as expected and kamailio works as intented.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3972
-- Commit Summary --
* tls: Add parameter for shared contexts
* tls: Comparison for enable_shared_ctx
-- File Changes --
A comparison.md (15)
M src/modules/tls/tls_domain.c (172)
M src/modules/tls/tls_mod.c (11)
M src/modules/tls/tls_mod.h (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3972.patchhttps://github.com/kamailio/kamailio/pull/3972.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3972
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3972(a)github.com>
<!-- 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 you're unsure about any of these, don't 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Added support for KEMI API in PDB module.
Here is example usage in KEMI Python.
```
if not (KSR.pdb.pdb_query(KSR.pv.gete("$var(pdb_user)"), "$avp(carrier_id)") > 0):
KSR.err(F"""[{HERE()}]: PDB query failed for user '{KSR.pv.get("$var(pdb_user)")}' \n""")
else:
KSR.info(F""" PDB query return carrier_id = '{KSR.pv.getw("$avp(carrier_id)")}' \n""")
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4265
-- Commit Summary --
* pdb: added KEMI support for PDB module
-- File Changes --
M src/modules/pdb/pdb.c (339)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4265.patchhttps://github.com/kamailio/kamailio/pull/4265.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4265
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4265(a)github.com>
ovedeneev created an issue (kamailio/kamailio#4187)
### Description
[tcp_send_timeout](https://www.kamailio.org/wikidocs/cookbooks/5.8.x/core/#t… option does not apply for outbound connections.
#### Reproduction
1. Establish TCP OPTIONS between Kamailio and target node.
2. On target node block incoming traffic from Kamailio node using iptables.
3. Notice on Kamailio node that TCP retransmission packets don't follow tcp_send_timeout settings, instead they fall back to kernel's net.ipv4.tcp_retries2 settings.
### Additional Information
* **Kamailio Version**
```
# kamailio -V
version: kamailio 5.8.2 (aarch64/linux) 446039
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_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: 446039
compiled on 14:32:09 Nov 14 2024 with gcc 8.5.0
```
* **Operating System**:
```
Linux xxx 4.18.0-553.6.1.el8.aarch64 #1 SMP Thu May 30 04:10:32 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4187
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4187(a)github.com>
#### Pre-Submission Checklist
- [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:
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
As a local IP address for TCP sending operation the Kamailio service is taking the same network_interface/IP_address, which is used by the service for TCP listening.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3925
-- Commit Summary --
* core: local TCP socket is bound on listening address
-- File Changes --
M src/core/tcp_main.c (24)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3925.patchhttps://github.com/kamailio/kamailio/pull/3925.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3925
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3925(a)github.com>
sergey-safarov created an issue (kamailio/kamailio#4264)
On `alpine:edge` upgraded `libjwt-dev` from `1.17.2-r0` to `3.2.1-r0` and on now present this error in the build log.
```
make[2]: --libs: No such file or directory
make[2]: --libs: No such file or directory
CC (cc) [M jwt.so] jwt_mod.o
jwt_mod.c: In function 'ki_jwt_generate_hdrs':
jwt_mod.c:215:17: error: implicit declaration of function 'jwt_free_str'; did you mean 'jwt_alg_str'? [-Wimplicit-function-declaration]
215 | jwt_free_str(_jwt_result.s);
| ^~~~~~~~~~~~
| jwt_alg_str
jwt_mod.c:275:15: error: implicit declaration of function 'jwt_new' [-Wimplicit-function-declaration]
275 | ret = jwt_new(&jwt);
| ^~~~~~~
jwt_mod.c:283:15: error: implicit declaration of function 'jwt_add_grant_int' [-Wimplicit-function-declaration]
283 | ret = jwt_add_grant_int(jwt, "iat", iat);
| ^~~~~~~~~~~~~~~~~
jwt_mod.c:293:39: error: implicit declaration of function 'jwt_add_grant' [-Wimplicit-function-declaration]
293 | ret = jwt_add_grant(jwt, pit->name.s, pit->body.s);
| ^~~~~~~~~~~~~
jwt_mod.c:311:39: error: implicit declaration of function 'jwt_add_header' [-Wimplicit-function-declaration]
311 | ret = jwt_add_header(jwt, header->name.s, header->body.s);
| ^~~~~~~~~~~~~~
jwt_mod.c:313:39: error: implicit declaration of function 'jwt_add_header_int'; did you mean 'jwt_header_get'? [-Wimplicit-function-declaration]
313 | ret = jwt_add_header_int(jwt, header->name.s, lval);
| ^~~~~~~~~~~~~~~~~~
| jwt_header_get
jwt_mod.c:324:15: error: implicit declaration of function 'jwt_set_alg'; did you mean 'jwt_get_alg'? [-Wimplicit-function-declaration]
324 | ret = jwt_set_alg(jwt, valg, (unsigned char *)kdata.s, (size_t)kdata.len);
| ^~~~~~~~~~~
| jwt_get_alg
jwt_mod.c:330:25: error: implicit declaration of function 'jwt_encode_str' [-Wimplicit-function-declaration]
330 | _jwt_result.s = jwt_encode_str(jwt);
| ^~~~~~~~~~~~~~
jwt_mod.c:330:23: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
330 | _jwt_result.s = jwt_encode_str(jwt);
| ^
jwt_mod.c:337:9: error: implicit declaration of function 'jwt_free'; did you mean 'jwks_free'? [-Wimplicit-function-declaration]
337 | jwt_free(jwt);
| ^~~~~~~~
| jwks_free
jwt_mod.c: In function 'ki_jwt_verify_key':
jwt_mod.c:443:9: error: unknown type name 'jwt_valid_t'; did you mean 'jwt_value_t'?
443 | jwt_valid_t *jwt_valid = NULL;
| ^~~~~~~~~~~
| jwt_value_t
jwt_mod.c:477:15: error: implicit declaration of function 'jwt_valid_new' [-Wimplicit-function-declaration]
477 | ret = jwt_valid_new(&jwt_valid, valg);
| ^~~~~~~~~~~~~
jwt_mod.c:484:9: error: implicit declaration of function 'jwt_valid_set_headers' [-Wimplicit-function-declaration]
484 | jwt_valid_set_headers(jwt_valid, 1);
| ^~~~~~~~~~~~~~~~~~~~~
jwt_mod.c:485:9: error: implicit declaration of function 'jwt_valid_set_now' [-Wimplicit-function-declaration]
485 | jwt_valid_set_now(jwt_valid, iat);
| ^~~~~~~~~~~~~~~~~
jwt_mod.c:492:39: error: implicit declaration of function 'jwt_valid_add_grant' [-Wimplicit-function-declaration]
492 | ret = jwt_valid_add_grant(jwt_valid, pit->name.s, pit->body.s);
| ^~~~~~~~~~~~~~~~~~~
jwt_mod.c:494:39: error: implicit declaration of function 'jwt_valid_add_grant_int' [-Wimplicit-function-declaration]
494 | ret = jwt_valid_add_grant_int(jwt_valid, pit->name.s, lval);
| ^~~~~~~~~~~~~~~~~~~~~~~
jwt_mod.c:505:15: error: implicit declaration of function 'jwt_decode' [-Wimplicit-function-declaration]
505 | ret = jwt_decode(
| ^~~~~~~~~~
jwt_mod.c:511:22: error: implicit declaration of function 'jwt_validate' [-Wimplicit-function-declaration]
511 | if((jwtret = jwt_validate(jwt, jwt_valid)) != JWT_VALIDATION_SUCCESS) {
| ^~~~~~~~~~~~
jwt_mod.c:511:55: error: 'JWT_VALIDATION_SUCCESS' undeclared (first use in this function)
511 | if((jwtret = jwt_validate(jwt, jwt_valid)) != JWT_VALIDATION_SUCCESS) {
| ^~~~~~~~~~~~~~~~~~~~~~
jwt_mod.c:511:55: note: each undeclared identifier is reported only once for each function it appears in
jwt_mod.c:512:38: error: implicit declaration of function 'jwt_valid_get_status' [-Wimplicit-function-declaration]
512 | _jwt_verify_status = jwt_valid_get_status(jwt_valid);
| ^~~~~~~~~~~~~~~~~~~~
jwt_mod.c:521:9: error: implicit declaration of function 'jwt_valid_free'; did you mean 'jwt_builder_free'? [-Wimplicit-function-declaration]
521 | jwt_valid_free(jwt_valid);
| ^~~~~~~~~~~~~~
| jwt_builder_free
make[2]: *** [../../Makefile.rules:100: jwt_mod.o] Error 1
make[1]: *** [Makefile:509: modules] Error 1
make[1]: Leaving directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-78541805e73f1ca2a220e84734090ebd606bc5e4/src'
make: *** [Makefile:34: all] Error 2
>>> ERROR: kamailio: build failed
>>> kamailio: Uninstalling dependencies...
(1/1) Purging .makedepends-kamailio (20250527.180[501](https://github.com/sergey-safarov/kamailio/actions/runs/1…)
OK: 1028 MiB in 240 packages
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4264
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4264(a)github.com>