Hi all,
Here is a prototype of Keepalive module I discussed on the mailing-list.
It can work standalone:
- destinations are set statically as module parameters
- *is_alive()* function allows to check destination state
It can also be used alongside with drouting module (currently only with sort_order 0)
- all destinations defined in drouting module are automatically monitored when drouting *enable_keepalive* option is set to 1
- unavailable destinations are ignored when calling do_routing() function
All comments are welcome
Thanks,
Guillaume
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1045
-- Commit Summary --
* keepalive: module skeleton
* keepalive: modularization, allow to specify more than one destination
* keepalive: event routes
* keepalive: module modularization
* keepalive: adapt to trunk/5.0 branch
* keepalive: attached informations related to destinations
* keepalive: basic rpc interface
* keepalive: remove ka_destination_list from api (not exported)
* drouting: register destinations in keepalive module
* keepalive: triggers events routes on state change only
* drouting: refactoring
* keepalive: support callback function on destination registration
* drouting: register destination with callback
* drouting: on do_routing() function, discard unavailable destinations
* keepalive: checking uri format when adding destination
* keepalive: *ping_interval* parameter to setup delay between destinations keepalives (default 30secs)
* keepalive: ping considered successful if received 2XX response
* keepalive: added is_alive(dest) function to check monitored destination status
-- File Changes --
M src/modules/drouting/dr_load.c (3)
M src/modules/drouting/drouting.c (58)
M src/modules/drouting/prefix_tree.h (4)
M src/modules/drouting/routing.c (2)
A src/modules/keepalive/Makefile (18)
A src/modules/keepalive/api.h (74)
A src/modules/keepalive/keepalive.h (86)
A src/modules/keepalive/keepalive_api.c (138)
A src/modules/keepalive/keepalive_core.c (203)
A src/modules/keepalive/keepalive_mod.c (193)
A src/modules/keepalive/keepalive_rpc.c (101)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1045.patchhttps://github.com/kamailio/kamailio/pull/1045.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1045
Module: kamailio
Branch: master
Commit: 079b84b1351a19334a478226b83f4d3193d050bb
URL: https://github.com/kamailio/kamailio/commit/079b84b1351a19334a478226b83f4d3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-04T15:50:41+02:00
dialog: documented the event_callback parameter
- allow specifying the function name to be executed by kemi on event
routes
---
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/079b84b1351a19334a478226b83f4d3…
Patch: https://github.com/kamailio/kamailio/commit/079b84b1351a19334a478226b83f4d3…
---
diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml
index 7b39bc9..af1443e 100644
--- a/src/modules/dialog/doc/dialog_admin.xml
+++ b/src/modules/dialog/doc/dialog_admin.xml
@@ -1443,6 +1443,39 @@ modparam("dialog", "lreq_callee_headers", "TH: dlh\r\n")
</programlisting>
</example>
</section>
+ <section id="dialog.p.event_callback">
+ <title><varname>event_callback</varname> (str)</title>
+ <para>
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead
+ of event_route[...] blocks.
+ </para>
+ <para>
+ The function receives a string parameter with the name of the event,
+ the values are: 'dialog:start', 'dialog:end', 'dialog:failed'. It
+ is also executed if '$dlg_ctx(timeout_route)' is set, the callback
+ function being executed with the variable value as parameter.
+ </para>
+ <para>
+ <emphasis>
+ Default value is 'empty' (no function is executed for events).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>event_callback</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("dialog", "event_callback", "ksr_dialog_event")
+...
+-- event callback function implemented in Lua
+function ksr_dialog_event(evname)
+ KSR.info("===== dialog module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
</section>
Module: kamailio
Branch: master
Commit: a17560105cf28f67c5eaf4ed7401615f64fb9cd0
URL: https://github.com/kamailio/kamailio/commit/a17560105cf28f67c5eaf4ed7401615…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-04T15:50:14+02:00
dispatcher: listed the options for the kemi event callback parameters
---
Modified: src/modules/dispatcher/doc/dispatcher_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/a17560105cf28f67c5eaf4ed7401615…
Patch: https://github.com/kamailio/kamailio/commit/a17560105cf28f67c5eaf4ed7401615…
---
diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml
index 6950a2d..ab40fb5 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -874,8 +874,11 @@ modparam("dispatcher", "force_dst", 1)
<para>
The name of the function in the kemi configuration file (embedded
scripting language such as Lua, Python, ...) to be executed instead
- of event_route[...] blocks. The function receives a string parameter
- with the name of the event.
+ of event_route[...] blocks.
+ </para>
+ <para>
+ The function receives a string parameter with the name of the event,
+ the values are: 'dispatcher:dst-down', 'dispatcher:dst-up'.
</para>
<para>
<emphasis>