MT#56759 unify recording_start trigger

Handle the start trigger in just one place

Change-Id: Id019ba0fe42dd7c4d7ef311de2c06c92679c8095
pull/1642/head
Richard Fuchs 3 years ago
parent fc491af7f3
commit 8b851c4663

@ -2047,11 +2047,7 @@ static const char *call_offer_answer_ng(struct ng_buffer *ngbuf, bencode_item_t
bencode_buffer_destroy_add(output->buffer, (free_func_t) sdp_chopper_destroy, chopper);
update_metadata_monologue(dialogue[0], &flags.metadata);
detect_setup_recording(call, &flags.record_call_str);
if (flags.record_call) {
call->recording_on = 1;
recording_start(call, NULL, NULL);
}
detect_setup_recording(call, &flags);
if (flags.drop_traffic_start) {
call->drop_traffic = 1;

@ -21,6 +21,7 @@
#include "rtplib.h"
#include "cdr.h"
#include "log.h"
#include "call_interfaces.h"
@ -413,11 +414,13 @@ void recording_pause(struct call *call) {
*
* Returns a boolean for whether or not the call is being recorded.
*/
void detect_setup_recording(struct call *call, const str *recordcall) {
if (!recordcall || !recordcall->s)
void detect_setup_recording(struct call *call, const struct sdp_ng_flags *flags) {
if (!flags)
return;
if (!str_cmp(recordcall, "yes") || !str_cmp(recordcall, "on")) {
const str *recordcall = &flags->record_call_str;
if (!str_cmp(recordcall, "yes") || !str_cmp(recordcall, "on") || flags->record_call) {
call->recording_on = 1;
recording_start(call, NULL, NULL);
}
@ -425,7 +428,7 @@ void detect_setup_recording(struct call *call, const str *recordcall) {
call->recording_on = 0;
recording_stop(call);
}
else
else if (recordcall->len != 0)
ilog(LOG_INFO, "\"record-call\" flag "STR_FORMAT" is invalid flag.", STR_FMT(recordcall));
}

@ -24,6 +24,7 @@ enum call_opmode;
struct rtpengine_target_info;
struct call_monologue;
struct call_media;
struct sdp_ng_flags;
struct recording_pcap {
@ -113,7 +114,7 @@ void recording_fs_free(void);
*
* Returns a boolean for whether or not the call is being recorded.
*/
void detect_setup_recording(struct call *call, const str *recordcall);
void detect_setup_recording(struct call *call, const struct sdp_ng_flags *flags);
void update_metadata_call(struct call *call, str *metadata);
void update_metadata_monologue(struct call_monologue *ml, str *metadata);

Loading…
Cancel
Save