forked from OpenSIPS/opensips
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch: fix segfault when siprec recording is cancelled
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packaging/debian/patches/002_siprec_recording_cancelled.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/modules/siprec/siprec_logic.c b/modules/siprec/siprec_logic.c | ||
index 84911f005..82793e75f 100644 | ||
--- a/modules/siprec/siprec_logic.c | ||
+++ b/modules/siprec/siprec_logic.c | ||
@@ -359,6 +359,9 @@ no_recording: | ||
srec_rtp.copy_delete(ss->rtp, &mod_name, &ss->media); | ||
srec_logic_destroy(ss); | ||
|
||
+ /* mark this session as cancelled */ | ||
+ ss->flags |= SIPREC_CANCELLED; | ||
+ | ||
if (!(ss->flags & SIPREC_DLG_CBS)) { | ||
/* if the dialog has already been engaged, then we need to keep the | ||
* reference until the end of the dialog, where it will be cleaned up */ | ||
@@ -637,6 +640,9 @@ void tm_start_recording(struct cell *t, int type, struct tmcb_params *ps) | ||
/* if session has been started, do not start it again */ | ||
if (ss->flags & SIPREC_STARTED) | ||
LM_DBG("Session %p (%s) already started!\n", ss, ss->uuid); | ||
+ /* if session has been cancelled, do not start it again */ | ||
+ else if (ss->flags & SIPREC_CANCELLED) | ||
+ LM_DBG("Session %p (%s) already cancelled!\n", ss, ss->uuid); | ||
else if (src_start_recording(ps->rpl, ss) < 0) | ||
LM_ERR("cannot start recording!\n"); | ||
SIPREC_UNLOCK(ss); | ||
diff --git a/modules/siprec/siprec_sess.h b/modules/siprec/siprec_sess.h | ||
index d8a632263..0df200c75 100644 | ||
--- a/modules/siprec/siprec_sess.h | ||
+++ b/modules/siprec/siprec_sess.h | ||
@@ -76,6 +76,7 @@ struct src_part { | ||
#define SIPREC_DLG_CBS (1<<1) | ||
#define SIPREC_PAUSED (1<<2) | ||
#define SIPREC_ONGOING (1<<3) | ||
+#define SIPREC_CANCELLED (1<<4) | ||
|
||
#define SIPREC_SRS(_s) (list_entry((_s)->srs.next, struct srs_node, list)->uri) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
001_rtp_relay_get_leg_fix.patch | ||
002_siprec_recording_cancelled.patch |