Merge "res_pjsip_session: Allow BYE to be sent on disconnected session." into 13

This commit is contained in:
Joshua Colp
2017-04-05 17:50:28 -05:00
committed by Gerrit Code Review

View File

@@ -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; pjsip_inv_session *inv_session = session->inv_session;
if (inv_session->state == PJSIP_INV_STATE_DISCONNECTED) { /* For every request except BYE we disallow sending of the message when
/* Don't try to do anything with a hung-up call */ * 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; return;
} }