Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions modules/siprec/siprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,6 @@ static void mod_destroy(void)
{
}

static void tm_src_unref_session(void *p)
{
struct src_sess *ss = (struct src_sess *)p;
srec_dlg.dlg_unref(ss->ctx->dlg, 1); /* release the dialog */
srec_hlog(ss, SREC_UNREF, "start recording unref");
SIPREC_UNREF(ss);
}

/*
* function that simply prints the parameters passed
*/
Expand Down Expand Up @@ -318,7 +310,7 @@ static int siprec_start_rec(struct sip_msg *msg, str *srs, str *instance)
SIPREC_REF_UNSAFE(ss);
srec_hlog(ss, SREC_REF, "starting recording");
if (srec_tm.register_tmcb(msg, 0, TMCB_RESPONSE_OUT, tm_start_recording,
ss, tm_src_unref_session) <= 0) {
ss, NULL) <= 0) {
LM_ERR("cannot register tm callbacks\n");
srec_hlog(ss, SREC_UNREF, "error starting recording");
SIPREC_UNREF_UNSAFE(ss);
Expand Down
11 changes: 11 additions & 0 deletions modules/siprec/siprec_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,13 @@ void tm_start_recording(struct cell *t, int type, struct tmcb_params *ps)
SIPREC_UNLOCK(ss->ctx);
}

static void src_unref_session(struct src_sess *ss)
{
srec_dlg.dlg_unref(ss->dlg, 1); /* release the dialog */
srec_hlog(ss, SREC_UNREF, "start recording unref");
SIPREC_UNREF(ss);
}

void srec_logic_destroy(struct src_sess *sess, int keep_sdp)
{
if (!sess->b2b_key.s)
Expand All @@ -758,6 +765,10 @@ void srec_logic_destroy(struct src_sess *sess, int keep_sdp)
sess->initial_sdp.s = NULL;
}

if (!keep_sdp) {
src_unref_session(sess);
}

srec_b2b.entity_delete(B2B_CLIENT, &sess->b2b_key, sess->dlginfo, 1, 1);
if (sess->dlginfo) {
shm_free(sess->dlginfo);
Expand Down