mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Merge "res_pjsip_t38.c: Fix crash by ignoring 1xx messages."
This commit is contained in:
@@ -251,8 +251,6 @@ static struct t38_state *t38_state_get_or_alloc(struct ast_sip_session *session)
|
||||
/* This will get bumped up before scheduling */
|
||||
pj_timer_entry_init(&state->timer, 0, session, t38_automatic_reject_timer_cb);
|
||||
|
||||
datastore->data = state;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -297,18 +295,21 @@ static int t38_reinvite_response_cb(struct ast_sip_session *session, pjsip_rx_da
|
||||
struct t38_state *state;
|
||||
struct ast_sip_session_media *session_media = NULL;
|
||||
|
||||
if (status.code == 100) {
|
||||
if (status.code / 100 <= 1) {
|
||||
/* Ignore any non-final responses (1xx) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
state = t38_state_get_or_alloc(session);
|
||||
if (!session->channel || !state) {
|
||||
ast_log(LOG_WARNING, "Received response to T.38 re-invite on '%s' but state unavailable\n",
|
||||
ast_log(LOG_WARNING, "Received %d response to T.38 re-invite on '%s' but state unavailable\n",
|
||||
status.code,
|
||||
session->channel ? ast_channel_name(session->channel) : "unknown channel");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (status.code == 200) {
|
||||
if (status.code / 100 == 2) {
|
||||
/* Accept any 2xx response as successfully negotiated */
|
||||
int index;
|
||||
|
||||
session_media = session->active_media_state->default_session[AST_MEDIA_TYPE_IMAGE];
|
||||
|
||||
Reference in New Issue
Block a user