Browse Source

MT#55283 set output-dest even if not active yet

Make it possible to set output-destination immediately when starting the
reording, not only afterwards.

Closes #1667

Change-Id: Idb7de770ad5a41d6ae6055784213e7983df9bfec
pull/1676/head
Richard Fuchs 3 years ago
parent
commit
ee0b2bc2c1
4 changed files with 12 additions and 4 deletions
  1. +3
    -0
      daemon/call_interfaces.c
  2. +3
    -3
      daemon/recording.c
  3. +5
    -1
      docs/ng_control_protocol.md
  4. +1
    -0
      include/call_interfaces.h

+ 3
- 0
daemon/call_interfaces.c View File

@ -1607,6 +1607,9 @@ static void call_ng_main_flags(struct sdp_ng_flags *out, str *key, bencode_item_
case CSH_LOOKUP("record-call"): case CSH_LOOKUP("record-call"):
out->record_call_str = s; out->record_call_str = s;
break; break;
case CSH_LOOKUP("output-destination"):
out->output_dest = s;
break;
case CSH_LOOKUP("address family"): case CSH_LOOKUP("address family"):
case CSH_LOOKUP("address-family"): case CSH_LOOKUP("address-family"):
if (bencode_get_str(value, &out->address_family_str)) if (bencode_get_str(value, &out->address_family_str))


+ 3
- 3
daemon/recording.c View File

@ -319,10 +319,9 @@ static void recording_update_flags(struct call *call, bool streams) {
// lock must be held // lock must be held
void recording_start(struct call *call, const char *prefix, const str *output_dest) { void recording_start(struct call *call, const char *prefix, const str *output_dest) {
update_output_dest(call, output_dest);
if (call->recording) { if (call->recording) {
// already active // already active
update_output_dest(call, output_dest);
recording_update_flags(call, true); recording_update_flags(call, true);
return; 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 // update main call flags (global recording/forwarding on/off) to prevent recording
// features from being started when the stream info (through setup_stream) is // features from being started when the stream info (through setup_stream) is
// propagated if recording is actually off // propagated if recording is actually off
update_output_dest(call, output_dest);
recording_update_flags(call, false); recording_update_flags(call, false);
// if recording has been turned on after initial call setup, we must walk // 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) { if (!str_cmp(recordcall, "yes") || !str_cmp(recordcall, "on") || flags->record_call) {
call->recording_on = 1; 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")) { else if (!str_cmp(recordcall, "no") || !str_cmp(recordcall, "off")) {
call->recording_on = 0; call->recording_on = 0;


+ 5
- 1
docs/ng_control_protocol.md View File

@ -435,6 +435,10 @@ Optionally included keys are:
Short for both `accept-RFC` and `accept-legacy`. Can be used Short for both `accept-RFC` and `accept-legacy`. Can be used
unconditionally in all signalling if so desired. unconditionally in all signalling if so desired.
* `output-destination`
See `start recording` below.
* `ptime` * `ptime`
Contains an integer. If set, changes the `a=ptime` attribute's value in the outgoing 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 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. 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. as an output file. Note that a filename extension will not be added.
## `stop recording` Message ## `stop recording` Message


+ 1
- 0
include/call_interfaces.h View File

@ -36,6 +36,7 @@ struct sdp_ng_flags {
sockfamily_t *address_family; sockfamily_t *address_family;
int tos; int tos;
str record_call_str; str record_call_str;
str output_dest;
str metadata; str metadata;
str label; str label;
str set_label; str set_label;


Loading…
Cancel
Save