[Asterisk-code-review] res pjsip rfc3326: Order of 'Reason' headers break many endp... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed Mar 7 10:08:10 CST 2018


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/8460


Change subject: res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints
......................................................................

res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints

ASTERISK-27554

Change-Id: If61c7faab7d2fa1031c056ed6268fe928e2391cf
---
M res/res_pjsip_rfc3326.c
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/8460/1

diff --git a/res/res_pjsip_rfc3326.c b/res/res_pjsip_rfc3326.c
index 6c02a17..5ac16f0 100644
--- a/res/res_pjsip_rfc3326.c
+++ b/res/res_pjsip_rfc3326.c
@@ -91,12 +91,12 @@
 {
 	char buf[20];
 
-	snprintf(buf, sizeof(buf), "Q.850;cause=%i", ast_channel_hangupcause(session->channel) & 0x7f);
-	ast_sip_add_header(tdata, "Reason", buf);
-
 	if (ast_channel_hangupcause(session->channel) == AST_CAUSE_ANSWERED_ELSEWHERE) {
 		ast_sip_add_header(tdata, "Reason", "SIP;cause=200;text=\"Call completed elsewhere\"");
 	}
+
+	snprintf(buf, sizeof(buf), "Q.850;cause=%i", ast_channel_hangupcause(session->channel) & 0x7f);
+	ast_sip_add_header(tdata, "Reason", buf);
 }
 
 static void rfc3326_outgoing_request(struct ast_sip_session *session, struct pjsip_tx_data *tdata)

-- 
To view, visit https://gerrit.asterisk.org/8460
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If61c7faab7d2fa1031c056ed6268fe928e2391cf
Gerrit-Change-Number: 8460
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Ross Beer <ross.beer at voicehost.co.uk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180307/4603c14b/attachment.html>


More information about the asterisk-code-review mailing list