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

Function mi_script_async_start_job

modules/mi_script/mi_script.c:637–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637static void mi_script_async_start_job(int sender, void *param)
638{
639 struct mi_script_async_job *job = (struct mi_script_async_job *)param;
640 struct mi_handler *hdl = NULL;
641 mi_response_t *resp = NULL;
642 mi_request_t *req;
643
644 if (job->cmd->flags & MI_ASYNC_RPL_FLAG) {
645 hdl = shm_malloc(sizeof *hdl);
646 if (hdl) {
647 hdl->handler_f = mi_script_notify_async_job;
648 hdl->param = job;
649 } else {
650 LM_ERR("could not create async handler!\n");
651 }
652 }
653
654 /* backup @req now, before exposing @job to other procs */
655 req = job->req;
656 job->req = NULL;
657
658 resp = handle_mi_request(req, job->cmd, hdl);
659 if (resp != MI_ASYNC_RPL) {
660 mi_script_async_job(resp, job);
661 free_mi_response(resp);
662 }
663
664 mi_script_free_request(req, 1);
665}
666
667/* we use this just for notifying that the request is terminated */
668static int mi_script_async_resume(int fd,

Callers

nothing calls this directly

Calls 5

shm_mallocFunction · 0.85
handle_mi_requestFunction · 0.85
free_mi_responseFunction · 0.85
mi_script_free_requestFunction · 0.85
mi_script_async_jobFunction · 0.70

Tested by

no test coverage detected