<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
Hello, I am trying to setup db_redis with TLS and redis-cluster support, I get the following errors during installation.
### Troubleshooting
#### Reproduction
Install hiredis(v1.2.0) and hiredis-cluster(v0.13.0) from source, both with ssl support.
Then install kamailio 5.8.1 from source with db_redis module
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### 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).
-->
```
37.77 CC (gcc) [M db_redis.so] db_redis_mod.o
37.85 CC (gcc) [M db_redis.so] redis_connection.o
37.90 redis_connection.c: In function 'db_redis_connect':
37.90 redis_connection.c:129:9: error: unknown type name 'redisSSLContext'; did you mean 'redisContext'?
37.90 129 | redisSSLContext *ssl = NULL;
37.90 | ^~~~~~~~~~~~~~~
37.90 | redisContext
37.90 redis_connection.c:166:17: warning: implicit declaration of function 'redisInitOpenSSL' [-Wimplicit-function-declaration]
37.90 166 | redisInitOpenSSL();
37.90 | ^~~~~~~~~~~~~~~~
37.90 redis_connection.c:167:23: warning: implicit declaration of function 'redisCreateSSLContext' [-Wimplicit-function-declaration]
37.90 167 | ssl = redisCreateSSLContext(
37.90 | ^~~~~~~~~~~~~~~~~~~~~
37.90 redis_connection.c:167:21: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
37.90 167 | ssl = redisCreateSSLContext(
37.90 | ^
37.91 redis_connection.c:196:17: warning: implicit declaration of function 'redisClusterSetOptionEnableSSL'; did you mean 'redisClusterSetOptionMaxRetry'? [-Wimplicit-function-declaration]
37.91 196 | redisClusterSetOptionEnableSSL(con->con, ssl);
37.91 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37.91 | redisClusterSetOptionMaxRetry
37.93 make[2]: *** [../../Makefile.rules:100: redis_connection.o] Error 1
37.93 make[1]: *** [Makefile:508: modules] Error 1
37.93 make[1]: Leaving directory '/root/build/kamailio/src'
37.93 make: *** [Makefile:34: all] Error 2
```
### Additional Information
* **Kamailio Version**:
```
Kamailio 5.8.1
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
Debian 12
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3893
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3893(a)github.com>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
Tried to verify a dubious JWT, but I get a token decoding error. I tried different variations of the key, such as `.pem`, `.key` extensions, `PKCS1`, `PKCS8` formats, reading the key from a variable or file.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
Have the following Kamailio config:
```
loadmodule "jwt.so"
...
modparam("jwt", "key_mode", 0)
....
$var(authorization_header_value) = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyIiwianRpIjoiYmQ1NzlhZTYyZjg2ODE5N2I5OTk1YTFkOWM4NGZkOGFiNWIyYWI4Nzk5YzM0OWVmYjBkNjg1NWFiNDcwYWUzOTYyMzFmYzc5NjIxZDQxODciLCJpYXQiOjE3MjkxODU3MTguNjQxMjI1LCJuYmYiOjE3MjkxODU3MTguNjQxMjI";
$var(jwt_verification) = jwt_verify("/etc/kamailio/oauth_pub.pem", "RS256",
"sub='$fU'",
"$var(authorization_header_value)"
);
...
```
oauth_pub.pem:
```
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5mfAgdn7JaiRS2Bsov4S
zTlGLSe2wxbdUxIreTcqs88PmWOBtuSeQg5tU3CRnPtsuuRJrlUniV5g56YAHrnt
Qe8meu877iTrcJB6Cii3n+d7SgwCfjMvaFBR+mdGsidAyGBpRhoPrH7SD6CRpBLr
Mxylcgqw4uH/0HdF+B8P5motUQz/tul/UKsq1nvC2AOOzFel1IsUah8dQuxzMx+P
RYcsngJam8TkGr6QidTXc2rD4lEoCD1s/huGUq55bc19J3yRliN2j8cO9j1bGTsp
GYEVtA3PiH/73BZTa3FHbhRYqhvjYacC8eWBFhwThC9CgPyOXrq4L7p9tJAlNwmd
dQHhIzZ9vugQuhfnuUTb0/r2tjpsSPL7etgJdxtZ4Xh9aBEpYn//RAgu5Dkauc2S
XF+uLWwBptFTM3SNppDPMdjRkYakWjVP2pgBGMmrINFb8RQAPEJzD1gVt0fYCxaY
jiazbSc9FPfSbFENHq+r8D7OivpiW0q9+tSZbYmAFzZekoUAoboQThSdRcOy9tFz
196xfg4dOyxkRGGHstz28qBv340ppjnHQd+RZOvbr8s2zEIxGiOpfX8CuLur/nKl
Ld3qtzg0caqDz6nsYK+95rExnbtU+gFcHnwtMdk3R8X6lVHzDeTjO2Nk4Zo023zo
qFH/rRyJBOp98fQPOpx5qncCAwEAAQ==
-----END PUBLIC KEY-----
```
#### 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.
```
(paste your debugging data here)
```
-->
#### 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).
-->
```
[jwt_mod.c:501]: ki_jwt_verify_key(): failed to decode jwt value
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
```
(paste your sip traffic here)
```
-->
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
I've wrote a C++ program using `libjwt` to make sure the issue is not neither my key, nor `libjwt`. And they aren't. Here is the program:
```cpp
#include <iostream>
#include <string>
#include <jwt.h>
static const char jwt_test[] = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyIiwianRpIjoiZDY2NDQ4MTdhYWRhNTQ1MDI1YmUwZmU1M2I1ZmFhYTdkZGI3NTY5NTBiMDYxMzk5MzFmNTQ1ZjhkMmE4N2ZhYjU0ODgzNjJhZGNiMWQ5ZTkiLCJpYXQiOjE3MjkyMjg5NjIuMzg5MDI3LCJuYmYiOjE3MjkyMjg5NjIuMzg5MDMzLCJleHAiOjE3MjkyNzIxNjIuMzc5MTg3LCJzdWIiOiIxNDQ0ODEiLCJzY29wZXMiOltdLCJ1c2VyIjp7ImlkIjoxNDQ0ODEsImFjY291bnRfaWQiOjEyOTMyNn0sIm1veHRyYS10b2tlbiI6Ik1WUXpNekZVTU1hdlFET2hNVlNabEdRZ1ptQUNPRmNGU1JKZEVGNGZTQTFFRWxJLVVCMTRkREZVTVZkbFkxY0xjaHhrWkhrU1pnVjVERUppQ0dKSEJWZGxYQTFMQmwwYUF4MUdHbHdkX0RmbHhORGRNMXMzOXlabjhMMEV5USIsImRldmljZSI6eyJpZCI6ImY4MzI0NDkyLWJiYjQtNGJiNC04ZWQxLWZlMTM1OWQwOTNlNSIsInR5cGUiOiJ3ZWIiLCJ2ZXJzaW9uIjoiMS43LjAifX0.E_6jsC7yxPZgHRry55J0oOBzw25tvlfnWRBqSwLVFeAtavkVrYGmH9BGaByaAhebKNijy2WUg1X8Ug0N9Z9cc3P8u2wDSlvlzTNrxnPqdxMrKtP5wiIbImXboobFqKXLRmbor_9I7r0lBlX-e0xSis-PTaBqH40hDYPj0rR5cqnrszSkEMd2jFdiLL5BoF0pqysvrXA631KKA9oHGzAivib_GOddHeUOAVs7-hMVdnDqgrzZ6lDYkQndutrHpwILZWz09ngJBbRh_mN_cE4dDxghgeSotXADT-h5DlokV8ChkgkmHh6m4gU2lvnb7aY9dbCp9R44T1Rpz1P_HhPQ27p1Sgin40Oc2abBwDePw_chl0ajJHuhJCiK7YHbcmzcv3dZ-igVMYpMqhGIlyyuAHCSrKFVFLhodA1xlyCmMqJfFPOZ6DdKzbAQDWPN2xsCMy7WkGT5KmBQR5wWJRIRbTj4OUWo6iUrQdNyjB0F1RKqkuZlz414Hj0tkS5GlS1rfxOtS4yc2m_ERGomSmpDgoq2zpA5o3oJJWXqA7TzT8X_9Up5DkVQCMGW6Z2OT9Sr8hNjIXB1qgYiiZtNf9_b4bma5JEwVvR2-qcZ92V6owFTYx78smdyOgAaMlBQ_9AM6kARz4ZnC3Mz2feJT2qKLP-z9senqIB8k_xNx2lbU2w";
static unsigned char key[16384];
static size_t key_len;
static void read_key(const char *key_file)
{
FILE *fp = fopen(key_file, "r");
int ret = 0;
fp = fopen(key_file, "r");
key_len = fread(key, 1, sizeof(key), fp);
fclose(fp);
key[key_len] = '\0';
}
int main()
{
jwt_t *jwt = NULL;
int ret = 0;
read_key("oauth_pub.pem");
ret = jwt_decode(&jwt, jwt_test, key, key_len);
printf("Decoding exit status: %d\n", ret);
printf("User ID: %s\n", jwt_get_grant(jwt, "sub"));
return 0;
}
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.2 (x86_64/linux) 3fa5f4
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: 3fa5f4
compiled on 10:39:56 Jun 12 2024 with gcc 8.5.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
Rocky Linux 8.10 (Green Obsidian)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4003
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4003(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
- [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
#### Description
don't reinvent the wheel and just use core macro
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4004
-- Commit Summary --
* rtpengine: use core STR_EQ macro
-- File Changes --
M src/modules/rtpengine/rtpengine.c (11)
M src/modules/rtpengine/rtpengine_hash.c (34)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4004.patchhttps://github.com/kamailio/kamailio/pull/4004.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4004
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4004(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
- [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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
In case of Emergency-Registrations the S-CSCF was wrongly setting the expires of the `;sos` contacts to `em_min_expires` if they were above `em_max_expires`.
Other smaller related fixes:
- Fixed also another typo in the config params definition.
- Added some code to more easily make sense of which attributes of a struct are set with what.
- Added conditions to respect the parameter documentation which indicate that if set to 0, the expires conditions won't be used.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3989
-- Commit Summary --
* ims_registrar_scscf: fixing em_max_expires
-- File Changes --
M src/modules/ims_registrar_scscf/config.c (26)
M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c (2)
M src/modules/ims_registrar_scscf/save.c (14)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3989.patchhttps://github.com/kamailio/kamailio/pull/3989.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3989
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3989(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)
- [ ] 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 #3876
#### Description
<!-- Describe your changes in detail -->
This PR add the schemas for the table needed for the module ims-icscf
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3991
-- Commit Summary --
* Add ims_icscf db schema
-- File Changes --
A src/lib/srdb1/schema/kamailio-ims_icscf.xml (14)
A src/lib/srdb1/schema/nds_trusted_domains.xml (41)
A src/lib/srdb1/schema/s_cscf.xml (49)
A src/lib/srdb1/schema/s_cscf_capabilities.xml (58)
M utils/kamctl/kamdbctl.base (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3991.patchhttps://github.com/kamailio/kamailio/pull/3991.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3991
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3991(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 #3297
#### Description
<!-- Describe your changes in detail -->
The setup is a kamailio with no available rtpengine. (e.g. has a list with rtpengine urls but those are not reachable)
Recently had a crash similar to #3297, but in an outdated kamailio version (5.5.7). Tried to reproduce this in 5.5.7 and 5.8.3 but could not crash any of them. However I managed to get the logs similar to ones right before the crash happened:
```
2024-10-04T17:39:58.026206+03:00 kamailio[450237]: ERROR: {1 1 INVITE 203-450290(a)192.168.100.93} <core> [core/action.c:1595]: run_actions(): alert - action [corefunc (16)] cfg [/home/stefan/kamailio.cfg:625] took too long [29310906 us]
```
...directly related to how much rtpengine_manage() function took to execute. So routing of SIP is delayed by that ammount.
Tracked this in code, down to where this lock is get, when "aggressive_redetection" modparam is enabled: https://github.com/kamailio/kamailio/blob/66fe6eb71e58a02222d1a2fb00f9a0cdb…
I will double check that part of the code, since I don't think a lock get is necessary. It only updates a value inside a node, inside the list of nodes, but not changes the list links at all. (this in another PR)
For now I propose to disable this aggressive_redetection mechanism by default. Since it delays the SIP routing logic when no rtpengines available (and in some cases lead to crashes in transaction module).
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3992
-- Commit Summary --
* rtpengine: disable aggressive redetection by default
-- File Changes --
M src/modules/rtpengine/config.c (2)
M src/modules/rtpengine/doc/rtpengine_admin.xml (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3992.patchhttps://github.com/kamailio/kamailio/pull/3992.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3992
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3992(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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
- Enable `app_python3s` module to build with Free Threading CPython builds
- Can be gated with `-DKSR_PYTHON_DISABLE_FREETHREADING`
- If Python is a non-free-threading build this change has no effect
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3987
-- Commit Summary --
* app_python3s: initial support for free-threading Python
-- File Changes --
M src/modules/app_python3s/apy3s_kemi.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3987.patchhttps://github.com/kamailio/kamailio/pull/3987.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3987
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3987(a)github.com>
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);