@siphon-project/control 0.10.1 → 0.12.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.d.cts CHANGED
@@ -1206,6 +1206,42 @@ interface RouteOptions {
1206
1206
  */
1207
1207
  callerContactUser?: string;
1208
1208
  }
1209
+ /**
1210
+ * Per-call overrides of a media profile's processing settings, merged over the
1211
+ * profile (its answer half) for one call only and sent as `media_flags`, each
1212
+ * key in snake_case. A key left unset keeps the profile's value. The server
1213
+ * refuses an unknown key, a `null` or a value the engine would refuse with
1214
+ * `bad_request` whose `details.field` names the key.
1215
+ */
1216
+ interface MediaFlags {
1217
+ /** Echo cancellation on the leg's uplink. */
1218
+ echoCancellation?: boolean;
1219
+ /**
1220
+ * How far the canceller searches for the echo, in ms: 16-1000 as a search
1221
+ * window, or as a tail length when the merged `echoLongTail` is set.
1222
+ */
1223
+ echoDelaySearchMs?: number;
1224
+ /** Span the echo path with the adaptive filter (a tail length). */
1225
+ echoLongTail?: boolean;
1226
+ /** Chain the residual-echo suppressor after the canceller. */
1227
+ echoResidualSuppression?: boolean;
1228
+ /** Noise suppression on the leg's uplink. */
1229
+ noiseSuppression?: boolean;
1230
+ /** The WebSocket uplink voice-activity detector. */
1231
+ wsVad?: boolean;
1232
+ /** Which detector `wsVad` runs. */
1233
+ wsVadEngine?: "energy" | "neural";
1234
+ /** Leading speech run, in ms, before `speech_started` (and barge-in). */
1235
+ wsVadMinSpeechMs?: number;
1236
+ /** Energy threshold for the energy detector; higher is less sensitive. */
1237
+ wsVadThreshold?: number;
1238
+ /** Trailing hangover, in ms, before `speech_stopped`. */
1239
+ wsVadHangoverMs?: number;
1240
+ /** Flush the queued downlink when the caller starts speaking. */
1241
+ wsBargeIn?: boolean;
1242
+ /** L16 wire rate of a WebSocket bridge in Hz: a multiple of 1000 in 8000-48000. */
1243
+ wsSampleRate?: number;
1244
+ }
1209
1245
  /** Options for an anchored answer ({@link Call.answerAnchored}). */
