[asterisk-commits] res pjsip session: Allow BYE to be sent on disconnected sess... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 5 17:50:28 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5377 )

Change subject: res_pjsip_session: Allow BYE to be sent on disconnected session.
......................................................................


res_pjsip_session: Allow BYE to be sent on disconnected session.

It is perfectly acceptable for a BYE to be sent on a disconnected
session. This occurs when we respond to a challenge to the BYE
for authentication credentials.

ASTERISK-26363

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

Approvals:
  Mark Michelson: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified



diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 53841c4..0a18a80 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -1198,8 +1198,13 @@
 {
 	pjsip_inv_session *inv_session = session->inv_session;
 
-	if (inv_session->state == PJSIP_INV_STATE_DISCONNECTED) {
-		/* Don't try to do anything with a hung-up call */
+	/* For every request except BYE we disallow sending of the message when
+	 * the session has been disconnected. A BYE request is special though
+	 * because it can be sent again after the session is disconnected except
+	 * with credentials.
+	 */
+	if (inv_session->state == PJSIP_INV_STATE_DISCONNECTED &&
+		tdata->msg->line.req.method.id != PJSIP_BYE_METHOD) {
 		return;
 	}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ef0ddece812fea6665a1dd2549ef44fb9d90045
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list