| 780 | } |
| 781 | |
| 782 | mi_response_t *w_mi_subscribers_list_2(const mi_params_t *params, |
| 783 | struct mi_handler *async_hdl) |
| 784 | { |
| 785 | str event_s; |
| 786 | str subs_s; |
| 787 | evi_event_p event; |
| 788 | evi_subs_p subs; |
| 789 | int evid; |
| 790 | if (get_mi_string_param(params, "event", &event_s.s, &event_s.len) < 0) |
| 791 | return init_mi_param_error(); |
| 792 | |
| 793 | event = evi_get_event(&event_s); |
| 794 | if (!event) |
| 795 | return init_mi_error(404, MI_SSTR("Event not published")); |
| 796 | /* get the event id & before printing the subs list check for any expired subscribers and remove them*/ |
| 797 | evid = evi_get_id(&event_s); |
| 798 | if (evid == -1) |
| 799 | return init_mi_error(404, MI_SSTR("Can't get the id")); |
| 800 | |
| 801 | evi_remove_expired_subs(evid); |
| 802 | |
| 803 | if (get_mi_string_param(params, "socket", &subs_s.s, &subs_s.len) < 0) |
| 804 | return init_mi_param_error(); |
| 805 | |
| 806 | subs = evi_get_subscriber(event, subs_s); |
| 807 | if (!subs) |
| 808 | return init_mi_error(404, MI_SSTR("Subscriber does not exist")); |
| 809 | |
| 810 | return mi_subscribers_list(event, subs); |
| 811 | } |
| 812 | |
| 813 | evi_params_p mi_raise_event_json_params(str *params) |
| 814 | { |
nothing calls this directly
no test coverage detected