summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-09-06 07:15:32 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-09-06 07:15:32 -0500
commitdd201746fa525acc83d57b5ae7a928272fc35e5a (patch)
tree668b5f0a1b2fa2f732b195a7be17ad3f17201302
parent3dc7781e292b8ab263254f8010cecc0df7c2a35d (diff)
parent87e13e29758e2d315a5de585c2df7ef19a9925ee (diff)
Merge "res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel" into 14
-rw-r--r--res/res_pjsip_t38.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 9f6ae0c2f..82b1c92b2 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -294,21 +294,22 @@ static int t38_reinvite_response_cb(struct ast_sip_session *session, pjsip_rx_da
{
struct pjsip_status_line status = rdata->msg_info.msg->line.status;
struct t38_state *state;
- RAII_VAR(struct ast_sip_session_media *, session_media, NULL, ao2_cleanup);
+ struct ast_sip_session_media *session_media = NULL;
if (status.code == 100) {
return 0;
}
- if (!(state = t38_state_get_or_alloc(session)) ||
+ if (!session->channel || !(state = t38_state_get_or_alloc(session)) ||
!(session_media = ao2_find(session->media, "image", OBJ_KEY))) {
ast_log(LOG_WARNING, "Received response to T.38 re-invite on '%s' but state unavailable\n",
- ast_channel_name(session->channel));
+ session->channel ? ast_channel_name(session->channel) : "unknown channel");
return 0;
}
t38_change_state(session, session_media, state, (status.code == 200) ? T38_ENABLED : T38_REJECTED);
+ ao2_cleanup(session_media);
return 0;
}