From 344cdab3a71d8f8b3517e7efe6864165142b14ca Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Fri, 20 Dec 2013 20:28:19 +0000 Subject: [PATCH] Fix issue where PJSIP blind transferer dialog may not complete as planned. When transferring to a dialplan extension that will not place any outbound calls, the only control frames that the PJSIP REFER framehook will receive are inconsequential (such as unhold or srcchange). As such, we shouldn't allow for the reception of those types of frames prevent us from signaling to the transferring party that the transfer has completed successfully once voice frames are read. Thanks to Jonathan Rose for pointing this out. ........ Merged revisions 404439 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404452 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_pjsip_refer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c index da48e523b9..7664f1a228 100644 --- a/res/res_pjsip_refer.c +++ b/res/res_pjsip_refer.c @@ -191,20 +191,25 @@ static struct ast_frame *refer_progress_framehook(struct ast_channel *chan, stru /* Media is passing without progress, this means the call has been answered */ notification = refer_progress_notification_alloc(progress, 200, PJSIP_EVSUB_STATE_TERMINATED); } else if (f->frametype == AST_FRAME_CONTROL) { - progress->subclass = f->subclass.integer; /* Based on the control frame being written we can send a NOTIFY advising of the progress */ if ((f->subclass.integer == AST_CONTROL_RING) || (f->subclass.integer == AST_CONTROL_RINGING)) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 180, PJSIP_EVSUB_STATE_ACTIVE); } else if (f->subclass.integer == AST_CONTROL_BUSY) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 486, PJSIP_EVSUB_STATE_TERMINATED); } else if (f->subclass.integer == AST_CONTROL_CONGESTION) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 503, PJSIP_EVSUB_STATE_TERMINATED); } else if (f->subclass.integer == AST_CONTROL_PROGRESS) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 183, PJSIP_EVSUB_STATE_ACTIVE); } else if (f->subclass.integer == AST_CONTROL_PROCEEDING) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 100, PJSIP_EVSUB_STATE_ACTIVE); } else if (f->subclass.integer == AST_CONTROL_ANSWER) { + progress->subclass = f->subclass.integer; notification = refer_progress_notification_alloc(progress, 200, PJSIP_EVSUB_STATE_TERMINATED); } }