diff --git a/daemon/call.c b/daemon/call.c index b29df4da9..1f82496a9 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3056,6 +3056,11 @@ int monologue_offer_answer(struct call_monologue *dialogue[2], GQueue *streams, __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)); 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; + if (flags->exclude_recording) + ml->no_recording = 1; + for (GList *l = streams->head; l; l = l->next) { struct stream_params *sp = l->data; struct call_media *media = __get_media(ml, &media_iter, sp, flags, -1); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 646b0f2f7..904d64f8d 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1051,6 +1051,9 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, void *dummy) { case CSH_LOOKUP("record-call"): out->record_call = 1; break; + case CSH_LOOKUP("exclude-recording"): + out->exclude_recording = 1; + break; case CSH_LOOKUP("inactive"): out->inactive = 1; break; diff --git a/daemon/recording.c b/daemon/recording.c index be548e2e3..889caf97a 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -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) { + if (mp->media->monologue->no_recording) + return; struct recording *recording = mp->call->recording; mutex_lock(&recording->u.pcap.recording_lock); stream_pcap_dump(mp, s); @@ -852,6 +854,8 @@ static void setup_stream_proc(struct packet_stream *stream) { return; if (stream->recording.u.proc.stream_idx != UNINIT_IDX) return; + if (ml->no_recording) + return; 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, @@ -877,6 +881,8 @@ static void setup_monologue_proc(struct call_monologue *ml) { if (!recording) return; + if (ml->no_recording) + return; append_meta_chunk_str(recording, &ml->tag, "TAG %u", ml->unique_id); if (ml->label.len) @@ -891,6 +897,8 @@ static void setup_media_proc(struct call_media *media) { if (!recording) return; + if (media->monologue->no_recording) + return; append_meta_chunk_null(recording, "MEDIA %u PTIME %i", media->unique_id, media->ptime); diff --git a/include/call.h b/include/call.h index 6ab5408fc..408e432c2 100644 --- a/include/call.h +++ b/include/call.h @@ -540,6 +540,7 @@ struct call_monologue { unsigned int rec_forwarding:1; unsigned int inject_dtmf:1; unsigned int detect_dtmf:1; + unsigned int no_recording:1; }; struct call_iterator_list { diff --git a/include/call_interfaces.h b/include/call_interfaces.h index 99da87c05..ac2ead366 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -157,6 +157,7 @@ struct sdp_ng_flags { siprec:1, fragment:1, record_call:1, + exclude_recording:1, debug:1, inactive:1, loop_protect:1,