<!-- 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
<!-- Describe your changes in detail -->
- The code that loaded a JavaScript file used a fix buffer length of 128K on the stack. This has been changed so that the file size is determined and an attempt to allocate an appropriate buffer size temporarily is made. The file contents are then loaded into that buffer before being passed to the duktape engine.
- In addition a new module param 'loaddir' has been added that allows you to specify a directory containing .js files rather than specifying a single .js file to load with the existing 'load' param. If loaddir is set it will take a higher priority than load. All .js files in the directory are loaded into a temporary buffer and combined before passing to the duktape engine. This allows you to split logic/routes into separate .js files but load them all into the JavaScript engine.
- Updated documentation
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4221
-- Commit Summary --
* app_jstd: Added dynamic buffer sizing to load bigger .js files and Added ability to load all JavaScript files from a specified directory
-- File Changes --
M src/modules/app_jsdt/app_jsdt_api.c (175)
M src/modules/app_jsdt/app_jsdt_mod.c (2)
M src/modules/app_jsdt/doc/app_jsdt_admin.xml (31)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4221.patchhttps://github.com/kamailio/kamailio/pull/4221.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4221
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4221(a)github.com>
Module: kamailio
Branch: master
Commit: 4ed2449454d07594f9bc30622b7fada9d719c5a3
URL: https://github.com/kamailio/kamailio/commit/4ed2449454d07594f9bc30622b7fada…
Author: ngash <nick.gash(a)ccprosolutions.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-05-06T13:33:50+02:00
app_jsdt: Added dynamic buffer sizing to load bigger .js files and Added ability to load all JavaScript files from a specified directory
- The code that loaded a JavaScript file used a fix buffer length of 128K on the stack. This has been changed so that the file size is determined and an attempt to allocate an appropriate buffer size temporarily is made. The file contents are then loaded into that buffer before being passed to the duktape engine.
- In addition a new module param 'loaddir' has been added that allows you to specify a directory containing .js files rather than specifying a single .js file to load with the existing 'load' param. If loaddir is set it will take a higher priority than load. All .js files in the directory are loaded into a temporary buffer and combined before passing to the duktape engine. This allows you to split logic/routes into seperate .js files but load them all inbto the JavaScript engine.
- Updated documentation accordinglyapp_jsdt: Added dynamic buffer sizing to load bigger .js files and Added ability to load all JavaScript files from a specified directory
- The code that loaded a JavaScript file used a fix buffer length of 128K on the stack. This has been changed so that the file size is determined and an attempt to allocate an appropriate buffer size temporarily is made. The file contents are then loaded into that buffer before being passed to the duktape engine.
- In addition a new module param 'loaddir' has been added that allows you to specify a directory containing .js files rather than specifying a single .js file to load with the existing 'load' param. If loaddir is set it will take a higher priority than load. All .js files in the directory are loaded into a temporary buffer and combined before passing to the duktape engine. This allows you to split logic/routes into seperate .js files but load them all inbto the JavaScript engine.
- Updated documentation accordingly
---
Modified: src/modules/app_jsdt/app_jsdt_api.c
Modified: src/modules/app_jsdt/app_jsdt_mod.c
Modified: src/modules/app_jsdt/doc/app_jsdt_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/4ed2449454d07594f9bc30622b7fada…
Patch: https://github.com/kamailio/kamailio/commit/4ed2449454d07594f9bc30622b7fada…
<!-- 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
PR adds new core option `tls_connection_match_domain` with the default value 0 (old behavior)
to solve the problem when we need to have multiple TLS connections with different SNI to the same host:port endpoint.
for example: multiple customers (authorized by cert) for MS Teams on the single kamailio instance.
originally, functions `_tcpconn_find` and `_tcpconn_add_alias_unsafe` use only endpoint and protocol to match connections.
setting `tls_connection_match_domain` to `1` will match additionaly with `tls_domain_str()` output for matched TLS domain.
as a result, we will be able to establish new TLS connections if TLS domain is changed instead of reusing of the existent one with the wrong SNI.
i'm not considering this PR as the final version but we need something to start with. looking forward for any input.
FIXME: not found the right place where new core option should be documented.
#### Behavior difference example
* /etc/kamailio/kamailio.cfg
(relays all requests to 127.0.0.1:5081 using TLS domain matched by server_id retreived from RURI-User):
```
#!KAMAILIO
listen=udp:127.0.0.1:5060
listen=tls:127.0.0.1:5061
enable_tls = yes
tls_connection_match_domain = 1
debug = 3
loadmodule "tls.so"
modparam("tls", "config", "/etc/kamailio/tls.cfg")
modparam("tls", "xavp_cfg", "tls")
loadmodule "ctl.so"
loadmodule "pv.so"
loadmodule "tm.so"
route {
$xavp(tls=>server_id) = $rU;
t_relay_to_tls("127.0.0.1", 5081);
}
```
* /etc/kamailio/tls.cfg:
```
[server:default]
certificate = /etc/ssl/certs/ssl-cert-snakeoil.pem
private_key = /etc/ssl/private/ssl-cert-snakeoil.key
[client:any]
server_name = server_name_1.invalid
server_id = 1
[client:any]
server_name = server_name_2.invalid
server_id = 2
```
* run tls server:
```bash
$ openssl s_server -port 5081 -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key
```
* send `INVITE sip:1@127.0.0.1:5060` and `INVITE sip:2@127.0.0.1:5060` using sipp:
```bash
$ for u in 1 2; do sipp -sn uac -m 1 -nd -recv_timeout 1 -bg -s $u 127.0.0.1:5060; done
```
* resulting `tls.list` for kamailio instance WITHOUT `tls_connection_match_domain = 1` (old behavior):
```bash
# kamcmd tls.list
{
id: 1
dom: TLSc<any:server_name_1.invalid>
sni: N/A
timestamp: 2025-04-24 14:07:20
timeout: 118
src_ip: 127.0.0.1
src_port: 5081
dst_ip: 127.0.0.1
dst_port: 58808
cipher: unknown
ct_wq_size: 1162
enc_rd_buf: 0
flags: 1
state: tls_connect
}
```
* `tls.list` for kamailio instance WITH `tls_connection_match_domain = 1` (new behavior):
```bash
# kamcmd tls.list
{
id: 1
dom: TLSc<any:server_name_1.invalid>
sni: N/A
timestamp: 2025-04-24 14:09:10
timeout: 117
src_ip: 127.0.0.1
src_port: 5081
dst_ip: 127.0.0.1
dst_port: 55480
cipher: unknown
ct_wq_size: 581
enc_rd_buf: 0
flags: 1
state: tls_connect
}
{
id: 2
dom: TLSc<any:server_name_2.invalid>
sni: N/A
timestamp: 2025-04-24 14:09:10
timeout: 117
src_ip: 127.0.0.1
src_port: 5081
dst_ip: 127.0.0.1
dst_port: 55488
cipher: unknown
ct_wq_size: 581
enc_rd_buf: 0
flags: 1
state: tls_connect
}
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4222
-- Commit Summary --
* core: support tls connection domain matching
* tls: implement match_domain,match_connections_domain hooks
* tls_wolfssl: implement match_domain,match_connections_domain hooks
-- File Changes --
M src/core/cfg.lex (3)
M src/core/cfg.y (9)
M src/core/globals.h (1)
M src/core/tcp_main.c (14)
M src/core/tls_hooks.h (9)
M src/main.c (4)
M src/modules/tls/tls_mod.c (2)
M src/modules/tls/tls_rpc.c (12)
M src/modules/tls/tls_server.c (97)
M src/modules/tls/tls_server.h (8)
M src/modules/tls_wolfssl/tls_rpc.c (12)
M src/modules/tls_wolfssl/tls_server.c (94)
M src/modules/tls_wolfssl/tls_server.h (7)
M src/modules/tls_wolfssl/tls_wolfssl_mod.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4222.patchhttps://github.com/kamailio/kamailio/pull/4222.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4222
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4222(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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #4226
#### Description
<!-- Describe your changes in detail -->
- Improve and add missing function documentation `list_peers`.
- Use correct identifier in `struct_add` rpc function and cast `time_t` for time_t field.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4227
-- Commit Summary --
* cdp: Cast time_t and use 'L' (long long) identifier in rpc function.
* cdp/docs: Add missing list_peers function
-- File Changes --
M src/modules/cdp/cdp_rpc.c (4)
M src/modules/cdp/doc/cdp_admin.xml (29)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4227.patchhttps://github.com/kamailio/kamailio/pull/4227.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4227
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4227(a)github.com>
- format as well
<!-- 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
- [x] Related to issue #4227
#### Description
<!-- Describe your changes in detail -->
There was missing information of type identifiers that can be used in [rpc tutorial docs](https://www.kamailio.org/docs/docbooks/5.7.x/rpc_api/rpc_api.html#rpc…. This is an update to those docs. The most recent I could find was for 5.7.
Maybe there is a need for manual updating the page?
Also during the relevant PR #4227 , we found the `t` identifier is never used in the code. since it can overflow on 64bit systems due to being a `long` and not `int` type when saved/load, maybe we can remove it completely?. One can just cast the `time_t` to the relevant type and use the correct identifier as done in https://github.com/kamailio/kamailio/blob/2081b3aac394223b68b849fbac2a9e5ac…
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4228
-- Commit Summary --
* Update type identifiers that can be used in the RPC API
-- File Changes --
M doc/tutorials/rpc/kamailio_rpc.xml (86)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4228.patchhttps://github.com/kamailio/kamailio/pull/4228.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4228
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4228(a)github.com>