[Asterisk-code-review] res_pjsip_refer: ensure refer progress is still sent after Proceeding() (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Thu Mar 5 11:02:44 CST 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13881 )

Change subject: res_pjsip_refer: ensure refer progress is still sent after Proceeding()
......................................................................

res_pjsip_refer: ensure refer progress is still sent after Proceeding()

ASTERISK-28766 #close

Change-Id: I5ce2210062f9325db762edbf6e46075079bb2cd1
---
M res/res_pjsip_refer.c
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index 3c73801..1282d22 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -233,11 +233,12 @@
 	/* Determine the state of the REFER based on the control frames (or voice frames) passing */
 	if (f->frametype == AST_FRAME_VOICE && !progress->subclass) {
 		/* Media is passing without progress, this means the call has been answered */
+		progress->subclass = AST_CONTROL_ANSWER;
 		notification = refer_progress_notification_alloc(progress, 200, PJSIP_EVSUB_STATE_TERMINATED);
 	} else if (f->frametype == AST_FRAME_CONTROL) {
 		/* 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;
+			/* Don't set progress->subclass; an ANSWER can still follow */
 			notification = refer_progress_notification_alloc(progress, 180, PJSIP_EVSUB_STATE_ACTIVE);
 		} else if (f->subclass.integer == AST_CONTROL_BUSY) {
 			progress->subclass = f->subclass.integer;
@@ -246,10 +247,10 @@
 			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;
+			/* Don't set progress->subclass; an ANSWER can still follow */
 			notification = refer_progress_notification_alloc(progress, 183, PJSIP_EVSUB_STATE_ACTIVE);
 		} else if (f->subclass.integer == AST_CONTROL_PROCEEDING) {
-			progress->subclass = f->subclass.integer;
+			/* Don't set progress->subclass; an ANSWER can still follow */
 			notification = refer_progress_notification_alloc(progress, 100, PJSIP_EVSUB_STATE_ACTIVE);
 		} else if (f->subclass.integer == AST_CONTROL_ANSWER) {
 			progress->subclass = f->subclass.integer;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13881
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I5ce2210062f9325db762edbf6e46075079bb2cd1
Gerrit-Change-Number: 13881
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: lvl <digium at lvlconsultancy.nl>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200305/dffe1c24/attachment.html>


More information about the asterisk-code-review mailing list