MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / report_node_state

Function report_node_state

modules/clusterer/clusterer.c:1768–1785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1766}
1767
1768int report_node_state(enum clusterer_event event, int cluster_id, int node_id)
1769{
1770 if (raise_node_state_ev(event, cluster_id, node_id) < 0) {
1771 LM_ERR("Failed to raise node state changed event for: "
1772 "cluster_id=%d node_id=%d\n", cluster_id, node_id);
1773 return -1;
1774 }
1775
1776 if (sr_add_report_fmt(cl_srg, STR2CI(node_st_sr_ident), 0,
1777 "Node [%d], cluster [%d] is %s", node_id, cluster_id,
1778 event==CLUSTER_NODE_DOWN ? "DOWN" : "UP") < 0) {
1779 LM_ERR("Failed to add SR report for node state change, "
1780 "cluster_id=%d, node_id=%d\n", cluster_id, node_id);
1781 return -1;
1782 }
1783
1784 return 0;
1785}
1786
1787void do_actions_node_ev(cluster_info_t *clusters, int *select_cluster,
1788 int no_clusters)

Callers 1

do_actions_node_evFunction · 0.85

Calls 2

raise_node_state_evFunction · 0.85
sr_add_report_fmtFunction · 0.85

Tested by

no test coverage detected