sip-connector 19.4.0 → 19.6.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.
@@ -1,7 +1,7 @@
1
1
  import { Events as k, TypedEvents as U } from "events-constructor";
2
2
  import x from "debug";
3
3
  import { CancelableRequest as G, isCanceledError as me } from "@krivega/cancelable-promise";
4
- import { resolveRequesterByTimeout as _e, requesterByTimeoutsWithFailCalls as Me, DelayRequester as fe, hasCanceledError as ve, SetTimeoutRequest as Z } from "@krivega/timeout-requester";
4
+ import { resolveRequesterByTimeout as _e, requesterByTimeoutsWithFailCalls as Me, DelayRequester as ve, hasCanceledError as fe, SetTimeoutRequest as Z } from "@krivega/timeout-requester";
5
5
  import { hasCanceledError as Pe, repeatedCallsAsync as ee } from "repeated-calls";
6
6
  import { setup as Oe, createActor as ye } from "xstate";
7
7
  import { createStackPromises as te, isPromiseIsNotActualError as De } from "stack-promises";
@@ -12,7 +12,7 @@ const Q = "sip-connector", d = x(Q), Wn = () => {
12
12
  }, Hn = () => {
13
13
  x.enable(`-${Q}`);
14
14
  }, be = "Error decline with 603", we = 1006, Ue = (n) => typeof n == "object" && n !== null && "code" in n && n.code === we, Le = (n) => n.message === be;
