* The purpose of this dispatched job is for the logic to be ran by a * process other than the Diameter peer, since PROC_MODULE workers have NULL * @sroutes, causing a crash when attempting to raise a script event */
| 76 | * @sroutes, causing a crash when attempting to raise a script event |
| 77 | */ |
| 78 | void h2_raise_event_request(const char *method, const char *path, |
| 79 | const char *headers_json, const str *body) |
| 80 | { |
| 81 | str st; |
| 82 | |
| 83 | init_str(&st, method); |
| 84 | if (evi_param_set_str(h2ev_req_param_method, &st) < 0) { |
| 85 | LM_ERR("failed to set 'method'\n"); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | init_str(&st, path); |
| 90 | if (evi_param_set_str(h2ev_req_param_path, &st) < 0) { |
| 91 | LM_ERR("failed to set 'path'\n"); |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | init_str(&st, headers_json); |
| 96 | if (evi_param_set_str(h2ev_req_param_headers, &st) < 0) { |
| 97 | LM_ERR("failed to set 'headers_json'\n"); |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | if (evi_param_set_str(h2ev_req_param_data, body) < 0) { |
| 102 | LM_ERR("failed to set 'body'\n"); |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | if (evi_raise_event(h2ev_req_id, h2ev_req_params) < 0) |
| 107 | LM_ERR("failed to raise '"H2EV_REQ_NAME"' event\n"); |
| 108 | } |
no test coverage detected