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

Function lb_raise_event

modules/load_balancer/lb_data.c:1197–1233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197void lb_raise_event(struct lb_dst *dst)
1198{
1199 evi_params_p list = NULL;
1200
1201 if (lb_evi_id == EVI_ERROR || !evi_probe_event(lb_evi_id))
1202 return;
1203
1204 list = evi_get_params();
1205 if (!list) {
1206 LM_ERR("cannot create event params\n");
1207 return;
1208 }
1209
1210 if (evi_param_add_int(list, &lb_group_str, &dst->group) < 0) {
1211 LM_ERR("cannot add destination group\n");
1212 goto error;
1213 }
1214
1215 if (evi_param_add_str(list, &lb_uri_str, &dst->uri) < 0) {
1216 LM_ERR("cannot add destination uri\n");
1217 goto error;
1218 }
1219
1220 if (evi_param_add_str(list, &lb_state_str,
1221 dst->flags&LB_DST_STAT_DSBL_FLAG ? &lb_disabled_str : &lb_enabled_str) < 0) {
1222 LM_ERR("cannot add destination state\n");
1223 goto error;
1224 }
1225
1226 if (evi_raise_event(lb_evi_id, list)) {
1227 LM_ERR("unable to send %.*s event\n", lb_event.len, lb_event.s);
1228 }
1229 return;
1230
1231error:
1232 evi_free_params(list);
1233}
1234
1235
1236void lb_status_changed(struct lb_dst *dst)

Callers 2

lb_status_changedFunction · 0.85

Calls 4

evi_probe_eventFunction · 0.85
evi_get_paramsFunction · 0.85
evi_raise_eventFunction · 0.85
evi_free_paramsFunction · 0.85

Tested by

no test coverage detected