| 599 | } |
| 600 | |
| 601 | static void mi_script_async_job(mi_response_t *resp, struct mi_script_async_job *job) |
| 602 | { |
| 603 | str msg; |
| 604 | char *res = NULL; |
| 605 | int release; |
| 606 | |
| 607 | /* we got a response - handle it */ |
| 608 | job->rc = mi_script_handle_response(resp, (job->ret?&res:NULL), &release); |
| 609 | if (job->ret && res) { |
| 610 | init_str(&msg, res); |
| 611 | shm_str_dup(&job->msg, &msg); |
| 612 | } |
| 613 | |
| 614 | if (release) |
| 615 | cJSON_PurgeString(res); |
| 616 | |
| 617 | if (ipc_send_rpc(job->process_no, mi_script_async_resume_job, job) < 0) { |
| 618 | LM_ERR("could not resume async MI command!\n"); |
| 619 | mi_script_async_job_free(job); |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | static void mi_script_notify_async_job(mi_response_t *resp, |
| 624 | struct mi_handler *hdl, int done) |
no test coverage detected