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.patch https://github.com/kamailio/kamailio/pull/1045.diff