| 875 | } |
| 876 | |
| 877 | evi_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, ¶m.s, ¶m.len) < 0) { |
| 893 | LM_ERR("cannot fetch array element %d\n", i); |
| 894 | goto error; |
| 895 | } |
| 896 | if (evi_param_add_str(eparams, NULL, ¶m)) { |
| 897 | LM_ERR("cannot add new params %d\n", i); |
| 898 | goto error; |
| 899 | } |
| 900 | } |
| 901 | |
| 902 | return eparams; |
| 903 | error: |
| 904 | evi_free_params(eparams); |
| 905 | return NULL; |
| 906 | } |
| 907 | |
| 908 | struct rpc_raise_event_dispatch { |
| 909 | event_id_t id; |
no test coverage detected