From: Ross Beer Date: Tue, 6 Mar 2018 19:31:01 +0000 (+0000) Subject: res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints X-Git-Tag: 13.21.0-rc1~86^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecff05d51c58bd583836ff5fdd3efa956d741ecb;p=thirdparty%2Fasterisk.git res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints ASTERISK-27554 Change-Id: If61c7faab7d2fa1031c056ed6268fe928e2391cf --- diff --git a/res/res_pjsip_rfc3326.c b/res/res_pjsip_rfc3326.c index ab92d6f7f7..f467e22027 100644 --- a/res/res_pjsip_rfc3326.c +++ b/res/res_pjsip_rfc3326.c @@ -92,12 +92,12 @@ static void rfc3326_add_reason_header(struct ast_sip_session *session, struct pj { 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)