15
- var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), P = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(P || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), v = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(v || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Be = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Be || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n.RESTART = "restart", n))(u || {});
15
+ var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), P = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(P || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), f = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(f || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Be = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Be || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n.RESTART = "restart", n))(u || {});
16
16
  const ne = [
17
17
  "participation:accepting-word-request",
18
18
  "participation:cancelling-word-request",
@@ -426,15 +426,15 @@ class Fe {
426
426
  };
427
427
  triggerMainCamControl = (e) => {
428
428
  const t = e.getHeader(l.MAIN_CAM), s = e.getHeader(l.MEDIA_SYNC), i = s === H.ADMIN_SYNC_FORCED;
429
- if (t === v.ADMIN_START_MAIN_CAM) {
429
+ if (t === f.ADMIN_START_MAIN_CAM) {
430
430
  this.events.trigger(u.ADMIN_START_MAIN_CAM, { isSyncForced: i });
431
431
  return;
432
432
  }
433
- if (t === v.ADMIN_STOP_MAIN_CAM) {
433
+ if (t === f.ADMIN_STOP_MAIN_CAM) {
434
434
  this.events.trigger(u.ADMIN_STOP_MAIN_CAM, { isSyncForced: i });
435
435
  return;
436
436
  }
437
- (t === v.RESUME_MAIN_CAM || t === v.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(u.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
437
+ (t === f.RESUME_MAIN_CAM || t === f.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(u.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
438
438
  const r = e.getHeader(l.MAIN_CAM_RESOLUTION);
439
439
  this.events.trigger(u.MAIN_CAM_CONTROL, {
440
440
  mainCam: t,
@@ -587,7 +587,7 @@ class Ye extends Ge {
587
587
  contentHint: T,
588
588
  offerToReceiveAudio: S = !0,
589
589
  offerToReceiveVideo: g = !0,
590
- degradationPreference: C,
590
+ degradationPreference: E,
591
591
  sendEncodings: m,
592
592
  onAddedTransceiver: I
593
593
  }) => (this.isPendingCall = !0, new Promise((R, D) => {
@@ -613,7 +613,7 @@ class Ye extends Ge {
613
613
  extraHeaders: r,
614
614
  directionVideo: c,
615
615
  directionAudio: h,
616
- degradationPreference: C,
616
+ degradationPreference: E,
617
617
  sendEncodings: m,
618
618
  onAddedTransceiver: I
619
619
  });
@@ -642,7 +642,7 @@ class Ye extends Ge {
642
642
  contentHint: T,
643
643
  degradationPreference: S,
644
644
  sendEncodings: g,
645
- onAddedTransceiver: C
645
+ onAddedTransceiver: E
646
646
  }) => (this.isPendingAnswer = !0, new Promise((m, I) => {
647
647
  try {
648
648
  const R = e();
@@ -666,7 +666,7 @@ class Ye extends Ge {
666
666
  directionAudio: o,
667
667
  degradationPreference: S,
668
668
  sendEncodings: g,
669
- onAddedTransceiver: C
669
+ onAddedTransceiver: E
670
670
  });
671
671
  } catch (R) {
672
672
  I(R);
@@ -721,11 +721,11 @@ class Ye extends Ge {
721
721
  let h;
722
722
  const T = ({ peerconnection: g }) => {
723
723
  h = g;
724
- const C = (m) => {
724
+ const E = (m) => {
725
725
  this.events.trigger(N.PEER_CONNECTION_ONTRACK, m), e && e(m);
726
726
  };
727
- g.addEventListener("track", C), this.disposers.add(() => {
728
- g.removeEventListener("track", C);
727
+ g.addEventListener("track", E), this.disposers.add(() => {
728
+ g.removeEventListener("track", E);
729
729
  });
730
730
  }, S = () => {
731
731
  h !== void 0 && this.events.trigger(N.PEER_CONNECTION_CONFIRMED, h), r(), o(), t(h);
@@ -1065,7 +1065,7 @@ class dt {
1065
1065
  }
1066
1066
  }
1067
1067
  class ht {
1068
- data = {};
1068
+ data;
1069
1069
  getUa;
1070
1070
  constructor(e) {
1071
1071
  this.getUa = e.getUa;
@@ -1080,64 +1080,71 @@ class ht {
1080
1080
  * Получает текущую конфигурацию подключения
1081
1081
  */
1082
1082
  get() {
1083
- return { ...this.data };
1083
+ if (this.data !== void 0)
1084
+ return { ...this.data };
1084
1085
  }
1085
1086
  /**
1086
1087
  * Устанавливает конфигурацию подключения
1087
1088
  */
1088
1089
  set(e) {
1090
+ if (e === void 0) {
1091
+ this.data = void 0;
1092
+ return;
1093
+ }
1089
1094
  this.data = { ...e };
1090
1095
  }
1091
1096
  /**
1092
1097
  * Обновляет конфигурацию подключения
1093
1098
  */
1094
1099
  update(e, t) {
1100
+ if (this.data === void 0)
1101
+ throw new Error("data is not exist");
1095
1102
  this.data[e] = t;
1096
1103
  }
1097
1104
  /**
1098
1105
  * Очищает конфигурацию
1099
1106
  */
1100
1107
  clear() {
1101
- this.data = {};
1108
+ this.data = void 0;
1102
1109
  }
1103
1110
  /**
1104
1111
  * Проверяет, включена ли регистрация в конфигурации
1105
1112
  */
1106
1113
  isRegister() {
1107
- return this.data.register === !0;
1114
+ return this.data?.register === !0;
1108
1115
  }
1109
1116
  /**
1110
1117
  * Получает SIP сервер URL из конфигурации
1111
1118
  */
1112
1119
  getSipServerUrl() {
1113
- return this.data.sipServerUrl;
1120
+ return this.data?.sipServerUrl;
1114
1121
  }
1115
1122
  /**
1116
1123
  * Получает display name из конфигурации
1117
1124
  */
1118
1125
  getDisplayName() {
1119
- return this.data.displayName;
1126
+ return this.data?.displayName;
1120
1127
  }
1121
1128
  /**
1122
1129
  * Получает пользователя из конфигурации
1123
1130
  */
1124
1131
  getUser() {
1125
- return this.data.user;
1132
+ return this.data?.user;
1126
1133
  }
1127
1134
  /**
1128
1135
  * Получает пароль из конфигурации
1129
1136
  */
1130
1137
  getPassword() {
1131
- return this.data.password;
1138
+ return this.data?.password;
1132
1139
  }
1133
1140
  /**
1134
1141
  * Проверяет, включена ли регистрация
1135
1142
  */
1136
1143
  isRegisterEnabled() {
1137
- return this.data.register === !0;
1144
+ return this.data?.register === !0;
1138
1145
  }
1139
1146
  }
1140
- var E = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.DISCONNECTING = "disconnecting", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n.CONNECT_STARTED = "connect-started", n.CONNECT_SUCCEEDED = "connect-succeeded", n.CONNECT_FAILED = "connect-failed", n.CONNECT_PARAMETERS_RESOLVE_FAILED = "connect-parameters-resolve-failed", n))(E || {});
1147
+ var C = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.DISCONNECTING = "disconnecting", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n.CONNECT_STARTED = "connect-started", n.CONNECT_SUCCEEDED = "connect-succeeded", n.CONNECT_FAILED = "connect-failed", n.CONNECT_PARAMETERS_RESOLVE_SUCCESS = "connect-parameters-resolve-success", n.CONNECT_PARAMETERS_RESOLVE_FAILED = "connect-parameters-resolve-failed", n))(C || {});
1141
1148
  const le = [
1142
1149
  "connecting",
1143
1150
  "connected",
@@ -1153,6 +1160,7 @@ const le = [
1153
1160
  "connect-started",
1154
1161
  "connect-succeeded",
1155
1162
  "connect-failed",
1163
+ "connect-parameters-resolve-success",
1156
1164
  "connect-parameters-resolve-failed"
1157
1165
  ], ge = [...le, ...lt], gt = 3;
1158
1166
  class ut {
@@ -1181,18 +1189,18 @@ class ut {
1181
1189
  }
1182
1190
  let r = !1;
1183
1191
  const a = this.getConnectionConfiguration();
1184
- e !== void 0 && e !== a.displayName && (r = i.set("display_name", re(e)), this.updateConnectionConfiguration("displayName", e));
1192
+ e !== void 0 && e !== a?.displayName && (r = i.set("display_name", re(e)), this.updateConnectionConfiguration("displayName", e));
1185
1193
  const o = r;
1186
1194
  o ? t(o) : s(new Error("nothing changed"));
1187
1195
  });
1188
1196
  disconnect = async () => {
1189
- this.events.trigger(E.DISCONNECTING, {});
1197
+ this.events.trigger(C.DISCONNECTING, {});
1190
1198
  const e = new Promise((s) => {
1191
- this.events.once(E.DISCONNECTED, () => {
1199
+ this.events.once(C.DISCONNECTED, () => {
1192
1200
  s();
1193
1201
  });
1194
1202
  }), t = this.getUa();
1195
- return t ? t.stop() : this.events.trigger(E.DISCONNECTED, { socket: {}, error: !1 }), e.finally(() => {
1203
+ return t ? t.stop() : this.events.trigger(C.DISCONNECTED, { socket: {}, error: !1 }), e.finally(() => {
1196
1204
  this.setUa(void 0), this.stateMachine.reset();
1197
1205
  });
1198
1206
  };
@@ -1220,10 +1228,15 @@ class ut {
1220
1228
  const { configuration: t } = this.uaFactory.createConfiguration(e), i = this.getUa()?.configuration;
1221
1229
  return i ? i.password === t.password && i.register === t.register && i.uri.toString() === t.uri && i.display_name === t.display_name && i.user_agent === t.user_agent && i.sockets === t.sockets && i.session_timers === t.session_timers && i.register_expires === t.register_expires && i.connection_recovery_min_interval === t.connection_recovery_min_interval && i.connection_recovery_max_interval === t.connection_recovery_max_interval : !1;
1222
1230
  }
1223
- connectInner = async (e) => this.initUa(e).then(async () => this.start()).then((t) => ({
1224
- ...this.getConnectionConfiguration(),
1225
- ua: t
1226
- }));
1231
+ connectInner = async (e) => this.initUa(e).then(async () => this.start()).then((t) => {
1232
+ const s = this.getConnectionConfiguration();
1233
+ if (s === void 0)
1234
+ throw new Error("connectionConfiguration has not defined");
1235
+ return {
1236
+ ...s,
1237
+ ua: t
1238
+ };
1239
+ });
1227
1240
  initUa = async ({
1228
1241
  user: e,
1229
1242
  password: t,
@@ -1237,7 +1250,7 @@ class ut {
1237
1250
  userAgent: T,
1238
1251
  displayName: S = "",
1239
1252
  register: g = !1,
1240
- extraHeaders: C = []
1253
+ extraHeaders: E = []
1241
1254
  }) => {
1242
1255
  this.stateMachine.startInitUa(), this.setConnectionConfiguration({
1243
1256
  sipServerUrl: s,
@@ -1260,7 +1273,7 @@ class ut {
1260
1273
  connectionRecoveryMaxInterval: h,
1261
1274
  userAgent: T,
1262
1275
  remoteAddress: r,
1263
- extraHeaders: C
1276
+ extraHeaders: E
1264
1277
  },
1265
1278
  this.events
1266
1279
  );
@@ -1274,14 +1287,14 @@ class ut {
1274
1287
  }
1275
1288
  let i;
1276
1289
  i = ((c, h) => {
1277
- if (this.getConnectionConfiguration().register === !0)
1290
+ if (this.getConnectionConfiguration()?.register === !0)
1278
1291
  return this.registrationManager.subscribeToStartEvents(c, h);
1279
- const S = E.CONNECTED, g = [E.DISCONNECTED];
1280
- return this.events.on(S, c), g.forEach((C) => {
1281
- this.events.on(C, h);
1292
+ const S = C.CONNECTED, g = [C.DISCONNECTED];
1293
+ return this.events.on(S, c), g.forEach((E) => {
1294
+ this.events.on(E, h);
1282
1295
  }), () => {
1283
- this.events.off(S, c), g.forEach((C) => {
1284
- this.events.off(C, h);
1296
+ this.events.off(S, c), g.forEach((E) => {
1297
+ this.events.off(E, h);
1285
1298
  });
1286
1299
  };
1287
1300
  })(() => {
@@ -1780,13 +1793,13 @@ class Ct {
1780
1793
  async register() {
1781
1794
  const e = this.getUaProtected();
1782
1795
  return new Promise((t, s) => {
1783
- e.on(E.REGISTERED, t), e.on(E.REGISTRATION_FAILED, s), e.register();
1796
+ e.on(C.REGISTERED, t), e.on(C.REGISTRATION_FAILED, s), e.register();
1784
1797
  });
1785
1798
  }
1786
1799
  async unregister() {
1787
1800
  const e = this.getUaProtected();
1788
1801
  return new Promise((t) => {
1789
- e.on(E.UNREGISTERED, t), e.unregister();
1802
+ e.on(C.UNREGISTERED, t), e.unregister();
1790
1803
  });
1791
1804
  }
1792
1805
  async tryRegister() {
@@ -1798,7 +1811,7 @@ class Ct {
1798
1811
  return this.register();
1799
1812
  }
1800
1813
  subscribeToStartEvents(e, t) {
1801
- const s = E.REGISTERED, i = [E.REGISTRATION_FAILED, E.DISCONNECTED];
1814
+ const s = C.REGISTERED, i = [C.REGISTRATION_FAILED, C.DISCONNECTED];
1802
1815
  return this.events.on(s, e), i.forEach((r) => {
1803
1816
  this.events.on(r, t);
1804
1817
  }), () => {
@@ -1860,16 +1873,16 @@ class Et {
1860
1873
  userAgent: e,
1861
1874
  sipServerUrl: s
1862
1875
  }), T = this.uaFactory.createUA({ ...h, remoteAddress: r, extraHeaders: a }), S = () => {
1863
- const C = new Error("Telephony is not available");
1864
- c(C);
1876
+ const E = new Error("Telephony is not available");
1877
+ c(E);
1865
1878
  };
1866
- T.once(E.DISCONNECTED, S);
1879
+ T.once(C.DISCONNECTED, S);
1867
1880
  const g = () => {
1868
- T.removeAllListeners(), T.once(E.DISCONNECTED, () => {
1881
+ T.removeAllListeners(), T.once(C.DISCONNECTED, () => {
1869
1882
  o();
1870
1883
  }), T.stop();
1871
1884
  };
1872
- T.once(E.CONNECTED, g), T.start();
1885
+ T.once(C.CONNECTED, g), T.start();
1873
1886
  });
1874
1887
  }
1875
1888
  }
@@ -1929,7 +1942,7 @@ class y {
1929
1942
  sipServerUrl: r,
1930
1943
  sipWebSocketServerURL: s
1931
1944
  });
1932
- const g = y.resolveAuthorizationUser(a, e), C = qe(r), m = C(g), I = new this.JsSIP.WebSocketInterface(s);
1945
+ const g = y.resolveAuthorizationUser(a, e), E = qe(r), m = E(g), I = new this.JsSIP.WebSocketInterface(s);
1933
1946
  return {
1934
1947
  configuration: {
1935
1948
  password: t,
@@ -1946,7 +1959,7 @@ class y {
1946
1959
  },
1947
1960
  helpers: {
1948
1961
  socket: I,
1949
- getSipServerUrl: C
1962
+ getSipServerUrl: E
1950
1963
  }
1951
1964
  };
1952
1965
  }
@@ -2102,13 +2115,13 @@ class pt {
2102
2115
  });
2103
2116
  });
2104
2117
  };
2105
- processConnect = async (e, t) => (this.events.trigger(E.CONNECT_STARTED, {}), It(e).catch((s) => {
2106
- throw this.events.trigger(E.CONNECT_PARAMETERS_RESOLVE_FAILED, s), s;
2107
- }).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(E.CONNECT_SUCCEEDED, {
2118
+ processConnect = async (e, t) => (this.events.trigger(C.CONNECT_STARTED, {}), It(e).then((s) => (this.events.trigger(C.CONNECT_PARAMETERS_RESOLVE_SUCCESS, s), s)).catch((s) => {
2119
+ throw this.events.trigger(C.CONNECT_PARAMETERS_RESOLVE_FAILED, s), s;
2120
+ }).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(C.CONNECT_SUCCEEDED, {
2108
2121
  ...s
2109
2122
  }), s)).catch((s) => {
2110
2123
  const i = s ?? new Error("Failed to connect to server");
2111
- throw this.events.trigger(E.CONNECT_FAILED, i), i;
2124
+ throw this.events.trigger(C.CONNECT_FAILED, i), i;
2112
2125
  }));
2113
2126
  }
2114
2127
  class mt {
@@ -2162,7 +2175,7 @@ class Mt {
2162
2175
  this.countInner = this.initialCount, this.finishAttempt();
2163
2176
  }
2164
2177
  }
2165
- class ft {
2178
+ class vt {
2166
2179
  connectionManager;
2167
2180
  interval;
2168
2181
  checkTelephonyByTimeout = void 0;
@@ -2207,7 +2220,7 @@ const Se = [
2207
2220
  "changed-attempt-status",
2208
2221
  "stop-attempts-by-error",
2209
2222
  "limit-reached-attempts"
2210
- ], vt = 15e3, Pt = 2;
2223
+ ], ft = 15e3, Pt = 2;
2211
2224
  class Ot {
2212
2225
  connectionManager;
2213
2226
  pingServerByTimeoutWithFailCalls;
@@ -2215,7 +2228,7 @@ class Ot {
2215
2228
  this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = Me(Pt, {
2216
2229
  whenPossibleRequest: async () => {
2217
2230
  },
2218
- requestInterval: vt,
2231
+ requestInterval: ft,
2219
2232
  request: async () => (d("ping"), this.connectionManager.ping().then(() => {
2220
2233
  d("ping success");
2221
2234
  }))
@@ -2309,7 +2322,7 @@ class Bt {
2309
2322
  callManager: s
2310
2323
  }, i) {
2311
2324
  const r = i?.onBeforeRetry ?? Ut, a = i?.canRetryOnError ?? Lt;
2312
- this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.events = new U(Se), this.checkTelephonyRequester = new ft({
2325
+ this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.events = new U(Se), this.checkTelephonyRequester = new vt({
2313
2326
  connectionManager: t,
2314
2327
  interval: i?.checkTelephonyRequestInterval ?? wt
2315
2328
  }), this.pingServerIfNotActiveCallRequester = new yt({
@@ -2320,7 +2333,7 @@ class Bt {
2320
2333
  callManager: s
2321
2334
  }), this.attemptsState = new Mt({
2322
2335
  onStatusChange: this.emitStatusChange
2323
- }), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new fe(
2336
+ }), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new ve(
2324
2337
  i?.timeoutBetweenAttempts ?? bt
2325
2338
  );
2326
2339
  }
@@ -2414,7 +2427,7 @@ class Bt {
2414
2427
  reconnect(e) {
2415
2428
  d("reconnect"), this.delayBetweenAttempts.request().then(async () => (d("reconnect: delayBetweenAttempts success"), this.cancelableRequestBeforeRetry.request())).then(async () => (d("reconnect: onBeforeRetry success"), this.connect(e))).catch((t) => {
2416
2429
  const s = t instanceof Error ? t : new Error("Failed to reconnect");
2417
- this.attemptsState.finishAttempt(), me(t) || ve(t) ? this.events.trigger(M.CANCELLED_ATTEMPTS, s) : this.events.trigger(M.FAILED_ALL_ATTEMPTS, s), d("reconnect: error", t);
2430
+ this.attemptsState.finishAttempt(), me(t) || fe(t) ? this.events.trigger(M.CANCELLED_ATTEMPTS, s) : this.events.trigger(M.FAILED_ALL_ATTEMPTS, s), d("reconnect: error", t);
2418
2431
  });
2419
2432
  }
2420
2433
  hasFailedOrDisconnectedConnection() {
@@ -2684,7 +2697,7 @@ const Ee = ["collected"], X = () => "performance" in window ? performance.now()
2684
2697
  c[1]?.getStats() ?? Promise.resolve(void 0)
2685
2698
  ]).then((g) => {
2686
2699
  const [
2687
- C,
2700
+ E,
2688
2701
  m,
2689
2702
  I,
2690
2703
  R,
@@ -2693,7 +2706,7 @@ const Ee = ["collected"], X = () => "performance" in window ? performance.now()
2693
2706
  ] = g;
2694
2707
  return {
2695
2708
  synchronizationSources: S,
2696
- audioSenderStats: C,
2709
+ audioSenderStats: E,
2697
2710
  videoSenderFirstStats: m,
2698
2711
  videoSenderSecondStats: I,
2699
2712
  audioReceiverStats: R,
@@ -2982,7 +2995,7 @@ class on {
2982
2995
  this.taskQueue.stop();
2983
2996
  }
2984
2997
  }
2985
- const Ne = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), cn = 1e6, f = (n) => n * cn, Re = f(0.06), Ie = f(4), dn = (n) => n <= 64 ? Re : n <= 128 ? f(0.12) : n <= 256 ? f(0.25) : n <= 384 ? f(0.32) : n <= 426 ? f(0.38) : n <= 640 ? f(0.5) : n <= 848 ? f(0.7) : n <= 1280 ? f(1) : n <= 1920 ? f(2) : Ie, hn = "av1", ln = (n) => Ne(n, hn), gn = 0.6, Y = (n, e) => ln(e) ? n * gn : n, un = (n) => Y(Re, n), Tn = (n) => Y(Ie, n), j = (n, e) => {
2998
+ const Ne = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), cn = 1e6, v = (n) => n * cn, Re = v(0.06), Ie = v(4), dn = (n) => n <= 64 ? Re : n <= 128 ? v(0.12) : n <= 256 ? v(0.25) : n <= 384 ? v(0.32) : n <= 426 ? v(0.38) : n <= 640 ? v(0.5) : n <= 848 ? v(0.7) : n <= 1280 ? v(1) : n <= 1920 ? v(2) : Ie, hn = "av1", ln = (n) => Ne(n, hn), gn = 0.6, Y = (n, e) => ln(e) ? n * gn : n, un = (n) => Y(Re, n), Tn = (n) => Y(Ie, n), j = (n, e) => {
2986
2999
  const t = dn(n);
2987
3000
  return Y(t, e);
2988
3001
  }, V = 1, Sn = ({
@@ -3045,14 +3058,14 @@ class Cn {
3045
3058
  async processSender(e, t) {
3046
3059
  const { mainCam: s, resolutionMainCam: i } = e;
3047
3060
  switch (s) {
3048
- case v.PAUSE_MAIN_CAM:
3061
+ case f.PAUSE_MAIN_CAM:
3049
3062
  return this.downgradeResolutionSender(t);
3050
- case v.RESUME_MAIN_CAM:
3063
+ case f.RESUME_MAIN_CAM:
3051
3064
  return this.setBitrateByTrackResolution(t);
3052
- case v.MAX_MAIN_CAM_RESOLUTION:
3065
+ case f.MAX_MAIN_CAM_RESOLUTION:
3053
3066
  return i !== void 0 ? this.setResolutionSender(i, t) : this.setBitrateByTrackResolution(t);
3054
- case v.ADMIN_STOP_MAIN_CAM:
3055
- case v.ADMIN_START_MAIN_CAM:
3067
+ case f.ADMIN_STOP_MAIN_CAM:
3068
+ case f.ADMIN_START_MAIN_CAM:
3056
3069
  case void 0:
3057
3070
  return this.setBitrateByTrackResolution(t);
3058
3071
  default:
@@ -3344,11 +3357,11 @@ class pn {
3344
3357
  this.startBalancingTimer && (clearTimeout(this.startBalancingTimer), this.startBalancingTimer = void 0);
3345
3358
  }
3346
3359
  }
3347
- const mn = 1e6, _n = Se.map((n) => `auto-connect:${n}`), Mn = ge.map((n) => `connection:${n}`), fn = ie.map((n) => `call:${n}`), vn = ne.map((n) => `api:${n}`), Pn = Ce.map((n) => `incoming-call:${n}`), On = he.map((n) => `presentation:${n}`), yn = Ee.map((n) => `stats:${n}`), Dn = pe.map((n) => `video-balancer:${n}`), bn = [
3360
+ const mn = 1e6, _n = Se.map((n) => `auto-connect:${n}`), Mn = ge.map((n) => `connection:${n}`), vn = ie.map((n) => `call:${n}`), fn = ne.map((n) => `api:${n}`), Pn = Ce.map((n) => `incoming-call:${n}`), On = he.map((n) => `presentation:${n}`), yn = Ee.map((n) => `stats:${n}`), Dn = pe.map((n) => `video-balancer:${n}`), bn = [
3348
3361
  ..._n,
3349
3362
  ...Mn,
3350
- ...fn,
3351
3363
  ...vn,
3364
+ ...fn,
3352
3365
  ...Pn,
3353
3366
  ...On,
3354
3367
  ...yn,
@@ -2,8 +2,8 @@ import { default as SipOperations, TParametersCheckTelephony } from './SipOperat
2
2
  import { RegisteredEvent, UA, UnRegisteredEvent, WebSocketInterface } from '@krivega/jssip';
3
3
  import { TGetServerUrl } from '../CallManager';
4
4
  import { TJsSIP } from '../types';
5
- import { TConnect, TParametersConnection, TSet, TConnectionConfigurationWithUa } from './ConnectionFlow';
6
- import { TEvents, TEventMap } from './eventNames';
5
+ import { TConnect, TConnectionConfigurationWithUa, TParametersConnection, TSet } from './ConnectionFlow';
6
+ import { TEventMap, TEvents } from './eventNames';
7
7
  type TConnectParameters = (() => Promise<TParametersConnection>) | TParametersConnection;
8
8
  type TConnectOptions = Parameters<TConnect>[1] & {
9
9
  hasReadyForConnection?: () => boolean;
@@ -46,7 +46,7 @@ export default class ConnectionManager {
46
46
  wait<T extends keyof TEventMap>(eventName: T): Promise<TEventMap[T]>;
47
47
  off<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): void;
48
48
  isConfigured(): boolean;
49
- getConnectionConfiguration: () => import('./ConfigurationManager').IConnectionConfiguration;
49
+ getConnectionConfiguration: () => import('./ConfigurationManager').IConnectionConfiguration | undefined;
50
50
  destroy(): void;
51
51
  getSipServerUrl: TGetServerUrl;
52
52
  readonly getUaProtected: () => UA;
@@ -1,7 +1,7 @@
1
1
  import { UA } from '@krivega/jssip';
2
2
  export interface IConnectionConfiguration {
3
- sipServerUrl?: string;
4
- displayName?: string;
3
+ sipServerUrl: string;
4
+ displayName: string;
5
5
  register?: boolean;
6
6
  user?: string;
7
7
  password?: string;
@@ -20,11 +20,11 @@ export default class ConfigurationManager {
20
20
  /**
21
21
  * Получает текущую конфигурацию подключения
22
22
  */
23
- get(): IConnectionConfiguration;
23
+ get(): IConnectionConfiguration | undefined;
24
24
  /**
25
25
  * Устанавливает конфигурацию подключения
26
26
  */
27
- set(data: IConnectionConfiguration): void;
27
+ set(data: IConnectionConfiguration | undefined): void;
28
28
  /**
29
29
  * Обновляет конфигурацию подключения
30
30
  */
@@ -11,7 +11,7 @@ export type TOptionsExtraHeaders = {
11
11
  export type TParametersConnection = TOptionsExtraHeaders & {
12
12
  sipServerUrl: string;
13
13
  sipWebSocketServerURL: string;
14
- displayName?: string;
14
+ displayName: string;
15
15
  register?: boolean;
16
16
  user?: string;
17
17
  password?: string;
@@ -23,8 +23,8 @@ export type TParametersConnection = TOptionsExtraHeaders & {
23
23
  connectionRecoveryMaxInterval?: number;
24
24
  };
25
25
  export type TConnectionConfiguration = {
26
- sipServerUrl?: string;
27
- displayName?: string;
26
+ sipServerUrl: string;
27
+ displayName: string;
28
28
  register?: boolean;
29
29
  user?: string;
30
30
  password?: string;
@@ -46,8 +46,8 @@ interface IDependencies {
46
46
  registrationManager: RegistrationManager;
47
47
  getUa: () => UA | undefined;
48
48
  setUa: (ua: UA | undefined) => void;
49
- getConnectionConfiguration: () => TConnectionConfiguration;
50
- setConnectionConfiguration: (config: TConnectionConfiguration) => void;
49
+ getConnectionConfiguration: () => TConnectionConfiguration | undefined;
50
+ setConnectionConfiguration: (config: TConnectionConfiguration | undefined) => void;
51
51
  updateConnectionConfiguration: <K extends keyof TConnectionConfiguration>(key: K, value: TConnectionConfiguration[K]) => void;
52
52
  setSipServerUrl: (getSipServerUrl: TGetServerUrl) => void;
53
53
  setSocket: (socket: WebSocketInterface) => void;
@@ -13,7 +13,7 @@ export type TCreateUAParameters = UAConfigurationParams & {
13
13
  };
14
14
  type TParametersCreateUaConfiguration = {
15
15
  sipWebSocketServerURL: string;
16
- displayName?: string;
16
+ displayName: string;
17
17
  sipServerUrl: string;
18
18
  user?: string;
19
19
  register?: boolean;
@@ -1,6 +1,6 @@
1
- import { ConnectingEventUA, ConnectedEvent, DisconnectEvent, RegisteredEvent, UnRegisteredEvent, RTCSessionEvent, IncomingMessageEvent, OutgoingMessageEvent, IncomingRequest } from '@krivega/jssip';
1
+ import { ConnectedEvent, ConnectingEventUA, DisconnectEvent, IncomingMessageEvent, IncomingRequest, OutgoingMessageEvent, RegisteredEvent, RTCSessionEvent, UnRegisteredEvent } from '@krivega/jssip';
2
2
  import { TypedEvents } from 'events-constructor';
3
- import { TConnectionConfigurationWithUa } from './ConnectionFlow';
3
+ import { TConnectionConfigurationWithUa, TParametersConnection } from './ConnectionFlow';
4
4
  export declare enum EEvent {
5
5
  CONNECTING = "connecting",
6
6
  CONNECTED = "connected",
@@ -15,10 +15,11 @@ export declare enum EEvent {
15
15
  CONNECT_STARTED = "connect-started",
16
16
  CONNECT_SUCCEEDED = "connect-succeeded",
17
17
  CONNECT_FAILED = "connect-failed",
18
+ CONNECT_PARAMETERS_RESOLVE_SUCCESS = "connect-parameters-resolve-success",
18
19
  CONNECT_PARAMETERS_RESOLVE_FAILED = "connect-parameters-resolve-failed"
19
20
  }
20
21
  export declare const UA_EVENT_NAMES: readonly ["connecting", "connected", "disconnected", "newRTCSession", "registered", "unregistered", "registrationFailed", "newMessage", "sipEvent"];
21
- export declare const EVENT_NAMES: readonly ["connecting", "connected", "disconnected", "newRTCSession", "registered", "unregistered", "registrationFailed", "newMessage", "sipEvent", "disconnecting", "connect-started", "connect-succeeded", "connect-failed", "connect-parameters-resolve-failed"];
22
+ export declare const EVENT_NAMES: readonly ["connecting", "connected", "disconnected", "newRTCSession", "registered", "unregistered", "registrationFailed", "newMessage", "sipEvent", "disconnecting", "connect-started", "connect-succeeded", "connect-failed", "connect-parameters-resolve-success", "connect-parameters-resolve-failed"];
22
23
  export type TEvent = (typeof EVENT_NAMES)[number];
23
24
  export type TEventMap = {
24
25
  connecting: ConnectingEventUA;
@@ -37,6 +38,7 @@ export type TEventMap = {
37
38
  'connect-started': Record<string, never>;
38
39
  'connect-succeeded': TConnectionConfigurationWithUa;
39
40
  'connect-failed': unknown;
41
+ 'connect-parameters-resolve-success': TParametersConnection;
40
42
  'connect-parameters-resolve-failed': unknown;
41
43
  };
42
44
  export type TEvents = TypedEvents<TEventMap>;
@@ -62,7 +62,7 @@ declare class SipConnector {
62
62
  ping: (body?: Parameters<ConnectionManager["ping"]>[0], extraHeaders?: Parameters<ConnectionManager["ping"]>[1]) => Promise<void>;
63
63
  checkTelephony: ConnectionManager['checkTelephony'];
64
64
  isConfigured: () => boolean;
65
- getConnectionConfiguration: () => import('../ConnectionManager/ConfigurationManager').IConnectionConfiguration;
65
+ getConnectionConfiguration: () => import('../ConnectionManager/ConfigurationManager').IConnectionConfiguration | undefined;
66
66
  getSipServerUrl: TGetServerUrl;
67
67
  startAutoConnect: AutoConnectorManager['start'];
68
68
  stopAutoConnect: AutoConnectorManager['stop'];
@@ -1,4 +1,4 @@
1
1
  import { Events } from 'events-constructor';
2
- export declare const EVENT_NAMES: readonly ("auto-connect:before-attempt" | "auto-connect:success" | "auto-connect:failed-all-attempts" | "auto-connect:cancelled-attempts" | "auto-connect:changed-attempt-status" | "auto-connect:stop-attempts-by-error" | "auto-connect:limit-reached-attempts" | "connection:connecting" | "connection:connected" | "connection:disconnected" | "connection:disconnecting" | "connection:newRTCSession" | "connection:registered" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "connection:connect-started" | "connection:connect-succeeded" | "connection:connect-failed" | "connection:connect-parameters-resolve-failed" | "call:newDTMF" | "call:peerconnection" | "call:connecting" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:failed" | "call:newInfo" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:sdp" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:presentation:start" | "call:presentation:started" | "call:presentation:end" | "call:presentation:ended" | "call:presentation:failed" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "call:call-status-changed" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-participants" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:conference:participant-token-issued" | "api:channels" | "api:enterRoom" | "api:shareState" | "api:main-cam-control" | "api:useLicense" | "api:admin-start-main-cam" | "api:admin-stop-main-cam" | "api:admin-start-mic" | "api:admin-stop-mic" | "api:admin-force-sync-media-state" | "api:availableSecondRemoteStream" | "api:notAvailableSecondRemoteStream" | "api:mustStopPresentation" | "api:newDTMF" | "api:restart" | "incoming-call:incomingCall" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:presentation:start" | "presentation:presentation:started" | "presentation:presentation:end" | "presentation:presentation:ended" | "presentation:presentation:failed" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated")[];
2
+ export declare const EVENT_NAMES: readonly ("auto-connect:before-attempt" | "auto-connect:success" | "auto-connect:failed-all-attempts" | "auto-connect:cancelled-attempts" | "auto-connect:changed-attempt-status" | "auto-connect:stop-attempts-by-error" | "auto-connect:limit-reached-attempts" | "connection:connecting" | "connection:connected" | "connection:disconnected" | "connection:disconnecting" | "connection:newRTCSession" | "connection:registered" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "connection:connect-started" | "connection:connect-succeeded" | "connection:connect-failed" | "connection:connect-parameters-resolve-success" | "connection:connect-parameters-resolve-failed" | "call:newDTMF" | "call:peerconnection" | "call:connecting" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:failed" | "call:newInfo" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:sdp" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:presentation:start" | "call:presentation:started" | "call:presentation:end" | "call:presentation:ended" | "call:presentation:failed" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "call:call-status-changed" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-participants" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:conference:participant-token-issued" | "api:channels" | "api:enterRoom" | "api:shareState" | "api:main-cam-control" | "api:useLicense" | "api:admin-start-main-cam" | "api:admin-stop-main-cam" | "api:admin-start-mic" | "api:admin-stop-mic" | "api:admin-force-sync-media-state" | "api:availableSecondRemoteStream" | "api:notAvailableSecondRemoteStream" | "api:mustStopPresentation" | "api:newDTMF" | "api:restart" | "incoming-call:incomingCall" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:presentation:start" | "presentation:presentation:started" | "presentation:presentation:end" | "presentation:presentation:ended" | "presentation:presentation:failed" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated")[];
3
3
  export type TEvent = (typeof EVENT_NAMES)[number];
4
4
  export type TEvents = Events<typeof EVENT_NAMES>;
@@ -4,6 +4,8 @@ export declare const displayName = "displayName";
4
4
  export declare const SIP_SERVER_URL = "SIP_SERVER_URL";
5
5
  export declare const SIP_WEB_SOCKET_SERVER_URL = "SIP_WEB_SOCKET_SERVER_URL";
6
6
  export declare const dataForConnectionWithoutAuthorizationWithoutDisplayName: {
7
+ displayName: string;
8
+ register: boolean;
7
9
  userAgent: string;
8
10
  sipServerUrl: string;
9
11
  sipWebSocketServerURL: string;
@@ -12,6 +14,7 @@ export declare const dataForConnectionWithAuthorization: {
12
14
  user: string;
13
15
  password: string;
14
16
  register: boolean;
17
+ displayName: string;
15
18
  userAgent: string;
16
19
  sipServerUrl: string;
17
20
  sipWebSocketServerURL: string;