#### 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>
#### 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
- [ ] 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
This change allows to enable/disable the insertion of SIP traces into the DB at runtime (i know we could do this with `siptrace.status`, but this is a different case).
This feature is strictly important if you start `Kamailio` with `trace_to_database` parameter disabled, and you want to enable it later and at runtime.
Nowadays, if you try to start `Kamailio` with `trace_to_database` enabled, but without a connection to the DB, the service won't start (`child_init` logic).
In this type of situation, it makes sense to start `Kamailio` disabling the `trace_to_database` parameter, and when the DB is ok, at runtime, we enable `trace_to_database` parameter. This prevents the need to restart the service, and also we can start `Kamailio` without problems, if DB of SIP Traces is NOK at that time.
My PR may need some improvements, especially on the enable side, so feel free to make any changes to improve that.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3877
-- Commit Summary --
* siptrace: handle trace_to_database param at runtime
-- File Changes --
M src/modules/siptrace/siptrace.c (100)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3877.patchhttps://github.com/kamailio/kamailio/pull/3877.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3877
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3877(a)github.com>
### Description
We are using Kamailio 5.7.4 on Debian 12 (from http://deb.kamailio.org/kamailio57) with rtpengine as an Edgeproxy for our clients. The instance terminates SIP/TLS (with Cliencertificates) and forwards the SIP Traffic to internal systems.
After some days we are getting errors like this
`tls_complete_init(): tls: ssl bug #1491 workaround: not enough memory for safe operation: shm=7318616 threshold1=8912896`
First we thought Kamailio just doesnt have enough memory, so we doubled it..
But after some days the Logmessage (and Userissues) occured again.
So we monitored the shmmem statistics and found that used and max_used are constantly growing til it reaches the limit.
As i mentioned we are using client-certificates and so we are also using the CRL feature.
We do have a systemd-timer which fetches the CRL every hour and runs 'kamcmd tls.reload' when finished.
Our tls.cfg looks like this:
```
[server:default]
method = TLSv1.2+
private_key = /etc/letsencrypt/live/hostname.de/privkey.pem
certificate = /etc/letsencrypt/live/hostname.de/fullchain.pem
ca_list = /etc/kamailio/ca_list.pem
ca_path = /etc/kamailio/ca_list.pem
crl = /etc/kamailio/combined.crl.pem
verify_certificate = yes
require_certificate = yes
[client:default]
verify_certificate = yes
require_certificate = yes
```
After testing a bit we found that every time tls.reload is executed Kamailio consumes a bit more memory which eventually leads to all the memory being consumed which leads to issues for our users.
See following example:
```
[0][root@edgar-dev:~]# while true ; do /usr/sbin/kamcmd tls.reload ; /usr/sbin/kamcmd core.shmmem ; sleep 1 ; done
Ok. TLS configuration reloaded.
{
total: 268435456
free: 223001520
used: 41352552
real_used: 45433936
max_used: 45445968
fragments: 73
}
Ok. TLS configuration reloaded.
{
total: 268435456
free: 222377960
used: 41975592
real_used: 46057496
max_used: 46069232
fragments: 78
}
Ok. TLS configuration reloaded.
{
total: 268435456
free: 221748664
used: 42604992
real_used: 46686792
max_used: 46698080
fragments: 77
}
Ok. TLS configuration reloaded.
{
total: 268435456
free: 221110832
used: 43242408
real_used: 47324624
max_used: 47335608
fragments: 81
}
^C
[130][root@edgar-dev:~]#
```
### Troubleshooting
#### Reproduction
Everytime tls.reload is called the memory consumptions grows..
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
If you let me know what would be interesting for tracking this down, i am happy to provide logs/debugging data!
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
If you let me know what would be interesting for tracking this down, i am happy to provide logs/debugging data!
```
#### SIP Traffic
SIP doesnt seem to be relevant here
### Possible Solutions
Calling tls.reload less often or restart kamailio before memory is consumed ;)
### Additional Information
```
version: kamailio 5.7.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, 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_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 12.2.0
```
* **Operating System**:
```
* Debian GNU/Linux 12 (bookworm)
* Linux edgar-dev 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3823
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3823(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>
Module: kamailio
Branch: master
Commit: 15823c3eda3a332d22d9132a873d755aa024892f
URL: https://github.com/kamailio/kamailio/commit/15823c3eda3a332d22d9132a873d755…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-09-12T10:10:33+02:00
core: log message about interface flags made info
- small updates to a couple of error messages
---
Modified: src/core/resolve.c
Modified: src/core/socket_info.c
---
Diff: https://github.com/kamailio/kamailio/commit/15823c3eda3a332d22d9132a873d755…
Patch: https://github.com/kamailio/kamailio/commit/15823c3eda3a332d22d9132a873d755…
---
diff --git a/src/core/resolve.c b/src/core/resolve.c
index da247952fd9..19b05db90ff 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -1792,7 +1792,8 @@ int str2ipbuf(str *st, ip_addr_t *ipb)
/* just in case that e.g. the VIA parser get confused */
if(unlikely(!st->s || st->len <= 0)) {
- LM_ERR("invalid name, no conversion to IP address possible\n");
+ LM_ERR("invalid name (%p,%d), no conversion to IP address possible\n",
+ st->s, st->len);
return -1;
}
s = (unsigned char *)st->s;
@@ -1902,7 +1903,8 @@ int str2ip6buf(str *st, ip_addr_t *ipb)
/* just in case that e.g. the VIA parser get confused */
if(unlikely(!st->s || st->len <= 0)) {
- LM_ERR("invalid name, no conversion to IP address possible\n");
+ LM_ERR("invalid name (%p,%d), no conversion to IP address possible\n",
+ st->s, st->len);
return -1;
}
/* init */
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index a2b3c05c641..a181e43dad8 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1443,7 +1443,7 @@ static int get_flags(int family)
if(nlp->nlmsg_len < NLMSG_LENGTH(sizeof(ifi)))
goto error;
- LM_ERR("Interface with index %d has flags %d\n", ifi->ifi_index,
+ LM_INFO("Interface with index %d has flags %d\n", ifi->ifi_index,
ifi->ifi_flags);
if(ifaces == NULL) {
LM_ERR("get_flags must not be called on empty interface list");
@@ -1769,7 +1769,7 @@ static int fix_hostname(str *name, struct ip_addr *address, str *address_str,
/* get "official hostnames", all the aliases etc. */
he = resolvehost(name->s);
if(he == 0) {
- LM_ERR("could not resolve %s\n", name->s);
+ LM_ERR("could not resolve '%s'\n", name->s);
goto error;
}
/* check if we got the official name */
Hi,
We want our multi-tenant system to integrate with Kamaillio, and we are trying to use json-rpc to interact with Kamaillio. However, it seems that it is not possible to create a domain using a rpc call, according to the docs it's only possible to issue a reload or dump command.
Is it possible to create a domain remotely, preferably using json-RPC?
Regards,
Auke Noppe
Dear Kamailio community,
### Description
Recently, we are testing IMS VoLTE MT call using a Kamailio release 5.8.2,
however the Kamailio service is crashed for several times during handling MT
IMS SIP Call.
We would like to ask if any idea on why getting the "abort error" in
Kamailio (as shown in attached core dump) and also how to solve the issue.
Thanks
Ken