diff options
author | George Joseph <gjoseph@digium.com> | 2018-04-16 11:12:30 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2018-04-16 11:12:30 -0500 |
commit | 38dae51b788cd7f9f69c88573d6ce769c80f07f0 (patch) | |
tree | 0e38f24c92f437b0c3be19c3522eae816cace726 /res/res_pjsip_refer.c | |
parent | 267e007c28663690e8ad48487be2f4a7ec78e926 (diff) | |
parent | 237d341bbd08168ca7b7bffd190125c032b57f39 (diff) |
Merge "res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations."
Diffstat (limited to 'res/res_pjsip_refer.c')
-rw-r--r-- | res/res_pjsip_refer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c index 120203c95..1e6ca7f46 100644 --- a/res/res_pjsip_refer.c +++ b/res/res_pjsip_refer.c @@ -316,7 +316,15 @@ static void refer_progress_on_evsub_state(pjsip_evsub *sub, pjsip_event *event) /* It's possible that a task is waiting to remove us already, so bump the refcount of progress so it doesn't get destroyed */ ao2_ref(progress, +1); pjsip_dlg_dec_lock(progress->dlg); - ast_sip_push_task_synchronous(progress->serializer, refer_progress_terminate, progress); + /* + * XXX We are always going to execute this inline rather than + * in the serializer because this function is a PJPROJECT + * callback and thus has to be a SIP servant thread. + * + * The likely remedy is to push most of this function into + * refer_progress_terminate() with ast_sip_push_task(). + */ + ast_sip_push_task_wait_servant(progress->serializer, refer_progress_terminate, progress); pjsip_dlg_inc_lock(progress->dlg); ao2_ref(progress, -1); @@ -960,7 +968,8 @@ static int refer_incoming_invite_request(struct ast_sip_session *session, struct invite.session = other_session; - if (ast_sip_push_task_synchronous(other_session->serializer, invite_replaces, &invite)) { + if (ast_sip_push_task_wait_serializer(other_session->serializer, invite_replaces, + &invite)) { response = 481; goto inv_replace_failed; } |