Skip to content

Commit

Permalink
siprec: properly handle paused recording
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jun 13, 2024
1 parent 2bea262 commit 0091ab4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/siprec/siprec_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ static int srec_get_body(struct src_sess *sess, str *body)
struct rtp_relay_stream *stream;
int s;

if (sess->flags & SIPREC_PAUSED)
flags |= RTP_COPY_MODE_DISABLE;

if (srec_rtp.copy_offer(sess->rtp, &mod_name,
&sess->media, flags, -1, body, &streams) < 0) {
LM_ERR("could not start recording!\n");
Expand Down Expand Up @@ -621,14 +624,10 @@ static void srs_send_update_invite(struct src_sess *sess, str *body)
static int src_update_recording(struct sip_msg *msg, struct src_sess *sess)
{
str body, sdp;
unsigned int flags = RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH;

if (msg == FAKED_REPLY)
return 0;

if (sess->flags & SIPREC_PAUSED)
flags |= RTP_COPY_MODE_DISABLE;

if (srec_get_body(sess, &sdp) < 0) {
LM_ERR("could not refresh recording!\n");
goto error;
Expand Down

0 comments on commit 0091ab4

Please sign in to comment.