Skip to content

Commit bbfa2b0

Browse files
committed
siprec: make timeout handling more robust
Make sure we are not trying to access the RTP context that has been destroyed along with the dialog moving in state 5.
1 parent c5fd8ad commit bbfa2b0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

modules/siprec/siprec_logic.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int srec_b2b_notify(struct sip_msg *msg, str *key, int type,
398398
goto no_recording;
399399
}
400400

401-
if (ss->ctx->dlg->state > DLG_STATE_DELETED) {
401+
if (ss->ctx->dlg->state >= DLG_STATE_DELETED) {
402402
LM_ERR("dialog already in deleted state!\n");
403403
goto no_recording;
404404
}
@@ -429,7 +429,11 @@ static int srec_b2b_notify(struct sip_msg *msg, str *key, int type,
429429
LM_ERR("Cannot send bye for recording session with key %.*s\n",
430430
req.b2b_key->len, req.b2b_key->s);
431431
}
432-
srec_rtp.copy_delete(ss->ctx->rtp, &ss->instance, &ss->media);
432+
if (ss->ctx->dlg->state >= DLG_STATE_DELETED)
433+
LM_DBG("rtp context already destroyed!\n");
434+
else
435+
srec_rtp.copy_delete(ss->ctx->rtp, &ss->instance, &ss->media);
436+
433437
if (ss->flags & SIPREC_STARTED)
434438
raise_siprec_stop_event(ss);
435439
srec_logic_destroy(ss, 0);

0 commit comments

Comments
 (0)