Merge "res_pjsip_t38.c: Fix crash if already saw a final T.38 reINVITE response." into 16

This commit is contained in:
George Joseph 2018-08-20 10:55:22 -05:00 committed by Gerrit Code Review
commit 0fe2eadbc3
1 changed files with 9 additions and 0 deletions

View File

@ -300,6 +300,15 @@ static int t38_reinvite_response_cb(struct ast_sip_session *session, pjsip_rx_da
return 0;
}
if (session->t38state != T38_LOCAL_REINVITE) {
/* Do nothing. We have already processed a final response. */
ast_debug(3, "Received %d response to T.38 re-invite on '%s' but already had a final response (T.38 state:%d)\n",
status.code,
session->channel ? ast_channel_name(session->channel) : "unknown channel",
session->t38state);
return 0;
}
state = t38_state_get_or_alloc(session);
if (!session->channel || !state) {
ast_log(LOG_WARNING, "Received %d response to T.38 re-invite on '%s' but state unavailable\n",