| 922 | |
| 923 | |
| 924 | int evi_dispatch_event( event_id_t id, evi_params_p params) |
| 925 | { |
| 926 | evi_params_p sparams = NULL; |
| 927 | struct rpc_raise_event_dispatch *djob; |
| 928 | |
| 929 | if (params) { |
| 930 | sparams = evi_dup_shm_params(params); |
| 931 | evi_free_params(params); |
| 932 | if (!sparams) { |
| 933 | LM_ERR("could not shm duplicate evi params!\n"); |
| 934 | goto error; |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | djob = shm_malloc(sizeof (*djob)); |
| 939 | if (!djob) { |
| 940 | LM_ERR("could not allocate new job!\n"); |
| 941 | goto error; |
| 942 | } |
| 943 | djob->id = id; |
| 944 | djob->params = sparams; |
| 945 | |
| 946 | if (ipc_dispatch_rpc(rpc_raise_event, djob) < 0) { |
| 947 | LM_ERR("could not dispatch raise event job!\n"); |
| 948 | goto error; |
| 949 | } |
| 950 | |
| 951 | return 0; |
| 952 | error: |
| 953 | if (sparams) |
| 954 | evi_free_shm_params(sparams); |
| 955 | return -1; |
| 956 | } |
| 957 | |
| 958 | |
| 959 | mi_response_t *w_mi_raise_event(const mi_params_t *params, |
no test coverage detected