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

Function mi_raise_event_array_params

evi/event_interface.c:877–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

875}
876
877evi_params_p mi_raise_event_array_params(mi_item_t *array, int no)
878{
879 int i;
880 str param;
881 evi_params_p eparams = NULL;
882
883 LM_DBG("treating params as array\n");
884
885 /* parse params as json */
886 if (!(eparams = evi_get_params())) {
887 LM_ERR("cannot create parameters list\n");
888 return NULL;
889 }
890
891 for (i = 0; i < no; i++) {
892 if (get_mi_arr_param_string(array, i, &param.s, &param.len) < 0) {
893 LM_ERR("cannot fetch array element %d\n", i);
894 goto error;
895 }
896 if (evi_param_add_str(eparams, NULL, &param)) {
897 LM_ERR("cannot add new params %d\n", i);
898 goto error;
899 }
900 }
901
902 return eparams;
903error:
904 evi_free_params(eparams);
905 return NULL;
906}
907
908struct rpc_raise_event_dispatch {
909 event_id_t id;

Callers 1

w_mi_raise_eventFunction · 0.85

Calls 3

evi_get_paramsFunction · 0.85
get_mi_arr_param_stringFunction · 0.85
evi_free_paramsFunction · 0.85

Tested by

no test coverage detected