<!-- 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, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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/4327
-- Commit Summary --
* misctest: Add lock_test function and rpc
* misctest: add rpc param
* misctest: docs: add docs for new lock test function
-- File Changes --
M src/modules/misctest/doc/misctest_functions.xml (23)
M src/modules/misctest/doc/misctest_rpc.xml (28)
M src/modules/misctest/misctest_mod.c (48)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4327.patchhttps://github.com/kamailio/kamailio/pull/4327.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4327
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4327(a)github.com>
Module: kamailio
Branch: master
Commit: 4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e
URL: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2025-07-16T15:32:35+02:00
misctest: docs: add docs for new lock test function
---
Modified: src/modules/misctest/doc/misctest_functions.xml
Modified: src/modules/misctest/doc/misctest_rpc.xml
---
Diff: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
Patch: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
---
diff --git a/src/modules/misctest/doc/misctest_functions.xml b/src/modules/misctest/doc/misctest_functions.xml
index faf15f0eeaf..812eb4ba3b2 100644
--- a/src/modules/misctest/doc/misctest_functions.xml
+++ b/src/modules/misctest/doc/misctest_functions.xml
@@ -69,4 +69,27 @@ mt_tcp_thread_exec("request $rm uri $ru");
</example>
</section>
+ <section id="misctest.mt_lock_test">
+ <title>
+ <function>mt_lock_test(count)</function>
+ </title>
+ <para>
+ Lock and unlock the global lock count times.
+ </para>
+ <note>
+ <para>
+ This is a debugging function for simulating locking and unlocking of global lock.
+ It should not be used in production setups
+ </para>
+ </note>
+ <example>
+ <title>
+ <function>mt_lock_test</function> usage</title>
+ <programlisting>
+...
+mt_lock_test(100000000);
+...
+ </programlisting>
+ </example>
+ </section>
</section>
diff --git a/src/modules/misctest/doc/misctest_rpc.xml b/src/modules/misctest/doc/misctest_rpc.xml
index cc80690ada8..93881210998 100644
--- a/src/modules/misctest/doc/misctest_rpc.xml
+++ b/src/modules/misctest/doc/misctest_rpc.xml
@@ -220,4 +220,32 @@
</example>
</section>
+ <section id="mt.lock_test">
+ <title>mt.lock_test</title>
+ <para>
+ The <em>mt.lock_test</em> RPC command performs a lock/unlock stress test using a global lock. It is primarily intended for debugging and performance testing of the locking subsystem.
+ </para>
+ <para>
+ <em>Usage:</em>
+ <programlisting>
+ kamcmd mt.lock_test [executions]
+ </programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <em>executions</em> (optional, integer): Number of times to lock and unlock. Default is 1,000,000,000 if not specified.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ If the argument is provided, it must be a positive integer. If more than one argument is given, or if the argument is not a positive integer, the command will return an error.
+ </para>
+ <para>
+ Example:
+ <programlisting>
+ kamcmd mt.lock_test 10000
+ </programlisting>
+ This will perform 10,000 lock/unlock operations.
+ </para>
+ </section>
</section>
<!-- 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 -->
Skip cdr generation for dialogs with this dlg_var set. This is analogue to parameter in acc module.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4323
-- Commit Summary --
* acc_json: add cdr_skip parameter
-- File Changes --
M src/modules/acc_json/acc_json_mod.c (16)
M src/modules/acc_json/doc/acc_json_admin.xml (18)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4323.patchhttps://github.com/kamailio/kamailio/pull/4323.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4323
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4323(a)github.com>
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/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>