<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- Not yet - first let's see if the work is valid, then I'll recompose the whole work to satisfy this. Otherwise... if I need to fix something, it's too hard to work like this...
- [ ] Each component has a single commit (if not, squash them into one commit)
- ditto
- [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
<!-- Describe your changes in detail -->
Normally, the IMS P-CSCF should identify the clients (UEs) by the received IP address and ports on Rx. The current code is using a mix of that, plus using Contact and Via headers, with arguable potential security issues.
This patch adds a new parameter to `ims_registrar_pcscf` and `ims_qos` modules, allowing for an optional outsource of the IPsec functionality to another element, which is also in charge of checking/enforcing correct UE Via header. The existing code is allowed to work as before, with the default value of the flag being towards that.
List of functional changes:
- `ims_qos`
- added `trust_bottom_via` parameter
-
List of indirect changes:
- default I-CSCF config example contained a questionable line which adds a `+` as a prefix in Request-URI. After way too much time wasted to figure out why the Diameter LIR has bogus SIP or TEL URI values in UserName AVP, I have discovered this. Seems like someone had just tel-URIs in their network, but otherwise the blind addition of this prefix makes no sense to me.
- added a `str2ushort()` macro, since code was using some dangerous casting and macros with a larger type
-
List of non-functional fixes:
- spelling in comments
- comments at the end of line moved above the line they refer to; with just 80 columns code-formatting, commenting on the same line provides for some super weird and hard to read code, so IMHO should not be allowed (or ... much harder now... increase to 120 columns)
-
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3891
-- Commit Summary --
* squashed work
-- File Changes --
M misc/examples/ims/icscf/kamailio.cfg (4)
M src/core/ut.h (36)
M src/lib/ims/ims_getters.c (2)
M src/modules/ims_icscf/location.c (10)
M src/modules/ims_qos/ims_qos_mod.c (27)
M src/modules/ims_qos/ims_qos_mod.h (1)
M src/modules/ims_qos/rx_aar.h (4)
M src/modules/ims_qos/rx_authdata.h (2)
M src/modules/ims_qos/rx_avp.c (2)
M src/modules/ims_qos/rx_avp.h (1)
M src/modules/ims_registrar_pcscf/doc/ims_registrar_pcscf_admin.xml (39)
M src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c (18)
M src/modules/ims_registrar_pcscf/notify.c (2)
M src/modules/ims_registrar_pcscf/save.c (78)
M src/modules/ims_registrar_pcscf/service_routes.c (125)
M src/modules/ims_registrar_pcscf/subscribe.c (75)
M src/modules/ims_registrar_pcscf/subscribe.h (4)
M src/modules/ims_usrloc_pcscf/udomain.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3891.patchhttps://github.com/kamailio/kamailio/pull/3891.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3891
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3891(a)github.com>
### Description
On systems with a high number of TCP sessions there can be a significant performance regression observed, probably related to the newly added TCP connection tracking feature.
### Troubleshooting
#### Reproduction
No special configuration is necessary, just install the latest 5.7.x release, e.g. 5.7.3 on a production system with a lot of clients connected over TCP or TLS. You need to have a large number of clients connected to be able to observe the regression. For a high number of connections (e.g. more then 20.000 up to 30.000 connections) the Kamailio servers uses about 30% to 50% more CPU as with the old version.
#### Debugging Data
Two graphs were attached to this issue. The first shows the CPU load before (less load) and after the upgrade (increased load). The second is a flamegraph that shows that over 80% of the CPU time is spent in the newly added function tcp_connection_limit_srcip().
<img width="372" alt="cpu-load-before-after" src="https://github.com/kamailio/kamailio/assets/6481937/ec92c41b-25e2-4847-a4bc…">
![flamegraph](https://github.com/kamailio/kamailio/assets/6481937/5c2e3982-2d5b-4acd-a774-bad8fa64bd0a)
Most of the CPU time is spend in the TCP main process, as expected.
#### Log Messages
No special log messages could be observed.
#### SIP Traffic
### Possible Solutions
The TCP limit feature should probably be optimized to not cause such a large performance regression. It should be also possible to deactivate it completly and therefore getting a comparable performance as before the feature addition.
### Additional Information
Kamailio 5.7.3 and probably also git master version.
* **Operating System**:
Debian 11, Debian 12
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3759
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3759(a)github.com>
### Description
Currently secsipid has a method to sign arbitrary (json) data (`secsipid_sign`), however it has no converse method to check the signature. Currently, an attempt to check a `div` signature for example will yield a `-303` error (`SIPHdrInfo`). Rather than trying to have full parsing for every possible type of Identity header (which are likely to increase in variety), it would be good to simply check "is this signature valid by trusted key", possibly validating the `iat` timestamp as well, but without any other opinions on the header values.
### Expected behavior
A feature to check only the signature of an identity header.
#### Actual observed behavior
Currently the `secsipid_check_` family of functions fails for non- `shaken` passport types.
#### Debugging Data
The following DIV identity header was generated by secsipid's `secsipid_sign()` function, so it should be possible to reverse this to validate the signature:
```
Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6ImRpdiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9kLm10c2VjLm1lL2QzYTkvQmZUeGJVTlozS1FMLnBlbSJ9.eyJkZXN0Ijp7InRuIjpbIjE2MTI1NTU0MzIxIl19LCJpYXQiOiIxNzEwMTY5MzQ1Iiwib3JpZyI6eyJ0biI6IjE1NTU3MzU5MzA5In0sImRpdiI6eyJ0biI6IjE5NTI1NTU5ODc2In19.-0QF6-u6zgAQNoAhdiETuhAu7FuRDzxmFch_cTdhcbeWvUZ60NQXxdPM-JucpOtFaEdn9wnFreAZ_6vZoc_Phg;info=<https://d.mtsec.me/d3a9/BfTxbUNZ3KQL.pem>;alg=ES256;ppt=div
```
### Possible Solutions
Because it's fairly straight forward to investigate the JWT, it's not necessary to try to account for every possible passport type, etc. The act of validating the signature is the complicated part, so a function that does only that would be convenient.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
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**:
Currently alpine linux 3.19 in a docker container, but it should be pretty reproducible everywhere.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3784
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3784(a)github.com>
Hello all,
I've started working on integrating CMake as a build system for the Kamailio. This is an initial step towards potentially offering CMake as an alternative to the current build system across the entire Kamailio project.
Right now, the CMake configuration is quite basic and covers only the core module. It offers limited options described in Makefile.defs that are required to build the core module.
Some notes regarding the definitions can be found also in the CMakelists.notes<https://github.com/kamailio/kamailio/compare/master...cmake#diff-4e8ba0f2d5…> that made the build failed and maybe it's good to remove from current Makefiles as well, if i am not wrong.
Before we consider extending it to other modules and components, i would like some feedback whether you find it useful at all.
You can find the initial CMake files in the cmake branch. Please take a look and feel free to share any feedback or suggestions. Your input will be much appreciated and nessecary if we want CMake as a build system.
For anyone wanting to try and compile using cmake, here are some basic instructions on how to get you started.
Checkout the cmake branch of kamailio repo.
Create a new folder, let's call it build.
mkdir build && cd build
Then run CMake for the configuration
cmake .. (you can also then use ccmake . for a visual of the offered options)
Build and install using make
make -j4
make install
OR
Build and install using cmake
cmake --build .
cmake --install .
You can of course use the CMake variable CMAKE_INSTALL_PREFIX to change the installation paths as follows and of course other preprocessor defintions:
cmake -DCMAKE_INSTALL_PREFIX=./kamailio-cmake -DUSE_TCP=0 ..
This will install it in the build/kamailio-cmake folder but fails to build because USE_TCP is required for kamailio to build (Check CMakelists.notes).
Thank you all for your continuous contributions and support. Looking forward to hearing your thoughts and insights.
Best regards,
Xenofon
https://github.com/kamailio/kamailio/tree/cmake
[https://repository-images.githubusercontent.com/15101579/2d895000-e695-11e9…]<https://github.com/kamailio/kamailio/tree/cmake>
GitHub - kamailio/kamailio at cmake<https://github.com/kamailio/kamailio/tree/cmake>
Kamailio - The Open Source SIP Server for large VoIP and real-time communication platforms - - GitHub - kamailio/kamailio at cmake
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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3888
-- Commit Summary --
* usrloc: refactor some db queries using global usrloc_columns variable
-- File Changes --
M src/modules/usrloc/udomain.c (260)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3888.patchhttps://github.com/kamailio/kamailio/pull/3888.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3888
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3888(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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Issue: when using usrloc with db_redis, I get constant WARNING logs for 'delete' via usrloc timer. The real WARNING, in my opinion, is when doing full table scans(which is already logged as so).
Make logs less important when performing table scans using a match key.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3892
-- Commit Summary --
* db_redis: change logs on delete
-- File Changes --
M src/modules/db_redis/redis_dbase.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3892.patchhttps://github.com/kamailio/kamailio/pull/3892.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3892
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3892(a)github.com>
Hello,
I am considering to release Kamailio v5.6.6 (out of branch 5.6) later
this week (likely on Wednesday, July 3, 2024). If anyone is aware of
issues not yet on the bug tracker, report them there asap in order to
have a better chance to be fixed.
This is going to be the last release out of branch 5.6 to mark the end
of official/packaging maintenance.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Hello,
I am considering to release Kamailio v5.7.6 (out of branch 5.7) on
Tuesday, July 2, 2024. If anyone is aware of issues not yet on the bug
tracker, report them there asap in order to have a better chance to be
fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com