(also added sr-dev)
Hello,
It probably not exactly what you are looking for, but a common way for modules to provide "hooks" towards the configuration for later extensions is about the event_route facility. You can find many of this event routes used from modules (on simple example is dispatcher module).
Inter-module communication or usage is usually facilitated by an API export from the providing module, and an API import/binding on the consuming module. Examples here are the usrloc and registrar modules. The sl module API is also used from many other modules to send messages.
Cheers,
Henning
-----Original Message-----
From: Valentin Christoph <Christoph.Valentin(a)kontron.com>
Sent: Montag, 24. April 2023 15:44
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Subject: [SR-Users] hooking mechanism for routing blocks
Dear all,
I am looking for some hooking mechanism for user defined routing blocks.
Is something like this already available?
1) a common part of the routing configuration shall not (or only slightly) be changed, after some hooks have been implemented
Something like a function "engage_hooks()" of some "hook_module"?
:
Routing config that should not be changed by application developers
engage_hooks(HOOK_TYPE);
Routing config that should not be changed by application developers
:
2) one application developer may "hook" new parts of the routing configuration into this, by
modparam("hook_module", "hook", "name=MY_RB;type=HOOK_TYPE;prio=50);
:
:
Route [MY_RB] {
Do something at hook HOOK_TYPE;
}
:
:
3) another application developer might want to "hook" into the same HOOK_TYPE with a higher priority
modparam("hook_module", "hook", "name=ANOTHER_RB;type=HOOK_TYPE;prio=20);
:
:
Route [ANOTHER_RB] {
Do another thing with higher priority at hook HOOK_TYPE
}
:
:
Kr,
Christoph
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
### Description
Have a certificate with the following Subject Alternative Name value:
DNS:www.company.net, DNS:company.com, DNS: company.net
Calling `$tls_peer_san_hostname` (and the other pv's/select that reference SAN) only returns `www.company.net` (first entry)
This does not support the spec which allows multiple entries (rfc2459 I believe).
### Troubleshooting
Logged values of different SAN back select and pseudovariables and only appears to return the first entries.
#### Reproduction
Create a self signed certificate with multiple alt names (I used this as a guide: https://support.citrix.com/article/CTX135602/how-to-create-a-selfsigned-san…)
Updated my Kamailio config to log different tls pv and selects (eg tls_peer_san_hostname, @tls.peer.dns select, but others as well)
Confirm only one value is provided.
#### Debugging Data
```
[www.company.net] is the only value present in the corresponding variables
```
### Possible Solutions
Update variables to provide access to SAN entries to return all the values
Create new variable to provide access to all SAN entries
### Additional Information
https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#tls_peer_san_…http://www.kamailio.org/wiki/cookbooks/5.2.x/selects#tlspeerdns
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3400
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3400(a)github.com>
- adds count pv and sel for DNS, EMAIL, IP, URI
- adds ability to access SAN entries by index
fix #3400
<!-- Kamailio Pull Request Template -->
#### 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 #3400
#### Description
Fix issue #3400 that describes that tls module cannot properly handle certificates with multiple SAN entries.
Add ability to access SAN entries by index.
Add ability to get count of supported SAN entries by type of entry.
If index is not provided will return first entry (current behavior to remain backwards compatible.
Tested by creating a self signed SAN cert with 3 DNS entries and confirmed expected results for:
$(tls_peer_san_hostname[2])
$(tls_peer_san_hostname);
$tls_peer_san_count(DNS)
$tls_peer_san_count(URI)
$tls_peer_san_count(EMAIL)
$tls_peer_san_count(IP)
$sel(tls.peer.dns[1])
$sel(tls.peer.dns)
$sel(tls.peer.count[\"DNS\"])
$(tls_peer_san_ip[0])
$(tls_peer_san_uri)
$sel(tls.peer.ip[0])
$sel(tls.peer.count[\"EMAIL\"])
$(tls_my_san_hostname[2])
$(tls_my_san_hostname)
$tls_my_san_count(DNS)
$tls_my_san_count(URI)
$tls_my_san_count(EMAIL)
$tls_my_san_count(IP)
$sel(tls.my.dns[1])
$sel(tls.my.dns)
$sel(tls.my.count[\"DNS\"]
$(tls_my_san_ip[0])]
$(tls_my_san_uri)
$sel(tls.my.ip[0])
$sel(tls.my.count[\"EMAIL\"])
Also repeated the test with a self signed cert with 3 DNS entries, 1 IP entry, 1 EMAIL entry and 1 URI entry
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3408
-- Commit Summary --
* tls: get san entries by index
-- File Changes --
M src/modules/tls/tls_select.c (314)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3408.patchhttps://github.com/kamailio/kamailio/pull/3408.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3408
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3408(a)github.com>
### Description
Our partner sending a call with this header
```
From: "COVER JERRY & M" <sip:+12099283442@206.147.236.174:5060;otg=TLMNCAXFDS0_3887>;tag=gK0c7f90e2
```
According [RFC3261](https://www.rfc-editor.org/rfc/rfc3261#section-25.1)
```
Several rules are incorporated from RFC 2396 [5] but are updated to
make them compliant with RFC 2234 [10]. These include:
reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
/ "$" / ","
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" / "'"
/ "(" / ")"
escaped = "%" HEXDIG HEXDIG
```
Also
```
SIP follows the requirements and guidelines of RFC 2396 [5] when
defining the set of characters that must be escaped in a SIP URI, and
uses its ""%" HEX HEX" mechanism for escaping. From RFC 2396 [5]:
The set of characters actually reserved within any given URI
component is defined by that component. In general, a character
is reserved if the semantics of the URI changes if the character
is replaced with its escaped US-ASCII encoding [5]. Excluded US-
ASCII characters (RFC 2396 [5]), such as space and control
characters and characters used as URI delimiters, also MUST be
escaped. URIs MUST NOT contain unescaped space and control
characters.
```
And
```
Expanding the hname and hvalue tokens in Section 25 show that all URI
reserved characters in header field names and values MUST be escaped.
```
For now, looks like `the sanity` module does not check reserver char usage.
This ticket was created to collect recommendations for feature implementation.
Should be checked headers?
Maybe a similar check is already present in the code and you can provide a reference?
Unscaped reserved char usage in "From", "To", "P-Asserted-Identity" and "Remote-Party-ID" for display name breaking SIP message (for example the "lost" module cannot parse properly "From" header). Should such be implemented in the Kamailio core also?
### Expected behavior
One of these expected:
1) Kamailio drop a message with reserved char usage in the header names and values. For TCP and TLS transport drop connection;
2) sanity module allows checking reserved char usage in the header names and values.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3421
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3421(a)github.com>
Module: kamailio
Branch: master
Commit: 4c8276fcf268a690ea671c4ddeaad1f89e293565
URL: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
kex: typos
---
Modified: src/modules/kex/core_stats.c
Modified: src/modules/kex/doc/kex_admin.xml
Modified: src/modules/kex/kex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Patch: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
---
diff --git a/src/modules/kex/core_stats.c b/src/modules/kex/core_stats.c
index 565ce4e77d7..816ae39a90f 100644
--- a/src/modules/kex/core_stats.c
+++ b/src/modules/kex/core_stats.c
@@ -409,7 +409,7 @@ struct rpc_list_params {
/**
- * Satistic getter RPC callback.
+ * Statistic getter RPC callback.
*/
static void rpc_get_grp_vars_cbk(void* p, str* g, str* n, counter_handle_t h)
{
@@ -644,7 +644,7 @@ static void rpc_stats_fetchn_statistics(rpc_t* rpc, void* ctx)
}
/**
- * Satistic reset/clear-er RPC callback..
+ * Statistic reset/clear-er RPC callback..
*/
static void rpc_reset_or_clear_grp_vars_cbk(void* p, str* g, str* n,
counter_handle_t h)
diff --git a/src/modules/kex/doc/kex_admin.xml b/src/modules/kex/doc/kex_admin.xml
index 34484bc4ec8..5c597e97047 100644
--- a/src/modules/kex/doc/kex_admin.xml
+++ b/src/modules/kex/doc/kex_admin.xml
@@ -88,7 +88,7 @@ setsflag("$var(flag)");
<section id="kex.f.issflagset">
<title><function moreinfo="none">issflagset(flag)</function></title>
<para>
- Return true of the script flag is set.
+ Return true if the script flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -179,7 +179,7 @@ setbflag("$var(flag)", "1");
<section id="kex.f.isbflagset">
<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
<para>
- Return true of the branch flag is set.
+ Return true if the branch flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -762,7 +762,7 @@ resetdebug();
</title>
<para>Print the list of available internal statistics.</para>
<para>NOTE: the result is an array of strings that have the list of
- statistics formated like "name = value", being propagated over the time
+ statistics formatted like "name = value", being propagated over the time
from the MI variant. Use "stats.fetch" or "stats.fetchn"commands to have
a more JSON-friendly output.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
@@ -785,7 +785,7 @@ resetdebug();
<para>Print the list of available internal statistics with a more
json friendly output. Each printed statistic is a field in the output
structure: {"statsgroup.statsname" : "statsvalue"}. The value is
- represented as string to accomodate large numbers.</para>
+ represented as string to accommodate large numbers.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be printed. If set to 'all' then all statistics are printed; if
set to 'statsgroup:' then all statistics in the group are printed;
diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index e46e85b5cf4..1927c7343d3 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -141,7 +141,7 @@ static int mod_init(void)
register_pkg_proc_stats();
pkg_proc_stats_init_rpc();
- /* per module memmory debugging RPC command */
+ /* per module memory debugging RPC command */
mod_stats_init_rpc();
return 0;