summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-03-31 21:31:24 +0000
committerJoshua Colp <jcolp@digium.com>2017-04-01 10:58:41 +0000
commitbca9685d397ce470a026b3714af35944a06dee59 (patch)
tree5c906ed1e7cd8a6790095ca7bbbd7f5fae3449b1 /res/res_pjsip_session.c
parent01c1e60a4f178c3a39081e56fb323b1cffb2adcc (diff)
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
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 53841c44a..0a18a8018 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -1198,8 +1198,13 @@ void ast_sip_session_send_request_with_cb(struct ast_sip_session *session, pjsip
{
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;
}