Module: kamailio
Branch: master
Commit: dfd5358fd4a685d5c368753e826bff63c4e38988
URL: https://github.com/kamailio/kamailio/commit/dfd5358fd4a685d5c368753e826bff6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-16T09:31:34+02:00
dispatcher: docs for event_callback_mode parameter
---
Modified: src/modules/dispatcher/doc/dispatcher_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]dfd5358fd4a685d5c368753e826bff6…
Patch: https://github.com/kamailio/kamailio/commit/dfd5358fd4a685d5c368753e826bff6…
---
diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml
index 1f897f8335b..9429afba67f 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1073,6 +1073,40 @@ end
</example>
</section>
+ <section id="dispatcher.p.event_callback_mode">
+ <title><varname>event_callback_mode</varname> (int)</title>
+ <para>
+ Controls when the event_route or the KEMI event callback function
+ are executed. If set to 0, they are executed when the destination
+ state changes based on OPTIONS keepalives or the use of config
+ functions to set the state (e.g., ds_mark_dst(...)). If set to 1,
+ they are executed only on state change due to OPTIONS keepalives.
+ </para>
+ <para>
+ Note that event routes are not executed on RPC commands setting
+ the destination state.
+ </para>
+ <para>
+ <emphasis>
+ Default value is '0'.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>event_callback_mode</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("dispatcher", "event_callback_mode", 1)
+...
+-- event callback function implemented in Lua
+function ksr_dispatcher_event(evname)
+ KSR.info("===== dispatcher module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
+
<section id="dispatcher.p.ds_attrs_none">
<title><varname>ds_attrs_none</varname> (int)</title>
<para>
@@ -2634,39 +2668,45 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
<section id="dispatcher.ex.event_routes">
<title>Event routes</title>
<section>
- <title>
- <function moreinfo="none">dispatcher:dst-down</function>
- </title>
- <para>
+ <title>
+ <function moreinfo="none">dispatcher:dst-down</function>
+ </title>
+ <para>
When defined, the module calls event_route[dispatcher:ds-down]
when a destination goes down (becomes probing). A typical use
case is to update NMC equipment as to the status of a destination.
- </para>
+ </para>
+ <para>
+ Its execution is controlled by event_callback_mode parameter.
+ </para>
<programlisting format="linespecific">
...
event_route[dispatcher:dst-down] {
xlog("L_ERR", "Destination down: $rm $ru ($du)\n");
}
...
- </programlisting>
+</programlisting>
</section>
<section>
- <title>
- <function moreinfo="none">dispatcher:dst-up</function>
- </title>
- <para>
+ <title>
+ <function moreinfo="none">dispatcher:dst-up</function>
+ </title>
+ <para>
When defined, the module calls event_route[dispatcher:ds-up]
when a destination that was previously down (probing) comes up.
A typical use case is to update NMC equipment as to the status
of a destination.
- </para>
+ </para>
+ <para>
+ Its execution is controlled by event_callback_mode parameter.
+ </para>
<programlisting format="linespecific">
...
event_route[dispatcher:dst-up] {
xlog("L_ERR", "Destination up: $rm $ru\n");
}
...
- </programlisting>
+</programlisting>
</section>
</section>
[View Less]
sem32 created an issue (kamailio/kamailio#4325)
### Description
The issue: in 15 second after start of kamailio, it stops to read the UDP socket localhost:5060
### Troubleshooting
<img width="683" height="406" alt="Image" src="https://github.com/user-attachments/assets/b93ed7d3-8944-477b-867b-ca7fcae8…" />
#### Reproduction
Preconditions:
- More than one worker for UDP localhost:5060
- Kamailio receives SIP OPTION from the Asterisk by UDP localhost
- In the Kamailio's script we have …
[View More]a logic to send the SIP OPTION by TLS. We modify $ru and add to it ";transport=TLS"
- 25+ sip trunks which generates SIP OPTIONS with transport TLS
- all the trunks are resolvable but not reachable (don't listen the port)
- libssl3
#### Debugging Data
[gdb_239054.txt](https://github.com/user-attachments/files/21236064/gdb_2390…
[gdb_239053.txt](https://github.com/user-attachments/files/21236065/gdb_2390…
### Possible Solutions
We have no issue in case we have:
- only one worker for UPD localhost and any version of libssl (libssl3 or libss1.1)
- or use libssl1.1 and any amount of workers
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.8.6 (aarch64/linux) a14e49
flags: , EXTRA_DEBUGUSE_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-NOSMP, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES
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: a14e49
compiled on 14:10:21 Jul 15 2025 with gcc 12.2.0
```
* **Operating System**:
```
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
# uname -a
Linux semen02 6.1.0-37-cloud-arm64 #1 SMP Debian 6.1.140-1 (2025-05-22) aarch64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4325
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4325(a)github.com>
[View Less]
Module: kamailio
Branch: master
Commit: 33ba71c209cd612ce59ea547d42c4da11304e5a5
URL: https://github.com/kamailio/kamailio/commit/33ba71c209cd612ce59ea547d42c4da…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2025-07-15T12:01:10+02:00
modules: readme files regenerated - ndb_redis ... [skip ci]
---
Modified: src/modules/ndb_redis/README
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]33ba71c209cd612ce59ea547d42c4da…
Patch: https://github.com/kamailio/kamailio/commit/33ba71c209cd612ce59ea547d42c4da…
---
diff --git a/src/modules/ndb_redis/README b/src/modules/ndb_redis/README
index 3f180a1168e..b189f67d5a5 100644
--- a/src/modules/ndb_redis/README
+++ b/src/modules/ndb_redis/README
@@ -154,15 +154,20 @@ Chapter 1. Admin Guide
3.1. server (str)
Specify the details to connect to REDIS server. It takes a list of
- attribute=value separated by semicolon, the attributes can be name,
- unix, addr, port, db, pass and tls. Name is a generic identifier to be
- used with module functions. unix is the path to the unix domain socket
- provided by redis server. addr and port are the IP address and the port
- to connect to REDIS server. pass is the server password. tls is to
- enable TLS connectivity. unix and (addr, port) are mutually exclusive.
- If both appear in same server settings unix domain socket is
- configured. db is the DB number to use (defaults to 0 if not
- specified).
+ attribute=value separated by semicolon, the attributes can be:
+ * name - is a generic identifier to be used with module functions.
+ * unix - is the path to the unix domain socket to connect to REDIS
+ server.
+ * addr - is the IP address to connect to REDIS server.
+ * port - is the port to connect to REDIS server.
+ * db - is the DB number to use (defaults to 0 if not specified).
+ * pass - is the server password.
+ * tls - is to enable TLS connectivity.
+ * connect_timeout - is to set connect timeout to REDIS server.
+ * command_timeout - is to set command timeout to REDIS server.
+
+ Thr unix and (addr, port) are mutually exclusive, if both appear in
+ same server settings unix domain socket is configured.
You can set this parameter many times, in case you want to connect to
many REDIS servers, just give different attributes and use the specific
@@ -189,12 +194,13 @@ modparam("ndb_redis", "server", "name=srvY;unix=/tmp/redis.sock;db=3")
# sentinel (for a redis slave)
modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_ma
-ster=0;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
+ster=0;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
# sentinel (for a redis master)
modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_ma
-ster=1;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
-
+ster=1;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
...
3.2. init_without_redis (integer)
[View Less]
Module: kamailio
Branch: master
Commit: 55ddd80d15d1d915c85ec397b6ee100d24e6f077
URL: https://github.com/kamailio/kamailio/commit/55ddd80d15d1d915c85ec397b6ee100…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-15T11:54:27+02:00
nsb_redis: docs updated to turn server attributes in a list
---
Modified: src/modules/ndb_redis/doc/ndb_redis_admin.xml
---
Diff: https://github.com/kamailio/kamailio/…
[View More]commit/55ddd80d15d1d915c85ec397b6ee100…
Patch: https://github.com/kamailio/kamailio/commit/55ddd80d15d1d915c85ec397b6ee100…
---
diff --git a/src/modules/ndb_redis/doc/ndb_redis_admin.xml b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
index 85287118725..efcd95c9671 100644
--- a/src/modules/ndb_redis/doc/ndb_redis_admin.xml
+++ b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
@@ -63,12 +63,49 @@
<title><varname>server</varname> (str)</title>
<para>
Specify the details to connect to REDIS server. It takes a list of attribute=value
- separated by semicolon, the attributes can be name, unix, addr, port, db, pass and tls. Name
- is a generic identifier to be used with module functions. unix is the path to the unix
- domain socket provided by redis server. addr and port are the IP address and the port to
- connect to REDIS server. pass is the server password. tls is to enable TLS connectivity.
- unix and (addr, port) are mutually exclusive. If both appear in same server settings unix
- domain socket is configured. db is the DB number to use (defaults to 0 if not specified).
+ separated by semicolon, the attributes can be:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ name - is a generic identifier to be used with module functions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ unix - is the path to the unix domain socket to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ addr - is the IP address to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ port - is the port to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ db - is the DB number to use (defaults to 0 if not specified).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ pass - is the server password.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tls - is to enable TLS connectivity.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ Thr unix and (addr, port) are mutually exclusive, if both appear in
+ same server settings unix domain socket is configured.
</para>
<para>
You can set this parameter many times, in case you want to connect to
@@ -76,8 +113,9 @@
server name when querying the REDIS instance.
</para>
<para>
- If tls is enabled, the module will validate the REDIS server certificate against the
- ca_path. There is currently no way to connect with a specified client certificate, the
+ If tls is enabled, the module will validate the REDIS server certificate
+ against the ca_path. There is currently no way to connect with
+ a specified client certificate, the
<ulink url="https://redis.io/docs/management/security/encryption/#client-certificate-au…">corresponding configuration</ulink>
to check client certificates in the REDIS server must therefore be turned off.
</para>
@@ -98,11 +136,12 @@ modparam("ndb_redis", "server", "name=srvY;addr=127.0.0.3;port=6379;db=5;pass=my
modparam("ndb_redis", "server", "name=srvY;unix=/tmp/redis.sock;db=3")
# sentinel (for a redis slave)
-modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=0;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
+modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=0;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
# sentinel (for a redis master)
-modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=1;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
-
+modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=1;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
...
</programlisting>
</example>
@@ -567,4 +606,3 @@ free reply data:
</section>
</section>
</chapter>
-
[View Less]
<!-- 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, …
[View More]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 -->
This PR allows the functions `allow_address_group` and `allow_source_address_group` to search for Longest Prefix Match (LPM) when searching for an IP is in a subnet instead of the first found.
Since this is a stricter check, i don't think we require an extra param for it, but feel free to suggest otherwise if there are any use-cases that required the first matched.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4297
-- Commit Summary --
* permissions: Perform LPM to find the longest matching subnet
-- File Changes --
M src/modules/permissions/hash.c (23)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4297.patchhttps://github.com/kamailio/kamailio/pull/4297.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4297
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4297(a)github.com>
[View Less]
With gcc --version
```
$ gcc --version
gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
this avoids a warning, that gcc is too old. Before:
```
$ rm src/config.mak
$ make config
make -C src/ config
make[1]: Entering directory '/git/voip/kamailio/src'
target architecture <…
[View More]x86_64>, host architecture <x86_64>
Makefile.defs:1065: You are using an old and unsupported gcc version (15.0+), compile at your own risk!
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory '/git/voip/kamailio/src'
```
after:
```
$ rm src/config.mak
$ make config
make -C src/ config
make[1]: Entering directory '/git/voip/kamailio/src'
target architecture <x86_64>, host architecture <x86_64>
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory '/git/voip/kamailio/src'
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4318
-- Commit Summary --
* src/Makefile.defs: Avoid warning for gcc 15
-- File Changes --
M src/Makefile.defs (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4318.patchhttps://github.com/kamailio/kamailio/pull/4318.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4318
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4318(a)github.com>
[View Less]
Module: kamailio
Branch: master
Commit: 68da5e0b1a8507efc03730e5c76d10079d5bc24d
URL: https://github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-15T10:16:18+02:00
permissions: docs for subnet_match_mode param
- updated notes about subnet matching
---
Modified: src/modules/permissions/doc/permissions_admin.xml
---
Diff: https://…
[View More]github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
Patch: https://github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
---
diff --git a/src/modules/permissions/doc/permissions_admin.xml b/src/modules/permissions/doc/permissions_admin.xml
index f893a3e4eb7..1e5e022902e 100644
--- a/src/modules/permissions/doc/permissions_admin.xml
+++ b/src/modules/permissions/doc/permissions_admin.xml
@@ -224,14 +224,16 @@
<note>
<para>
Starting with Kamailio version 6.1.x, the <function>allow_address()</function>
- function and its related functions use the Longest Prefix Match (LPM) method to
- find matching entries.
+ its related functions can do First Prefix Match (FPM) or the
+ Longest Prefix Match (LPM) methods to find the subnet matching record,
+ which can set the tag variable. The matching method is controled by
+ the parameter subnet_match_mode.
</para>
<para>
- This means the <function>_group</function> variants will now return the most specific
- (longest) subnet match, instead of the first match (which was previously the entry with
- the lowest group ID).
- This LPM behavior is now consistent across the following functions:
+ Th LPM means the <function>_group</function> variants will now return
+ the most specific (longest) subnet match, instead of the first match
+ (which was previously the entry with the lowest group ID).
+ The FPM/LPM behavior is now consistent across the following functions:
</para>
<itemizedlist>
<listitem><para><function>allow_address()</function></para></listitem>
@@ -842,6 +844,28 @@ modparam("permissions", "peer_tag_mode", 1)
...
modparam("permissions", "max_subnets", 1024)
...
+</programlisting>
+ </example>
+ </section>
+ <section id ="permissions.p.subnet_match_mode">
+ <title><varname>subnet_match_mode</varname> (int)</title>
+ <para>
+ Control how subnet addresses are matched: 0 - return on the first
+ prefix match; 1 - return on the longest prefix match. It impacts
+ functions like allow_source_address(), allow_address(),
+ allow_source_address_group() or allow_address_group().
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>0</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>subnet_match_mode</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("permissions", "subnet_match_mode", 1)
+...
</programlisting>
</example>
</section>
[View Less]
Module: kamailio
Branch: master
Commit: c57dfd9869b32b1901fd4b76b7f5a50239f9bce0
URL: https://github.com/kamailio/kamailio/commit/c57dfd9869b32b1901fd4b76b7f5a50…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2025-07-14T15:46:10+02:00
modules: readme files regenerated - permissions ... [skip ci]
---
Modified: src/modules/permissions/README
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]c57dfd9869b32b1901fd4b76b7f5a50…
Patch: https://github.com/kamailio/kamailio/commit/c57dfd9869b32b1901fd4b76b7f5a50…
---
diff --git a/src/modules/permissions/README b/src/modules/permissions/README
index 39d6435b153..144e36f9471 100644
--- a/src/modules/permissions/README
+++ b/src/modules/permissions/README
@@ -348,6 +348,21 @@ Chapter 1. Admin Guide
module parameter) is added as value to peer_tag AVP if peer_tag_avp
module parameter has been defined.
+Note
+
+ Starting with Kamailio version 6.1.x, the allow_address() function and
+ its related functions use the Longest Prefix Match (LPM) method to find
+ matching entries.
+
+ This means the _group variants will now return the most specific
+ (longest) subnet match, instead of the first match (which was
+ previously the entry with the lowest group ID). This LPM behavior is
+ now consistent across the following functions:
+ * allow_address()
+ * allow_source_address()
+ * allow_source_address_group()
+ * allow_address_group()
+
1.5. Trusted Requests
The module can be used to determine if an incoming request can be
@@ -1013,6 +1028,10 @@ if (allow_uri("basename", "$avp(i:705)") { // Check URI stored in $avp(i:705)
any port. The “group_id” argument can be an integer string or a pseudo
variable.
+Note
+
+ See Address permissions for more details.
+
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1.35. allow_address() usage
@@ -1035,6 +1054,10 @@ if (!allow_address("2", "$avp(dst_adr)", "$avp(dst_port)") {
Equal to “allow_address(group_id, "$si", "$sp")”. If 'group_id' is
missing, the function is equal to allow_address("1", "$si", "$sp").
+Note
+
+ See Address permissions for more details.
+
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1.36. allow_source_address(group_id) usage
@@ -1052,6 +1075,11 @@ if (!allow_source_address("1")) {
table in any group. If yes, returns that group. If not returns -1. Port
value 0 in cached address and group table matches any port.
+Note
+
+ See Address permissions for more details on how searching is
+ implemented.
+
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1.37. allow_source_address_group() usage
@@ -1070,6 +1098,11 @@ if ($var(group) != -1) {
in cached address and group table matches any port. The parameters can
be pseudo-variables.
+Note
+
+ See Address permissions for more details on how searching is
+ implemented.
+
This function can be used from ANY_ROUTE.
Example 1.38. allow_source_address_group() usage
[View Less]
Module: kamailio
Branch: master
Commit: 9e0402e9b1d9d789211bfb3c13fc11ab6d5fa320
URL: https://github.com/kamailio/kamailio/commit/9e0402e9b1d9d789211bfb3c13fc11a…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2025-07-14T15:42:47+02:00
permissions: doc: Add note related to LPM search
- allow_address() and 3 more related function now perform LPM search
- allow_source_address()
- allow_source_address_group()
- allow_address_group
-…
[View More]--
Modified: src/modules/permissions/doc/permissions_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/9e0402e9b1d9d789211bfb3c13fc11a…
Patch: https://github.com/kamailio/kamailio/commit/9e0402e9b1d9d789211bfb3c13fc11a…
---
diff --git a/src/modules/permissions/doc/permissions_admin.xml b/src/modules/permissions/doc/permissions_admin.xml
index 494a7ecc0fb..f893a3e4eb7 100644
--- a/src/modules/permissions/doc/permissions_admin.xml
+++ b/src/modules/permissions/doc/permissions_admin.xml
@@ -221,6 +221,25 @@
(see tag_col module parameter) is added as value to
peer_tag AVP if peer_tag_avp module parameter has been defined.
</para>
+ <note>
+ <para>
+ Starting with Kamailio version 6.1.x, the <function>allow_address()</function>
+ function and its related functions use the Longest Prefix Match (LPM) method to
+ find matching entries.
+ </para>
+ <para>
+ This means the <function>_group</function> variants will now return the most specific
+ (longest) subnet match, instead of the first match (which was previously the entry with
+ the lowest group ID).
+ This LPM behavior is now consistent across the following functions:
+ </para>
+ <itemizedlist>
+ <listitem><para><function>allow_address()</function></para></listitem>
+ <listitem><para><function>allow_source_address()</function></para></listitem>
+ <listitem><para><function>allow_source_address_group()</function></para></listitem>
+ <listitem><para><function>allow_address_group()</function></para></listitem>
+ </itemizedlist>
+ </note>
</section>
<section id="sec-trusted-requests">
<title>Trusted Requests</title>
@@ -1259,6 +1278,9 @@ if (allow_uri("basename", "$avp(i:705)") { // Check URI stored in $avp(i:705)
matches any port. The <quote>group_id</quote> argument can be an integer
string or a pseudo variable.
</para>
+ <note>
+ See <link linkend="sec-address-permissions"> Address permissions </link> for more details.
+ </note>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
</para>
@@ -1289,6 +1311,9 @@ if (!allow_address("2", "$avp(dst_adr)", "$avp(dst_port)") {
Equal to <quote>allow_address(group_id, "$si", "$sp")</quote>. If 'group_id' is
missing, the function is equal to allow_address("1", "$si", "$sp").
</para>
+ <note>
+ See <link linkend="sec-address-permissions"> Address permissions </link> for more details.
+ </note>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
</para>
@@ -1315,6 +1340,10 @@ if (!allow_source_address("1")) {
If not returns -1. Port value 0 in cached address and
group table matches any port.
</para>
+ <note>
+ See <link linkend="sec-address-permissions"> Address permissions </link>
+ for more details on how searching is implemented.
+ </note>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
</para>
@@ -1341,6 +1370,10 @@ if ($var(group) != -1) {
If not returns -1. Port value 0 in cached address and
group table matches any port. The parameters can be pseudo-variables.
</para>
+ <note>
+ See <link linkend="sec-address-permissions"> Address permissions </link>
+ for more details on how searching is implemented.
+ </note>
<para>
This function can be used from ANY_ROUTE.
</para>
[View Less]