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

Function w_mi_subscribers_list_2

evi/event_interface.c:782–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780}
781
782mi_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
813evi_params_p mi_raise_event_json_params(str *params)
814{

Callers

nothing calls this directly

Calls 8

get_mi_string_paramFunction · 0.85
init_mi_param_errorFunction · 0.85
evi_get_eventFunction · 0.85
init_mi_errorFunction · 0.85
evi_get_idFunction · 0.85
evi_remove_expired_subsFunction · 0.85
evi_get_subscriberFunction · 0.85
mi_subscribers_listFunction · 0.85

Tested by

no test coverage detected