Browse Source

fix nodes publish when role is not enabled

4.2
lazedo 8 years ago
parent
commit
dbc5eed9a8
1 changed files with 12 additions and 8 deletions
  1. +12
    -8
      kamailio/nodes-role.cfg

+ 12
- 8
kamailio/nodes-role.cfg View File

@ -29,15 +29,11 @@ modparam("mqueue","mqueue", "name=node_heartbeat")
route[NODES_ADVERTISE_ROUTE] route[NODES_ADVERTISE_ROUTE]
{ {
#!ifdef REGISTRAR_ROLE
$var(Registrar) = $_s("Registrar" : {"Registrations" : $(stat(registered_users){s.int})});
#!else
$var(Registrar) = "";
#!endif
$var(separator) = "";
#!ifdef DISPATCHER_ROLE #!ifdef DISPATCHER_ROLE
route(DISPATCHER_STATUS); route(DISPATCHER_STATUS);
$var(Dispatcher) = $_s("Dispatcher" : {"Groups" : { $var(ds_groups_json) }}); $var(Dispatcher) = $_s("Dispatcher" : {"Groups" : { $var(ds_groups_json) }});
$var(separator) = " , ";
#!else #!else
$var(Dispatcher) = ""; $var(Dispatcher) = "";
#!endif #!endif
@ -50,12 +46,20 @@ route[NODES_ADVERTISE_ROUTE]
route(COUNT_ALL_PRESENTITIES); route(COUNT_ALL_PRESENTITIES);
$var(Presentities) = $_s("Presentities" : {"message-summary" : $xavp(watchers=>message-summary), "dialog" : $xavp(watchers=>dialog), "presence" : $xavp(watchers=>presence)}); $var(Presentities) = $_s("Presentities" : {"message-summary" : $xavp(watchers=>message-summary), "dialog" : $xavp(watchers=>dialog), "presence" : $xavp(watchers=>presence)});
$var(Presence) = $_s("Presence" : {$var(Subscribers), $var(Subscriptions), $var(Presentities)});
$var(Presence) = $_s($var(separator) "Presence" : {$var(Subscribers), $var(Subscriptions), $var(Presentities)});
$var(separator) = " , ";
#!else #!else
$var(Presence) = ""; $var(Presence) = "";
#!endif #!endif
$var(Roles) = $_s("Roles" : {$var(Dispatcher), $var(Presence) , $var(Registrar)});
#!ifdef REGISTRAR_ROLE
$var(Registrar) = $_s($var(separator) "Registrar" : {"Registrations" : $(stat(registered_users){s.int})});
$var(separator) = " , ";
#!else
$var(Registrar) = "";
#!endif
$var(Roles) = $_s("Roles" : {$var(Dispatcher) $var(Presence) $var(Registrar)});
$var(Payload) = '{"Event-Category" : "nodes", "Event-Name" : "advertise", "Expires" : 5000, "Used-Memory" : $(stat(real_used_size){s.int}), "Startup" : $Tb, "WhApps" : {"kamailio" : {"Startup" : $Tb }}, $var(Roles)}'; $var(Payload) = '{"Event-Category" : "nodes", "Event-Name" : "advertise", "Expires" : 5000, "Used-Memory" : $(stat(real_used_size){s.int}), "Startup" : $Tb, "WhApps" : {"kamailio" : {"Startup" : $Tb }}, $var(Roles)}';
kazoo_publish("nodes", "", $var(Payload)); kazoo_publish("nodes", "", $var(Payload));
} }


Loading…
Cancel
Save