diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 132d082d1..ee70ddf64 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1607,6 +1607,9 @@ static void call_ng_main_flags(struct sdp_ng_flags *out, str *key, bencode_item_ case CSH_LOOKUP("record-call"): out->record_call_str = s; break; + case CSH_LOOKUP("output-destination"): + out->output_dest = s; + break; case CSH_LOOKUP("address family"): case CSH_LOOKUP("address-family"): if (bencode_get_str(value, &out->address_family_str)) diff --git a/daemon/recording.c b/daemon/recording.c index b513e7326..490b62bb3 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -319,10 +319,9 @@ static void recording_update_flags(struct call *call, bool streams) { // lock must be held void recording_start(struct call *call, const char *prefix, const str *output_dest) { - update_output_dest(call, output_dest); - if (call->recording) { // already active + update_output_dest(call, output_dest); recording_update_flags(call, true); return; } @@ -350,6 +349,7 @@ void recording_start(struct call *call, const char *prefix, const str *output_de // update main call flags (global recording/forwarding on/off) to prevent recording // features from being started when the stream info (through setup_stream) is // propagated if recording is actually off + update_output_dest(call, output_dest); recording_update_flags(call, false); // if recording has been turned on after initial call setup, we must walk @@ -426,7 +426,7 @@ void detect_setup_recording(struct call *call, const struct sdp_ng_flags *flags) if (!str_cmp(recordcall, "yes") || !str_cmp(recordcall, "on") || flags->record_call) { call->recording_on = 1; - recording_start(call, NULL, NULL); + recording_start(call, NULL, &flags->output_dest); } else if (!str_cmp(recordcall, "no") || !str_cmp(recordcall, "off")) { call->recording_on = 0; diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index 324d2ee18..016f0048b 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -435,6 +435,10 @@ Optionally included keys are: Short for both `accept-RFC` and `accept-legacy`. Can be used unconditionally in all signalling if so desired. +* `output-destination` + + See `start recording` below. + * `ptime` Contains an integer. If set, changes the `a=ptime` attribute's value in the outgoing @@ -1710,7 +1714,7 @@ call legs, therefore all keys other than `call-id` are currently ignored. If the chosen recording method doesn't support in-kernel packet forwarding, enabling call recording via this messages will force packet forwarding to happen in userspace only. -If the optional 'output-destination' key is set, then its value will be used +If the optional `output-destination` key is set, then its value will be used as an output file. Note that a filename extension will not be added. ## `stop recording` Message diff --git a/include/call_interfaces.h b/include/call_interfaces.h index 3a86e1d88..1f2b27992 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -36,6 +36,7 @@ struct sdp_ng_flags { sockfamily_t *address_family; int tos; str record_call_str; + str output_dest; str metadata; str label; str set_label;