| 1195 | } |
| 1196 | |
| 1197 | void 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 | |
| 1231 | error: |
| 1232 | evi_free_params(list); |
| 1233 | } |
| 1234 | |
| 1235 | |
| 1236 | void lb_status_changed(struct lb_dst *dst) |
no test coverage detected