diff options
author | Joshua Colp <jcolp@digium.com> | 2017-04-05 17:50:28 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-04-05 17:50:28 -0500 |
commit | f80b7f7014d544ad16592e16bc1e05135c8d8971 (patch) | |
tree | 4b0c61312b9f4ca6d7b58599ce8b606b2522996a | |
parent | 6906765381e221fea6426510665ab227e87e4486 (diff) | |
parent | bca9685d397ce470a026b3714af35944a06dee59 (diff) |
Merge "res_pjsip_session: Allow BYE to be sent on disconnected session." into 13
-rw-r--r-- | res/res_pjsip_session.c | 9 |
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; } |