Browse Source

MT#57302 add `exclude-recording` flag

Change-Id: I08cf87ce94720f3e01bfbe3260bdc76da8e1bb63
(cherry picked from commit e02e03729c)
mr11.3.1
Richard Fuchs 3 years ago
parent
commit
fe710fa981
5 changed files with 21 additions and 0 deletions
  1. +8
    -0
      daemon/call.c
  2. +3
    -0
      daemon/call_interfaces.c
  3. +8
    -0
      daemon/recording.c
  4. +1
    -0
      include/call.h
  5. +1
    -0
      include/call_interfaces.h

+ 8
- 0
daemon/call.c View File

@ -3056,6 +3056,11 @@ int monologue_offer_answer(struct call_monologue *dialogue[2], GQueue *streams,
__call_monologue_init_from_flags(other_ml, flags); __call_monologue_init_from_flags(other_ml, flags);
if (flags->exclude_recording) {
monologue->no_recording = 1;
other_ml->no_recording = 1;
}
__C_DBG("this="STR_FORMAT" other="STR_FORMAT, STR_FMT(&monologue->tag), STR_FMT(&other_ml->tag)); __C_DBG("this="STR_FORMAT" other="STR_FORMAT, STR_FMT(&monologue->tag), STR_FMT(&other_ml->tag));
ml_media = other_ml_media = NULL; ml_media = other_ml_media = NULL;
@ -3322,6 +3327,9 @@ int monologue_publish(struct call_monologue *ml, GQueue *streams, struct sdp_ng_
GList *media_iter = NULL; GList *media_iter = NULL;
if (flags->exclude_recording)
ml->no_recording = 1;
for (GList *l = streams->head; l; l = l->next) { for (GList *l = streams->head; l; l = l->next) {
struct stream_params *sp = l->data; struct stream_params *sp = l->data;
struct call_media *media = __get_media(ml, &media_iter, sp, flags, -1); struct call_media *media = __get_media(ml, &media_iter, sp, flags, -1);


+ 3
- 0
daemon/call_interfaces.c View File

@ -1051,6 +1051,9 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, void *dummy) {
case CSH_LOOKUP("record-call"): case CSH_LOOKUP("record-call"):
out->record_call = 1; out->record_call = 1;
break; break;
case CSH_LOOKUP("exclude-recording"):
out->exclude_recording = 1;
break;
case CSH_LOOKUP("inactive"): case CSH_LOOKUP("inactive"):
out->inactive = 1; out->inactive = 1;
break; break;


+ 8
- 0
daemon/recording.c View File

@ -673,6 +673,8 @@ static void stream_pcap_dump(struct media_packet *mp, const str *s) {
} }
static void dump_packet_pcap(struct media_packet *mp, const str *s) { static void dump_packet_pcap(struct media_packet *mp, const str *s) {
if (mp->media->monologue->no_recording)
return;
struct recording *recording = mp->call->recording; struct recording *recording = mp->call->recording;
mutex_lock(&recording->u.pcap.recording_lock); mutex_lock(&recording->u.pcap.recording_lock);
stream_pcap_dump(mp, s); stream_pcap_dump(mp, s);
@ -852,6 +854,8 @@ static void setup_stream_proc(struct packet_stream *stream) {
return; return;
if (stream->recording.u.proc.stream_idx != UNINIT_IDX) if (stream->recording.u.proc.stream_idx != UNINIT_IDX)
return; return;
if (ml->no_recording)
return;
len = snprintf(buf, sizeof(buf), "TAG %u MEDIA %u TAG-MEDIA %u COMPONENT %u FLAGS %u", len = snprintf(buf, sizeof(buf), "TAG %u MEDIA %u TAG-MEDIA %u COMPONENT %u FLAGS %u",
ml->unique_id, media->unique_id, media->index, stream->component, ml->unique_id, media->unique_id, media->index, stream->component,
@ -877,6 +881,8 @@ static void setup_monologue_proc(struct call_monologue *ml) {
if (!recording) if (!recording)
return; return;
if (ml->no_recording)
return;
append_meta_chunk_str(recording, &ml->tag, "TAG %u", ml->unique_id); append_meta_chunk_str(recording, &ml->tag, "TAG %u", ml->unique_id);
if (ml->label.len) if (ml->label.len)
@ -891,6 +897,8 @@ static void setup_media_proc(struct call_media *media) {
if (!recording) if (!recording)
return; return;
if (media->monologue->no_recording)
return;
append_meta_chunk_null(recording, "MEDIA %u PTIME %i", media->unique_id, media->ptime); append_meta_chunk_null(recording, "MEDIA %u PTIME %i", media->unique_id, media->ptime);


+ 1
- 0
include/call.h View File

@ -540,6 +540,7 @@ struct call_monologue {
unsigned int rec_forwarding:1; unsigned int rec_forwarding:1;
unsigned int inject_dtmf:1; unsigned int inject_dtmf:1;
unsigned int detect_dtmf:1; unsigned int detect_dtmf:1;
unsigned int no_recording:1;
}; };
struct call_iterator_list { struct call_iterator_list {


+ 1
- 0
include/call_interfaces.h View File

@ -157,6 +157,7 @@ struct sdp_ng_flags {
siprec:1, siprec:1,
fragment:1, fragment:1,
record_call:1, record_call:1,
exclude_recording:1,
debug:1, debug:1,
inactive:1, inactive:1,
loop_protect:1, loop_protect:1,


Loading…
Cancel
Save