Running compiled Kamailio 5.8.1 (previously 5.8.0) on Debian 12 64-bit
We're seeing an issue with UDP endpoints (this issue does not happen with TCP and TLS) where usrloc will not send OPTIONS packet keepalives.
Here are all of our usrloc parameters:
modparam("usrloc", "db_mode", 0)
modparam("usrloc", "ka_domain", "SIPDOMAIN") #-- SIPDOMAIN is a fqdn
modparam("usrloc", "ka_from", "sip:proxy-ping@SIPDOMAIN")
modparam("usrloc", "ka_mode", 1)
modparam("usrloc", "timer_interval", 20) #-- How often to qualify endpoints and clean mem tables?
modparam("usrloc", "timer_procs", 4)
modparam("usrloc", "ka_randomize", 10)
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "server_id_filter", 1)
modparam("usrloc", "ka_filter", 0)
modparam("usrloc", "ka_timeout", 60) #-- How quickly to expire a contact if it does not reply to keepalive?
modparam("usrloc", "matching_mode", 0)
modparam("usrloc", "handle_lost_tcp", 1)
modparam("usrloc", "close_expired_tcp", 1)
modparam("usrloc", "desc_time_order", 1)
modparam("usrloc", "hash_size", 14)
It seems usrloc is not actually using timer_interval at all for UDP devices. However, it does seem to be sending OPTIONS every 20 seconds on TCP/TLS. (this is confirmed via packet capture on a SIP phone).
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3844
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3844(a)github.com>
Module: kamailio
Branch: master
Commit: cce29af41120cf30c4c22979e772d1ca666408c6
URL: https://github.com/kamailio/kamailio/commit/cce29af41120cf30c4c22979e772d1c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-10-16T11:46:37+02:00
async: docs updates for async_sleep()
---
Modified: src/modules/async/doc/async_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/cce29af41120cf30c4c22979e772d1c…
Patch: https://github.com/kamailio/kamailio/commit/cce29af41120cf30c4c22979e772d1c…
---
diff --git a/src/modules/async/doc/async_admin.xml b/src/modules/async/doc/async_admin.xml
index 027cea11ed7..152c6be5db7 100644
--- a/src/modules/async/doc/async_admin.xml
+++ b/src/modules/async/doc/async_admin.xml
@@ -234,8 +234,11 @@ route[RESUME] {
</title>
<para>
Simulate a sleep of 'seconds' and then continue the processing of SIP
- request with the next action. In case of internal errors, the function
- returns false.
+ request with the next action. Note that the processing continues till
+ the last action in the current route block. Consider using async_route()
+ instead if you want to control better what is executed after the wait
+ time. Beacuse the execution is resumed in another process, do not use
+ private memory variables before and after the async sleep.
</para>
<para>
The sleep parameter represent the number of seconds to suspend the
@@ -243,6 +246,9 @@ route[RESUME] {
a static integer or a variable holding an integer.
</para>
<para>
+ In case of internal errors, the function returns false.
+ </para>
+ <para>
This function can be used from REQUEST_ROUTE.
</para>
<example>
@@ -262,15 +268,13 @@ exit;
<function moreinfo="none">async_ms_sleep(milliseconds)</function>
</title>
<para>
- Simulate a sleep of 'milliseconds' and then continue the processing of SIP
- request with the next action. In case of internal errors, the function
- returns false.
- This function works only if the ms_timer parameter has a value greater than 0.
+ Similar to async_sleep(), but with a 'milliseconds' parameter. This
+ function works only if the ms_timer parameter has a value greater than 0.
</para>
<para>
The sleep parameter represent the number of milliseconds to suspend the
- processing of SIP request. Maximum value is 30000 (30 sec). The parameter can be
- a static integer or a variable holding an integer.
+ processing of SIP request. Maximum value is 30000 (30 sec). The parameter
+ can be a static integer or a variable holding an integer.
</para>
<para>
This function can be used from REQUEST_ROUTE.
Module: kamailio
Branch: master
Commit: e18c52030e202716df9f5e8e953c19fb4a9c65e2
URL: https://github.com/kamailio/kamailio/commit/e18c52030e202716df9f5e8e953c19f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-10-16T11:05:04+02:00
tls: docs - relocate overview notes to Important Notes section
---
Modified: src/modules/tls/doc/tls.xml
---
Diff: https://github.com/kamailio/kamailio/commit/e18c52030e202716df9f5e8e953c19f…
Patch: https://github.com/kamailio/kamailio/commit/e18c52030e202716df9f5e8e953c19f…
---
diff --git a/src/modules/tls/doc/tls.xml b/src/modules/tls/doc/tls.xml
index 3a0416fed61..53397e2d50a 100644
--- a/src/modules/tls/doc/tls.xml
+++ b/src/modules/tls/doc/tls.xml
@@ -60,27 +60,9 @@
must be added to the Kamailio config file.
</para>
<para>
- IMPORTANT: the tls module must be loaded before any other &kamailio; module
- that uses libssl (OpenSSL library). A safe option is to have the tls module
- loaded first (be in the first "loadmodule" in &kamailio;.cfg).
- </para>
- <para>
- IMPORTANT: For libssl v3.x, the core parameter "tls_threads_mode"
- has to be set, see the Core Cookbook for possible values.
- </para>
- <para>
- IMPORTANT: using this module compiled with newer versions of libssl
- (e.g., v1.1+) may require &kamailio; to be started with
- <emphasis>--atexit=no</emphasis> command line parameters to avoid
- calling C atexit callbacks inside the process ending during
- daemonize procedure as well as during shut down, which can lead
- to crashes because it destroys and then accesses shared memory. For
- example, such case has been reported for Ubuntu 20.04 or RedHat 8.
- </para>
- <para>
- Note: with some particular combination of OS, openssl and mysql-client
- libraries, there were reports of random crashes, in such case try to set
- the db_mysql module parameter opt_ssl_mode to 1.
+ Read the "Important Notes" section because it has relevant information
+ about configuring properly the module for various libssl versions,
+ components and operating systems.
</para>
</section>
<section id="tls.quick_start">
@@ -134,7 +116,7 @@ request_route {
<para>
The TLS module needs some special options enabled when compiling
Kamailio. These options are enabled by default, however in case
- you're using a modified Kamailio version or Makefile, make sure
+ you are using a modified Kamailio version or Makefile, make sure
that you enable -DUSE_TLS and -DTLS_HOOKS (or compile with make
TLS_HOOKS=1 which will take care of both options).
</para>
@@ -188,6 +170,29 @@ request_route {
</itemizedlist>
The bug reports can be viewed at <ulink url="http://rt.openssl.org/">http://rt.openssl.org/</ulink>.
</para>
+ <para>
+ Note 1: the tls module must be loaded before any other &kamailio; module
+ that uses libssl (OpenSSL library). A safe option is to have the tls module
+ loaded first (be in the first "loadmodule" in &kamailio;.cfg).
+ </para>
+ <para>
+ Note 2: for libssl v3.x, the core parameter "tls_threads_mode"
+ has to be set, see the Core Cookbook for possible values.
+ </para>
+ <para>
+ Note 3: using this module compiled with newer versions of libssl
+ (e.g., v1.1+) may require &kamailio; to be started with
+ <emphasis>--atexit=no</emphasis> command line parameters to avoid
+ calling C atexit callbacks inside the process ending during
+ daemonize procedure as well as during shut down, which can lead
+ to crashes because it destroys and then accesses shared memory. For
+ example, such case has been reported for Ubuntu 20.04 or RedHat 8.
+ </para>
+ <para>
+ Note 4: with some particular combination of OS, openssl and mysql-client
+ libraries, there were reports of random crashes, in such case try to set
+ the db_mysql module parameter opt_ssl_mode to 1.
+ </para>
</section>
#### 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)
- [x] New feature (non-breaking change which adds new functionality)
- [x] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3929
#### Description
The handling of the buffer and pointers in the siputils/chargingvector.c module was inconsistent and led to writing directly in the sip msg buffer, which resulted in the destruction of the SIP message as reported in the issue. During the testing more cases showed up where the PCV handling became ugly and inconsistent, especially in fault scenarios. Therefore more parts have been rewritten to account for those scenarios.
The $pcv(status) pseudo-variable has been added to reflect the state of the P-Charging-Vector in the message, whether it was parsed, had errors (no body or no icid-value), has been deleted or if none is there.
The sip_p_charging_vector() function returns a status value of what it has done, or if it was a no-op call.
A present PCV can only be generated once by the module, either after an explicit deletion or by a forced replacement. After that the call returns with no-op.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3994
-- Commit Summary --
* siputils: bug fix for sip_p_charging_vector
* siputils/doc: updated pcv documentation [skip ci]
-- File Changes --
M src/modules/siputils/chargingvector.c (346)
M src/modules/siputils/doc/siputils.xml (8)
M src/modules/siputils/doc/siputils_admin.xml (50)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3994.patchhttps://github.com/kamailio/kamailio/pull/3994.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3994
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3994(a)github.com>
Module: kamailio
Branch: master
Commit: d7c8bc5c58f672004894733d0e6d2a7cb00efe7a
URL: https://github.com/kamailio/kamailio/commit/d7c8bc5c58f672004894733d0e6d2a7…
Author: Eik Rentzow <rentzow(a)gmx.de>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-10-15T13:48:35+02:00
siputils: bug fix for sip_p_charging_vector
- Bug fix for #3929 and further improvements.
- New buffer usage for P-Charging-Vector handling.
- Added $pcv(status) pseudo-var.
- Added return values for sip_p_charging_vector().
- Much improved error case handling.
- Use send interface for icid-genearted-at:
The icid-generated-at parameter should carry the ip adress of the
egress interface and not of the interface where the message was received.
This is in accordance with other SBC solutions.
---
Modified: src/modules/siputils/chargingvector.c
---
Diff: https://github.com/kamailio/kamailio/commit/d7c8bc5c58f672004894733d0e6d2a7…
Patch: https://github.com/kamailio/kamailio/commit/d7c8bc5c58f672004894733d0e6d2a7…
Hi all,
I’d like to bring up some development topics related to the SIP parsing logic, specifically when handling sip: with embedded tel URIs scheme. The current behaviour, particularly when user=phone is present, is leading to some inconsistencies and potential confusion, and I believe it might require some refactoring or documentation updates.
Current Parsing Behavior:
When a tel: URI is embedded in a sip: scheme (e.g., user=phone is present), the parser currently copies the URI parsed parameters to sip_params, then splits the user part (like 123;param=value;param2=value2) into user and all the rest tel parameters to params. This behaviour is only triggered when the global phone2tel configuration option is enabled (which is the default).
Issues:
1. Inconsistent Handling of URI Parameters
There’s no consistency across modules on whether they use sip_params or params to get the URI parameters. While most modules correctly use sip_params, others use params. Normally, this works fine because sip_params and params hold the same data when user=phone is not present or phone2tel is disabled. However, when user=phone is present and phone2tel is enabled, params may be empty, leading to unexpected behavior in modules relying on it.
For example, the following modules are using params and many others:
* dmqnode.c (line 204)<https://github.com/kamailio/kamailio/blob/ba6ab04e06b0dfd66874749e0cb1225f2…>
* notification_peer.c (line 432)<https://github.com/kamailio/kamailio/blob/ba6ab04e06b0dfd66874749e0cb1225f2…>
While some may handle the differences between sip_params and params, not all of them do.
2. Unclear Intention of the phone2tel Global Parameter
The current parser code is quite old, and it’s unclear what the original intention behind the phone2tel global parameter was. As far as I understand, the sip: scheme can handle tel: URIs, and this is the most widely accepted specification. The role of phone2tel seems to blur the lines between the two schemes, leading to unexpected transformations.
Example of Unexpected Behavior:
Consider the following header:
P-Asserted-Identity: Display <sip:+1234;pname=pval@domain;user=phone>;tag=1234
If we apply the {tobody.user} transformation, the expected output should be the user part of the URI. Based on the RFC, we expected the transformation to return +1234;pname=pval. However, due to the phone2tel global configuration parameter, the parser treats it as a tel: scheme and returns only +1234. This behavior seems to be influenced by how the global parameter forces the parser to handle the URI.
Proposal:
To resolve these issues, I suggest the following:
1. Refactor Parameter Handling: Introduce a more explicit separation of tel_params and sip_params, and ensure all modules use the correct set of parameters based on the context. This would help enforce consistency across the codebase.
2. Update Documentation: Provide clear documentation regarding the behavior of phone2tel and how it impacts URI parsing. In particular, the transformation documentation should reflect the expected behavior depending on whether the URI is treated as sip: or tel:.
3. Review and Fix Modules: We should audit the modules that currently rely on params and ensure they are using sip_params where appropriate, especially in cases where user=phone could be present.
Any guidance or feedback on these points would be greatly appreciated. If you’ve encountered any related bugs or discovered other edge cases, please let me know so we can address them.
Best regards,
Xenofon
<!-- 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
- [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 #XXXX (replace XXXX with an open issue number)
#### Description
If the query failed, the result set should not be parsed and used. This results in an empty result set which will most likely lead to unwanted behavior.
Background: While troubleshooting, we detected that domain.reload actually replaces domains with an empty result set if mongodb connectivity fails.
```
DEBUG: db_mongodb [mongodb_dbase.c:849]: db_mongodb_store_result(): An error occurred: No suitable servers found (`serverSelectionTryOnce` set): [connection timeout calling ismaster on 'pdb-iop1-wrmg-2:27017'] [connection timeout calling ismaster on 'pdb-iop1-wrmg-1:27017']
DEBUG: domain [domain.c:365]: reload_tables(): number of rows in domain_attrs table: 0
DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 0 columns
DEBUG: <core> [db_res.c:138]: db_free_result(): freeing result set at 0x7fb0c9811848
DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [domains]
DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { }
DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "domain" : 1, "did" : 1 } }
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3996
-- Commit Summary --
* mongodb: fix cursor error resulting empty result set
-- File Changes --
M src/modules/db_mongodb/mongodb_dbase.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3996.patchhttps://github.com/kamailio/kamailio/pull/3996.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3996
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3996(a)github.com>
Module: kamailio
Branch: master
Commit: 2737bb19a363be7c0d67749b75f11c7e9d2d09f3
URL: https://github.com/kamailio/kamailio/commit/2737bb19a363be7c0d67749b75f11c7…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-10-08T15:03:55+02:00
http_async_client: fix warning deprecated-non-prototype
> Warning: ./http_multi.h:64:5: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
> 64 | int init_http_multi();
> | ^
> http_multi.c:403:5: note: conflicting prototype is here
> 403 | int init_http_multi(struct event_base *evbase, struct http_m_global *wg)
> | ^
> 1 warning generated.
---
Modified: src/modules/http_async_client/http_multi.h
---
Diff: https://github.com/kamailio/kamailio/commit/2737bb19a363be7c0d67749b75f11c7…
Patch: https://github.com/kamailio/kamailio/commit/2737bb19a363be7c0d67749b75f11c7…
---
diff --git a/src/modules/http_async_client/http_multi.h b/src/modules/http_async_client/http_multi.h
index 0f35a722306..8e3676b3ed1 100644
--- a/src/modules/http_async_client/http_multi.h
+++ b/src/modules/http_async_client/http_multi.h
@@ -61,7 +61,7 @@ extern int curl_verbose;
extern int curl_follow_redirect;
void set_curl_mem_callbacks(void);
-int init_http_multi();
+int init_http_multi(struct event_base *evbase, struct http_m_global *wg);
int multi_timer_cb(CURLM *multi, long timeout_ms, struct http_m_global *g);
void timer_cb(int fd, short kind, void *userp);
int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp);
From the build log
```
CC (gcc) [M kazoo.so] kazoo.o
CC (gcc) [M kazoo.so] kz_amqp.o
kz_amqp.c: In function 'kz_amqp_connection_open_ssl':
kz_amqp.c:857:17: warning: 'amqp_set_initialize_ssl_library' is deprecated [-Wdeprecated-declarations]
857 | amqp_set_initialize_ssl_library(1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kz_amqp.c:37:
/usr/include/rabbitmq-c/ssl_socket.h:233:16: note: declared here
233 | void AMQP_CALL amqp_set_initialize_ssl_library(amqp_boolean_t do_initialize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC (gcc) [M kazoo.so] kz_fixup.o
CC (gcc) [M kazoo.so] kz_hash.o
```
Functions description in the header file
https://github.com/alanxz/rabbitmq-c/blob/v0.13.0/include/rabbitmq-c/ssl_so…
```
/**
* Sets whether rabbitmq-c will initialize OpenSSL.
*
* \deprecated Since v0.13.0 this is a no-op. OpenSSL automatically manages
* library initialization and uninitialization.
*
* OpenSSL requires a one-time initialization across a whole program, this sets
* whether or not rabbitmq-c will initialize the SSL library when the first call
* to amqp_ssl_socket_new() is made. You should call this function with
* do_init = 0 if the underlying SSL library is initialized somewhere else
* the program.
*
* Failing to initialize or double initialization of the SSL library will
* result in undefined behavior
*
* By default rabbitmq-c will initialize the underlying SSL library.
*
* NOTE: calling this function after the first socket has been opened with
* amqp_open_socket() will not have any effect.
*
* \param [in] do_initialize If 0 rabbitmq-c will not initialize the SSL
* library, otherwise rabbitmq-c will initialize the
* SSL library
*
* \since v0.4.0
*/
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3466
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3466(a)github.com>