1210
1246
  interface AnchoredAnswerOptions {
1211
1247
  /** UAS 2xx code (default `200`). */
@@ -1221,6 +1257,8 @@ interface AnchoredAnswerOptions {
1221
1257
  * `callId`.
1222
1258
  */
1223
1259
  wsUri?: string;
1260
+ /** Overrides of the profile's processing settings for this call. */
1261
+ mediaFlags?: MediaFlags;
1224
1262
  /** Host of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
1225
1263
  contactHost?: string;
1226
1264
  /** User part of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
@@ -1395,6 +1433,7 @@ type OriginateMedia =
1395
1433
  anchor: true;
1396
1434
  profile?: string;
1397
1435
  wsUri?: string;
1436
+ mediaFlags?: MediaFlags;
1398
1437
  }
1399
1438
  /** Your own SDP offer (`application/sdp` by definition). */
1400
1439
  | {
@@ -1776,6 +1815,12 @@ interface Dialing {
1776
1815
  type RecordDirection = "ingress" | "egress" | "both";
1777
1816
  /** The channel layout of the recorded file. */
1778
1817
  type RecordChannels = "mono" | "stereo";
1818
+ /**
1819
+ * The file a recording is written as: `"wav"` (the server's default) or
1820
+ * `"ogg_opus"` (RFC 7845), about a seventh of the size. An engine that cannot
1821
+ * write Ogg Opus refuses the verb.
1822
+ */
1823
+ type RecordFormat = "wav" | "ogg_opus";
1779
1824
  /** Optional shaping for {@link Call.recordStart}. */
1780
1825
  interface RecordOptions {
1781
1826
  /** Which side to record (`"ingress"` server-side when unset). */
@@ -1788,6 +1833,14 @@ interface RecordOptions {
1788
1833
  silenceMs?: number;
1789
1834
  /** Where the engine writes the file. */
1790
1835
  path?: string;
1836
+ /** The file format (`"wav"` server-side when unset). */
1837
+ format?: RecordFormat;
1838
+ /**
1839
+ * Opus target bitrate in bits per second, `"ogg_opus"` only. The server
1840
+ * refuses it with `"wav"` and outside 6000 to 510000 (RFC 6716 §2.1.1);
1841
+ * unset is its per-channel default.
1842
+ */
1843
+ bitrateBps?: number;
1791
1844
  }
1792
1845
  /** What the server answers an accepted `record_start` with. */
1793
1846
  interface Recording {
@@ -1884,6 +1937,11 @@ interface StreamOptions {
1884
1937
  * and an unknown name rejects with `bad_request`.
1885
1938
  */
1886
1939
  profile?: string;
1940
+ /**
1941
+ * Bridge only: overrides of `profile`'s settings for this bridge. They need a
1942
+ * `profile` to merge over; without one, or on a tee, the server refuses them.
1943
+ */
1944
+ mediaFlags?: MediaFlags;
1887
1945
  }
1888
1946
  /** Options for {@link Call.streamStop}. */
1889
1947
  interface StreamStopOptions {
@@ -2309,7 +2367,8 @@ declare class Call {
2309
2367
  */
2310
2368
  streamStop(options?: StreamStopOptions): Promise<void>;
2311
2369
  /**
2312
- * Record this call's decoded audio to a wav file.
2370
+ * Record this call's decoded audio to a file: wav by default, or Ogg Opus
2371
+ * with `format: "ogg_opus"`.
2313
2372
  *
2314
2373
  * The reply names the `recordingId` a later {@link Call.recordStop}
2315
2374
  * addresses. It is **not** the file: `RecordingFinished` fires when the file
@@ -2501,4 +2560,4 @@ declare class SipServer {
2501
2560
  close(): Promise<void>;
2502
2561
  }
2503
2562
 
2504
- export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOffer, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, OUTBOUND_REGISTRATIONS, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, type OutboundRegistration, type OutboundRegistrationsReply, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, REGISTRATIONS, RESYNC, type RecordChannels, type RecordDirection, type RecordOptions, type Recording, type ReferReplaces, type RegistrantChangedPayload, type RegistrationChangedPayload, type RegistrationContact, type RegistrationsReply, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RingOptions, type RouteOptions, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
2563
+ export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOffer, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaFlags, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, OUTBOUND_REGISTRATIONS, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, type OutboundRegistration, type OutboundRegistrationsReply, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, REGISTRATIONS, RESYNC, type RecordChannels, type RecordDirection, type RecordFormat, type RecordOptions, type Recording, type ReferReplaces, type RegistrantChangedPayload, type RegistrationChangedPayload, type RegistrationContact, type RegistrationsReply, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RingOptions, type RouteOptions, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
package/dist/index.d.ts CHANGED
@@ -1206,6 +1206,42 @@ interface RouteOptions {
1206
1206
  */
1207
1207
  callerContactUser?: string;
1208
1208
  }
1209
+ /**
1210
+ * Per-call overrides of a media profile's processing settings, merged over the
1211
+ * profile (its answer half) for one call only and sent as `media_flags`, each
1212
+ * key in snake_case. A key left unset keeps the profile's value. The server
1213
+ * refuses an unknown key, a `null` or a value the engine would refuse with
1214
+ * `bad_request` whose `details.field` names the key.
1215
+ */
1216
+ interface MediaFlags {
1217
+ /** Echo cancellation on the leg's uplink. */
1218
+ echoCancellation?: boolean;
1219
+ /**
1220
+ * How far the canceller searches for the echo, in ms: 16-1000 as a search
1221
+ * window, or as a tail length when the merged `echoLongTail` is set.
1222
+ */
1223
+ echoDelaySearchMs?: number;
1224
+ /** Span the echo path with the adaptive filter (a tail length). */
1225
+ echoLongTail?: boolean;
1226
+ /** Chain the residual-echo suppressor after the canceller. */
1227
+ echoResidualSuppression?: boolean;
1228
+ /** Noise suppression on the leg's uplink. */
1229
+ noiseSuppression?: boolean;
1230
+ /** The WebSocket uplink voice-activity detector. */
1231
+ wsVad?: boolean;
1232
+ /** Which detector `wsVad` runs. */
1233
+ wsVadEngine?: "energy" | "neural";
1234
+ /** Leading speech run, in ms, before `speech_started` (and barge-in). */
1235
+ wsVadMinSpeechMs?: number;
1236
+ /** Energy threshold for the energy detector; higher is less sensitive. */
1237
+ wsVadThreshold?: number;
1238
+ /** Trailing hangover, in ms, before `speech_stopped`. */
1239
+ wsVadHangoverMs?: number;
1240
+ /** Flush the queued downlink when the caller starts speaking. */
1241
+ wsBargeIn?: boolean;
1242
+ /** L16 wire rate of a WebSocket bridge in Hz: a multiple of 1000 in 8000-48000. */
1243
+ wsSampleRate?: number;
1244
+ }
1209
1245
  /** Options for an anchored answer ({@link Call.answerAnchored}). */
1210
1246
  interface AnchoredAnswerOptions {
1211
1247
  /** UAS 2xx code (default `200`). */
@@ -1221,6 +1257,8 @@ interface AnchoredAnswerOptions {
1221
1257
  * `callId`.
1222
1258
  */
1223
1259
  wsUri?: string;
1260
+ /** Overrides of the profile's processing settings for this call. */
1261
+ mediaFlags?: MediaFlags;
1224
1262
  /** Host of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
1225
1263
  contactHost?: string;
1226
1264
  /** User part of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
@@ -1395,6 +1433,7 @@ type OriginateMedia =
1395
1433
  anchor: true;
1396
1434
  profile?: string;
1397
1435
  wsUri?: string;
1436
+ mediaFlags?: MediaFlags;
1398
1437
  }
1399
1438
  /** Your own SDP offer (`application/sdp` by definition). */
1400
1439
  | {
@@ -1776,6 +1815,12 @@ interface Dialing {
1776
1815
  type RecordDirection = "ingress" | "egress" | "both";
1777
1816
  /** The channel layout of the recorded file. */
1778
1817
  type RecordChannels = "mono" | "stereo";
1818
+ /**
1819
+ * The file a recording is written as: `"wav"` (the server's default) or
1820
+ * `"ogg_opus"` (RFC 7845), about a seventh of the size. An engine that cannot
1821
+ * write Ogg Opus refuses the verb.
1822
+ */
1823
+ type RecordFormat = "wav" | "ogg_opus";
1779
1824
  /** Optional shaping for {@link Call.recordStart}. */
1780
1825
  interface RecordOptions {
1781
1826
  /** Which side to record (`"ingress"` server-side when unset). */
@@ -1788,6 +1833,14 @@ interface RecordOptions {
1788
1833
  silenceMs?: number;
1789
1834
  /** Where the engine writes the file. */
1790
1835
  path?: string;
1836
+ /** The file format (`"wav"` server-side when unset). */
1837
+ format?: RecordFormat;
1838
+ /**
1839
+ * Opus target bitrate in bits per second, `"ogg_opus"` only. The server
1840
+ * refuses it with `"wav"` and outside 6000 to 510000 (RFC 6716 §2.1.1);
1841
+ * unset is its per-channel default.
1842
+ */
1843
+ bitrateBps?: number;
1791
1844
  }
1792
1845
  /** What the server answers an accepted `record_start` with. */
1793
1846
  interface Recording {
@@ -1884,6 +1937,11 @@ interface StreamOptions {
1884
1937
  * and an unknown name rejects with `bad_request`.
1885
1938
  */
1886
1939
  profile?: string;
1940
+ /**
1941
+ * Bridge only: overrides of `profile`'s settings for this bridge. They need a
1942
+ * `profile` to merge over; without one, or on a tee, the server refuses them.
1943
+ */
1944
+ mediaFlags?: MediaFlags;
1887
1945
  }
1888
1946
  /** Options for {@link Call.streamStop}. */
1889
1947
  interface StreamStopOptions {
@@ -2309,7 +2367,8 @@ declare class Call {
2309
2367
  */
2310
2368
  streamStop(options?: StreamStopOptions): Promise<void>;
2311
2369
  /**
2312
- * Record this call's decoded audio to a wav file.
2370
+ * Record this call's decoded audio to a file: wav by default, or Ogg Opus
2371
+ * with `format: "ogg_opus"`.
2313
2372
  *
2314
2373
  * The reply names the `recordingId` a later {@link Call.recordStop}
2315
2374
  * addresses. It is **not** the file: `RecordingFinished` fires when the file
@@ -2501,4 +2560,4 @@ declare class SipServer {
2501
2560
  close(): Promise<void>;
2502
2561
  }
2503
2562
 
2504
- export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOffer, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, OUTBOUND_REGISTRATIONS, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, type OutboundRegistration, type OutboundRegistrationsReply, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, REGISTRATIONS, RESYNC, type RecordChannels, type RecordDirection, type RecordOptions, type Recording, type ReferReplaces, type RegistrantChangedPayload, type RegistrationChangedPayload, type RegistrationContact, type RegistrationsReply, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RingOptions, type RouteOptions, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
2563
+ export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOffer, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaFlags, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, OUTBOUND_REGISTRATIONS, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, type OutboundRegistration, type OutboundRegistrationsReply, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, REGISTRATIONS, RESYNC, type RecordChannels, type RecordDirection, type RecordFormat, type RecordOptions, type Recording, type ReferReplaces, type RegistrantChangedPayload, type RegistrationChangedPayload, type RegistrationContact, type RegistrationsReply, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RingOptions, type RouteOptions, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
package/dist/index.js CHANGED
@@ -653,6 +653,28 @@ function responseArgs(options) {
653
653
  }
654
654
  return args;
655
655
  }
656
+ var MEDIA_FLAG_WIRE_NAMES = [
657
+ ["echoCancellation", "echo_cancellation"],
658
+ ["echoDelaySearchMs", "echo_delay_search_ms"],
659
+ ["echoLongTail", "echo_long_tail"],
660
+ ["echoResidualSuppression", "echo_residual_suppression"],
661
+ ["noiseSuppression", "noise_suppression"],
662
+ ["wsVad", "ws_vad"],
663
+ ["wsVadEngine", "ws_vad_engine"],
664
+ ["wsVadMinSpeechMs", "ws_vad_min_speech_ms"],
665
+ ["wsVadThreshold", "ws_vad_threshold"],
666
+ ["wsVadHangoverMs", "ws_vad_hangover_ms"],
667
+ ["wsBargeIn", "ws_barge_in"],
668
+ ["wsSampleRate", "ws_sample_rate"]
669
+ ];
670
+ function mediaFlagsArg(flags) {
671
+ const wire = {};
672
+ for (const [name, wireName] of MEDIA_FLAG_WIRE_NAMES) {
673
+ const value = flags[name];
674
+ if (value !== void 0) wire[wireName] = value;
675
+ }
676
+ return wire;
677
+ }
656
678
  function insertTransferIdentity(args, identity) {
657
679
  if (identity?.from !== void 0) args.from = identity.from;
658
680
  if (identity?.fromDisplay !== void 0) args.from_display = identity.fromDisplay;
@@ -754,6 +776,7 @@ function originateCommonArgs(args, media, options) {
754
776
  args.media = true;
755
777
  if (media.profile !== void 0) args.profile = media.profile;
756
778
  if (media.wsUri !== void 0) args.ws_uri = media.wsUri;
779
+ if (media.mediaFlags !== void 0) args.media_flags = mediaFlagsArg(media.mediaFlags);
757
780
  } else if ("sdp" in media) {
758
781
  args.sdp = media.sdp;
759
782
  } else {
@@ -923,6 +946,8 @@ function recordStartArgs(options) {
923
946
  if (options.maxDurationMs !== void 0) args.max_duration_ms = options.maxDurationMs;
924
947
  if (options.silenceMs !== void 0) args.silence_ms = options.silenceMs;
925
948
  if (options.path !== void 0) args.path = options.path;
949
+ if (options.format !== void 0) args.format = options.format;
950
+ if (options.bitrateBps !== void 0) args.bitrate_bps = options.bitrateBps;
926
951
  return args;
927
952
  }
928
953
  function recordStopArgs(recordingId) {
@@ -1040,6 +1065,9 @@ var Call = class {
1040
1065
  if (options?.wsUri !== void 0) {
1041
1066
  args.ws_uri = options.wsUri;
1042
1067
  }
1068
+ if (options?.mediaFlags !== void 0) {
1069
+ args.media_flags = mediaFlagsArg(options.mediaFlags);
1070
+ }
1043
1071
  if (options?.contactHost !== void 0) {
1044
1072
  args.contact_host = options.contactHost;
1045
1073
  }
@@ -1573,6 +1601,9 @@ var Call = class {
1573
1601
  if (options?.profile !== void 0) {
1574
1602
  args.profile = options.profile;
1575
1603
  }
1604
+ if (options?.mediaFlags !== void 0) {
1605
+ args.media_flags = mediaFlagsArg(options.mediaFlags);
1606
+ }
1576
1607
  await this.sip(SipVerb.StreamStart, args);
1577
1608
  }
1578
1609
  /**
@@ -1585,7 +1616,8 @@ var Call = class {
1585
1616
  await this.sip(SipVerb.StreamStop, { mode: options?.mode ?? "tee" });
1586
1617
  }
1587
1618
  /**
1588
- * Record this call's decoded audio to a wav file.
1619
+ * Record this call's decoded audio to a file: wav by default, or Ogg Opus
1620
+ * with `format: "ogg_opus"`.
1589
1621
  *
1590
1622
  * The reply names the `recordingId` a later {@link Call.recordStop}
1591
1623
  * addresses. It is **not** the file: `RecordingFinished` fires when the file