[Asterisk-code-review] res_pjsip_session: Don't aggressively terminate on failed re-INVITE. (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Tue Aug 25 13:38:52 CDT 2020


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

Change subject: res_pjsip_session: Don't aggressively terminate on failed re-INVITE.
......................................................................

res_pjsip_session: Don't aggressively terminate on failed re-INVITE.

Per the RFC when an outgoing re-INVITE is done we should
only terminate the dialog if a 481 or 408 is received.

ASTERISK-29033

Change-Id: I6c3ff513aa41005d02de0396ba820083e9b18503
---
M res/res_pjsip_session.c
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 7df5909..c5298b2 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2887,8 +2887,11 @@
 							ast_sip_session_send_request_with_cb(session, tdata, cb);
 							return;
 						}
-						if (tsx->status_code != 488) {
-							/* Other reinvite failures (except 488) result in destroying the session. */
+						/* Per RFC3261 14.1 a response to a re-INVITE should only terminate
+						 * the dialog if a 481 or 408 occurs. All other responses should leave
+						 * the dialog untouched.
+						 */
+						if (tsx->status_code == 481 || tsx->status_code == 408) {
 							if (pjsip_inv_end_session(inv, 500, NULL, &tdata) == PJ_SUCCESS
 								&& tdata) {
 								ast_sip_session_send_request(session, tdata);

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I6c3ff513aa41005d02de0396ba820083e9b18503
Gerrit-Change-Number: 14734
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200825/b3135caf/attachment.html>


More information about the asterisk-code-review mailing list