@siphon-project/control 0.10.1 → 0.11.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
@@ -659,6 +659,28 @@ function responseArgs(options) {
659
659
  }
660
660
  return args;
661
661
  }
662
+ var MEDIA_FLAG_WIRE_NAMES = [
663
+ ["echoCancellation", "echo_cancellation"],
664
+ ["echoDelaySearchMs", "echo_delay_search_ms"],
665
+ ["echoLongTail", "echo_long_tail"],
666
+ ["echoResidualSuppression", "echo_residual_suppression"],
667
+ ["noiseSuppression", "noise_suppression"],
668
+ ["wsVad", "ws_vad"],
669
+ ["wsVadEngine", "ws_vad_engine"],
670
+ ["wsVadMinSpeechMs", "ws_vad_min_speech_ms"],
671
+ ["wsVadThreshold", "ws_vad_threshold"],
672
+ ["wsVadHangoverMs", "ws_vad_hangover_ms"],
673
+ ["wsBargeIn", "ws_barge_in"],
674
+ ["wsSampleRate", "ws_sample_rate"]
675
+ ];
676
+ function mediaFlagsArg(flags) {
677
+ const wire = {};
678
+ for (const [name, wireName] of MEDIA_FLAG_WIRE_NAMES) {
679
+ const value = flags[name];
680
+ if (value !== void 0) wire[wireName] = value;
681
+ }
682
+ return wire;
683
+ }
662
684
  function insertTransferIdentity(args, identity) {
663
685
  if (identity?.from !== void 0) args.from = identity.from;
664
686
  if (identity?.fromDisplay !== void 0) args.from_display = identity.fromDisplay;
@@ -760,6 +782,7 @@ function originateCommonArgs(args, media, options) {
760
782
  args.media = true;
761
783
  if (media.profile !== void 0) args.profile = media.profile;
762
784
  if (media.wsUri !== void 0) args.ws_uri = media.wsUri;
785
+ if (media.mediaFlags !== void 0) args.media_flags = mediaFlagsArg(media.mediaFlags);
763
786
  } else if ("sdp" in media) {
764
787
  args.sdp = media.sdp;
765
788
  } else {
@@ -1046,6 +1069,9 @@ var Call = class {
1046
1069
  if (options?.wsUri !== void 0) {
1047
1070
  args.ws_uri = options.wsUri;
1048
1071
  }
1072
+ if (options?.mediaFlags !== void 0) {
1073
+ args.media_flags = mediaFlagsArg(options.mediaFlags);
1074
+ }
1049
1075
  if (options?.contactHost !== void 0) {
1050
1076
  args.contact_host = options.contactHost;
1051
1077
  }
@@ -1579,6 +1605,9 @@ var Call = class {
1579
1605
  if (options?.profile !== void 0) {
1580
1606
  args.profile = options.profile;
1581
1607
  }
1608
+ if (options?.mediaFlags !== void 0) {
1609
+ args.media_flags = mediaFlagsArg(options.mediaFlags);
1610
+ }
1582
1611
  await this.sip(SipVerb.StreamStart, args);
1583
1612
  }
1584
1613
  /**