@siphon-project/control 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -165,7 +165,14 @@ var SipVerb = {
165
165
  /** Record the call's decoded audio to a wav file (siphon-rtp backend only). */
166
166
  RecordStart: "record_start",
167
167
  /** Stop one recording by id, or every recording on the call. */
168
- RecordStop: "record_stop"
168
+ RecordStop: "record_stop",
169
+ /**
170
+ * Accept a recording session (a channel whose `StasisStart` has
171
+ * `kind: "siprec"`): siphon answers the recording client 200 and records each
172
+ * stream. {@link SipVerb.Reject} refuses one; neither within the handoff
173
+ * deadline refuses it `503`.
174
+ */
175
+ Accept: "accept"
169
176
  };
170
177
  function sipEventKind(name) {
171
178
  return name;
@@ -1108,6 +1115,31 @@ var Call = class {
1108
1115
  async progress(options) {
1109
1116
  await this.sip(SipVerb.Progress, options ? responseArgs(options) : {});
1110
1117
  }
1118
+ /**
1119
+ * Accept a recording session (`StasisStart` with `kind: "siprec"`): siphon
1120
+ * answers the recording client and records each stream as `options` say.
1121
+ * Unset fields take siphon's `srs:` configuration. Refuse one with
1122
+ * {@link Call.reject}.
1123
+ */
1124
+ async acceptRecording(options = {}) {
1125
+ const args = {};
1126
+ if (options.profile !== void 0) {
1127
+ args.profile = options.profile;
1128
+ }
1129
+ if (options.format !== void 0) {
1130
+ args.format = options.format;
1131
+ }
1132
+ if (options.bitrateBps !== void 0) {
1133
+ args.bitrate_bps = options.bitrateBps;
1134
+ }
1135
+ if (options.channels !== void 0) {
1136
+ args.channels = options.channels;
1137
+ }
1138
+ if (options.path !== void 0) {
1139
+ args.path = options.path;
1140
+ }
1141
+ await this.sip(SipVerb.Accept, args);
1142
+ }
1111
1143
  /** Send a final non-2xx and tear the call down. */
1112
1144
  async reject(code, reason) {
1113
1145
  const args = { code };