module-develop-kit 0.5.10 → 0.5.12

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.
Files changed (165) hide show
  1. package/dist/commonjs-virtual-dir/Config.js +4 -0
  2. package/dist/commonjs-virtual-dir/Constants.js +5 -0
  3. package/dist/commonjs-virtual-dir/DTMF.js +4 -0
  4. package/dist/commonjs-virtual-dir/JsSIP.js +5 -0
  5. package/dist/commonjs-virtual-dir/Parser2.js +4 -0
  6. package/dist/commonjs-virtual-dir/Socket.js +4 -0
  7. package/dist/commonjs-virtual-dir/Utils.js +4 -0
  8. package/dist/commonjs-virtual-dir/___vite-browser-external.js +6 -0
  9. package/dist/commonjs-virtual-dir/__vite-browser-external.js +4 -0
  10. package/dist/commonjs-virtual-dir/_commonjs-dynamic-modules.js +6 -0
  11. package/dist/commonjs-virtual-dir/_commonjsHelpers.js +33 -0
  12. package/dist/commonjs-virtual-dir/_virtual_mobile-compatibility-detection.js +4 -0
  13. package/dist/commonjs-virtual-dir/_virtual_pc-compatibility-detection.js +4 -0
  14. package/dist/commonjs-virtual-dir/aes.js +4 -0
  15. package/dist/commonjs-virtual-dir/blowfish.js +4 -0
  16. package/dist/commonjs-virtual-dir/browser.js +4 -0
  17. package/dist/commonjs-virtual-dir/cipher-core.js +4 -0
  18. package/dist/commonjs-virtual-dir/core.js +4 -0
  19. package/dist/commonjs-virtual-dir/enc-base64.js +4 -0
  20. package/dist/commonjs-virtual-dir/enc-base64url.js +4 -0
  21. package/dist/commonjs-virtual-dir/enc-utf16.js +4 -0
  22. package/dist/commonjs-virtual-dir/events.js +4 -0
  23. package/dist/commonjs-virtual-dir/evpkdf.js +4 -0
  24. package/dist/commonjs-virtual-dir/format-hex.js +4 -0
  25. package/dist/commonjs-virtual-dir/grammar.js +4 -0
  26. package/dist/commonjs-virtual-dir/hmac.js +4 -0
  27. package/dist/commonjs-virtual-dir/index.js +5 -0
  28. package/dist/commonjs-virtual-dir/index2.js +5 -0
  29. package/dist/commonjs-virtual-dir/index3.js +7 -0
  30. package/dist/commonjs-virtual-dir/index4.js +7 -0
  31. package/dist/commonjs-virtual-dir/index5.js +4 -0
  32. package/dist/commonjs-virtual-dir/index6.js +4 -0
  33. package/dist/commonjs-virtual-dir/index7.js +4 -0
  34. package/dist/commonjs-virtual-dir/index8.js +4 -0
  35. package/dist/commonjs-virtual-dir/lib-typedarrays.js +4 -0
  36. package/dist/commonjs-virtual-dir/md5.js +4 -0
  37. package/dist/commonjs-virtual-dir/mode-cfb.js +4 -0
  38. package/dist/commonjs-virtual-dir/mode-ctr-gladman.js +4 -0
  39. package/dist/commonjs-virtual-dir/mode-ctr.js +4 -0
  40. package/dist/commonjs-virtual-dir/mode-ecb.js +4 -0
  41. package/dist/commonjs-virtual-dir/mode-ofb.js +4 -0
  42. package/dist/commonjs-virtual-dir/pad-ansix923.js +4 -0
  43. package/dist/commonjs-virtual-dir/pad-iso10126.js +4 -0
  44. package/dist/commonjs-virtual-dir/pad-iso97971.js +4 -0
  45. package/dist/commonjs-virtual-dir/pad-nopadding.js +4 -0
  46. package/dist/commonjs-virtual-dir/pad-zeropadding.js +4 -0
  47. package/dist/commonjs-virtual-dir/parser.js +4 -0
  48. package/dist/commonjs-virtual-dir/pbkdf2.js +4 -0
  49. package/dist/commonjs-virtual-dir/rabbit-legacy.js +4 -0
  50. package/dist/commonjs-virtual-dir/rabbit.js +4 -0
  51. package/dist/commonjs-virtual-dir/rc4.js +4 -0
  52. package/dist/commonjs-virtual-dir/ripemd160.js +4 -0
  53. package/dist/commonjs-virtual-dir/sha1.js +4 -0
  54. package/dist/commonjs-virtual-dir/sha224.js +4 -0
  55. package/dist/commonjs-virtual-dir/sha256.js +4 -0
  56. package/dist/commonjs-virtual-dir/sha3.js +4 -0
  57. package/dist/commonjs-virtual-dir/sha384.js +4 -0
  58. package/dist/commonjs-virtual-dir/sha512.js +4 -0
  59. package/dist/commonjs-virtual-dir/tripledes.js +4 -0
  60. package/dist/commonjs-virtual-dir/x64-core.js +4 -0
  61. package/dist/main.js +25 -0
  62. package/dist/src/outside-call/CallManagement.js +249 -0
  63. package/dist/src/outside-call/constants.js +42 -0
  64. package/dist/src/outside-call/index.js +74 -0
  65. package/dist/src/outside-call/utils.js +50 -0
  66. package/dist/src/shield/crypto.js +28 -0
  67. package/dist/src/shield/index.js +59 -0
  68. package/dist/src/shield/no-debugger.js +26 -0
  69. package/dist/src/utils/eventBus.js +59 -0
  70. package/dist/src/vite-plugins/getCompatibilityPlugins.js +13 -0
  71. package/dist/src/vite-plugins/vitePluginCompatibilityDetection.js +28 -0
  72. package/dist/vendor/base64-js/index.js +52 -0
  73. package/dist/vendor/crypto-js/aes.js +69 -0
  74. package/dist/vendor/crypto-js/blowfish.js +1131 -0
  75. package/dist/vendor/crypto-js/cipher-core.js +544 -0
  76. package/dist/vendor/crypto-js/core.js +508 -0
  77. package/dist/vendor/crypto-js/enc-base64.js +80 -0
  78. package/dist/vendor/crypto-js/enc-base64url.js +87 -0
  79. package/dist/vendor/crypto-js/enc-utf16.js +99 -0
  80. package/dist/vendor/crypto-js/evpkdf.js +70 -0
  81. package/dist/vendor/crypto-js/format-hex.js +53 -0
  82. package/dist/vendor/crypto-js/hmac.js +83 -0
  83. package/dist/vendor/crypto-js/index.js +49 -0
  84. package/dist/vendor/crypto-js/lib-typedarrays.js +27 -0
  85. package/dist/vendor/crypto-js/md5.js +71 -0
  86. package/dist/vendor/crypto-js/mode-cfb.js +36 -0
  87. package/dist/vendor/crypto-js/mode-ctr-gladman.js +45 -0
  88. package/dist/vendor/crypto-js/mode-ctr.js +28 -0
  89. package/dist/vendor/crypto-js/mode-ecb.js +27 -0
  90. package/dist/vendor/crypto-js/mode-ofb.js +26 -0
  91. package/dist/vendor/crypto-js/pad-ansix923.js +25 -0
  92. package/dist/vendor/crypto-js/pad-iso10126.js +25 -0
  93. package/dist/vendor/crypto-js/pad-iso97971.js +23 -0
  94. package/dist/vendor/crypto-js/pad-nopadding.js +21 -0
  95. package/dist/vendor/crypto-js/pad-zeropadding.js +28 -0
  96. package/dist/vendor/crypto-js/pbkdf2.js +74 -0
  97. package/dist/vendor/crypto-js/rabbit-legacy.js +73 -0
  98. package/dist/vendor/crypto-js/rabbit.js +75 -0
  99. package/dist/vendor/crypto-js/rc4.js +63 -0
  100. package/dist/vendor/crypto-js/ripemd160.js +398 -0
  101. package/dist/vendor/crypto-js/sha1.js +49 -0
  102. package/dist/vendor/crypto-js/sha224.js +36 -0
  103. package/dist/vendor/crypto-js/sha256.js +57 -0
  104. package/dist/vendor/crypto-js/sha3.js +116 -0
  105. package/dist/vendor/crypto-js/sha384.js +37 -0
  106. package/dist/vendor/crypto-js/sha512.js +147 -0
  107. package/dist/vendor/crypto-js/tripledes.js +729 -0
  108. package/dist/vendor/crypto-js/x64-core.js +235 -0
  109. package/dist/vendor/debug/src/browser.js +146 -0
  110. package/dist/vendor/debug/src/common.js +97 -0
  111. package/dist/vendor/events/events.js +216 -0
  112. package/dist/vendor/gm-crypt/index.js +10 -0
  113. package/dist/vendor/gm-crypt/src/crypt.js +60 -0
  114. package/dist/vendor/gm-crypt/src/sm4.js +513 -0
  115. package/dist/vendor/jsbn/index.js +714 -0
  116. package/dist/vendor/jssip/lib/Constants.js +180 -0
  117. package/dist/vendor/jssip/lib-es5/Config.js +263 -0
  118. package/dist/vendor/jssip/lib-es5/Constants.js +180 -0
  119. package/dist/vendor/jssip/lib-es5/Dialog/RequestSender.js +84 -0
  120. package/dist/vendor/jssip/lib-es5/Dialog.js +179 -0
  121. package/dist/vendor/jssip/lib-es5/DigestAuthentication.js +93 -0
  122. package/dist/vendor/jssip/lib-es5/Exceptions.js +131 -0
  123. package/dist/vendor/jssip/lib-es5/Grammar.js +1937 -0
  124. package/dist/vendor/jssip/lib-es5/JsSIP.js +37 -0
  125. package/dist/vendor/jssip/lib-es5/Logger.js +44 -0
  126. package/dist/vendor/jssip/lib-es5/Message.js +229 -0
  127. package/dist/vendor/jssip/lib-es5/NameAddrHeader.js +107 -0
  128. package/dist/vendor/jssip/lib-es5/Options.js +227 -0
  129. package/dist/vendor/jssip/lib-es5/Parser.js +202 -0
  130. package/dist/vendor/jssip/lib-es5/RTCSession/DTMF.js +175 -0
  131. package/dist/vendor/jssip/lib-es5/RTCSession/Info.js +149 -0
  132. package/dist/vendor/jssip/lib-es5/RTCSession/ReferNotifier.js +52 -0
  133. package/dist/vendor/jssip/lib-es5/RTCSession/ReferSubscriber.js +187 -0
  134. package/dist/vendor/jssip/lib-es5/RTCSession.js +1799 -0
  135. package/dist/vendor/jssip/lib-es5/Registrator.js +194 -0
  136. package/dist/vendor/jssip/lib-es5/RequestSender.js +99 -0
  137. package/dist/vendor/jssip/lib-es5/SIPMessage.js +623 -0
  138. package/dist/vendor/jssip/lib-es5/Socket.js +38 -0
  139. package/dist/vendor/jssip/lib-es5/Timers.js +25 -0
  140. package/dist/vendor/jssip/lib-es5/Transactions.js +481 -0
  141. package/dist/vendor/jssip/lib-es5/Transport.js +220 -0
  142. package/dist/vendor/jssip/lib-es5/UA.js +663 -0
  143. package/dist/vendor/jssip/lib-es5/URI.js +221 -0
  144. package/dist/vendor/jssip/lib-es5/Utils.js +263 -0
  145. package/dist/vendor/jssip/lib-es5/WebSocketInterface.js +120 -0
  146. package/dist/vendor/jssip/lib-es5/sanityCheck.js +170 -0
  147. package/dist/vendor/jssip/package.json.js +9 -0
  148. package/dist/vendor/ms/index.js +85 -0
  149. package/dist/vendor/sdp-transform/lib/grammar.js +449 -0
  150. package/dist/vendor/sdp-transform/lib/index.js +14 -0
  151. package/dist/vendor/sdp-transform/lib/parser.js +70 -0
  152. package/dist/vendor/sdp-transform/lib/writer.js +74 -0
  153. package/dist/vendor/sm-crypto/src/index.js +14 -0
  154. package/dist/vendor/sm-crypto/src/sm2/asn1.js +86 -0
  155. package/dist/vendor/sm-crypto/src/sm2/ec.js +205 -0
  156. package/dist/vendor/sm-crypto/src/sm2/index.js +114 -0
  157. package/dist/vendor/sm-crypto/src/sm2/sm3.js +71 -0
  158. package/dist/vendor/sm-crypto/src/sm2/utils.js +95 -0
  159. package/dist/vendor/sm-crypto/src/sm3/index.js +50 -0
  160. package/dist/vendor/sm-crypto/src/sm4/index.js +408 -0
  161. package/dist/vite-plugins/index.d.ts +1 -1
  162. package/dist/vite-plugins/index.js +6 -0
  163. package/package.json +6 -5
  164. package/dist/index.es.js +0 -18159
  165. package/dist/vite-plugins/index.es.js +0 -33
@@ -0,0 +1,37 @@
1
+ import f from "../package.json.js";
2
+ import { __require as p } from "./Constants.js";
3
+ import { __require as d } from "./Exceptions.js";
4
+ import { __require as c } from "./Utils.js";
5
+ import { __require as I } from "./UA.js";
6
+ import { __require as U } from "./URI.js";
7
+ import { __require as S } from "./NameAddrHeader.js";
8
+ import { __require as A } from "./Grammar.js";
9
+ import { __require as b } from "./WebSocketInterface.js";
10
+ import { __require as i } from "../../debug/src/browser.js";
11
+ var e, a;
12
+ function H() {
13
+ if (a) return e;
14
+ a = 1;
15
+ var r = f, o = p(), t = d(), m = c(), s = I(), u = U(), q = S(), _ = A(), n = b(), v = i()("JsSIP");
16
+ return v("version %s", r.version), e = {
17
+ C: o,
18
+ Exceptions: t,
19
+ Utils: m,
20
+ UA: s,
21
+ URI: u,
22
+ NameAddrHeader: q,
23
+ WebSocketInterface: n,
24
+ Grammar: _,
25
+ // Expose the debug module.
26
+ debug: i(),
27
+ get name() {
28
+ return r.title;
29
+ },
30
+ get version() {
31
+ return r.version;
32
+ }
33
+ }, e;
34
+ }
35
+ export {
36
+ H as __require
37
+ };
@@ -0,0 +1,44 @@
1
+ import { __require as f } from "../../debug/src/browser.js";
2
+ var u, i;
3
+ function _() {
4
+ if (i) return u;
5
+ i = 1;
6
+ function c(n, e) {
7
+ if (!(n instanceof e))
8
+ throw new TypeError("Cannot call a class as a function");
9
+ }
10
+ function l(n, e) {
11
+ for (var o = 0; o < e.length; o++) {
12
+ var r = e[o];
13
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n, r.key, r);
14
+ }
15
+ }
16
+ function s(n, e, o) {
17
+ return e && l(n.prototype, e), n;
18
+ }
19
+ var t = f(), a = "JsSIP";
20
+ return u = /* @__PURE__ */ function() {
21
+ function n(e) {
22
+ c(this, n), e ? (this._debug = t.default("".concat(a, ":").concat(e)), this._warn = t.default("".concat(a, ":WARN:").concat(e)), this._error = t.default("".concat(a, ":ERROR:").concat(e))) : (this._debug = t.default(a), this._warn = t.default("".concat(a, ":WARN")), this._error = t.default("".concat(a, ":ERROR"))), this._debug.log = console.info.bind(console), this._warn.log = console.warn.bind(console), this._error.log = console.error.bind(console);
23
+ }
24
+ return s(n, [{
25
+ key: "debug",
26
+ get: function() {
27
+ return this._debug;
28
+ }
29
+ }, {
30
+ key: "warn",
31
+ get: function() {
32
+ return this._warn;
33
+ }
34
+ }, {
35
+ key: "error",
36
+ get: function() {
37
+ return this._error;
38
+ }
39
+ }]), n;
40
+ }(), u;
41
+ }
42
+ export {
43
+ _ as __require
44
+ };
@@ -0,0 +1,229 @@
1
+ import { __require as D } from "../../events/events.js";
2
+ import { __require as G } from "./Logger.js";
3
+ import { __require as z } from "./Constants.js";
4
+ import { __require as L } from "./SIPMessage.js";
5
+ import { __require as $ } from "./Utils.js";
6
+ import { __require as J } from "./RequestSender.js";
7
+ import { __require as Q } from "./Exceptions.js";
8
+ import { __require as B } from "./URI.js";
9
+ var v, w;
10
+ function te() {
11
+ if (w) return v;
12
+ w = 1;
13
+ function c(n) {
14
+ "@babel/helpers - typeof";
15
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? c = function(o) {
16
+ return typeof o;
17
+ } : c = function(o) {
18
+ return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
19
+ }, c(n);
20
+ }
21
+ function q(n, r) {
22
+ if (!(n instanceof r))
23
+ throw new TypeError("Cannot call a class as a function");
24
+ }
25
+ function R(n, r) {
26
+ for (var o = 0; o < r.length; o++) {
27
+ var t = r[o];
28
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
29
+ }
30
+ }
31
+ function S(n, r, o) {
32
+ return r && R(n.prototype, r), n;
33
+ }
34
+ function T(n, r) {
35
+ if (typeof r != "function" && r !== null)
36
+ throw new TypeError("Super expression must either be null or a function");
37
+ n.prototype = Object.create(r && r.prototype, { constructor: { value: n, writable: !0, configurable: !0 } }), r && l(n, r);
38
+ }
39
+ function l(n, r) {
40
+ return l = Object.setPrototypeOf || function(t, e) {
41
+ return t.__proto__ = e, t;
42
+ }, l(n, r);
43
+ }
44
+ function O(n) {
45
+ var r = P();
46
+ return function() {
47
+ var t = f(n), e;
48
+ if (r) {
49
+ var i = f(this).constructor;
50
+ e = Reflect.construct(t, arguments, i);
51
+ } else
52
+ e = t.apply(this, arguments);
53
+ return M(this, e);
54
+ };
55
+ }
56
+ function M(n, r) {
57
+ return r && (c(r) === "object" || typeof r == "function") ? r : k(n);
58
+ }
59
+ function k(n) {
60
+ if (n === void 0)
61
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
62
+ return n;
63
+ }
64
+ function P() {
65
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
66
+ if (typeof Proxy == "function") return !0;
67
+ try {
68
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
69
+ })), !0;
70
+ } catch {
71
+ return !1;
72
+ }
73
+ }
74
+ function f(n) {
75
+ return f = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {
76
+ return o.__proto__ || Object.getPrototypeOf(o);
77
+ }, f(n);
78
+ }
79
+ var x = D().EventEmitter, I = G(), d = z(), N = L(), u = $(), j = J(), E = Q(), H = B(), _ = new I("Message");
80
+ return v = /* @__PURE__ */ function(n) {
81
+ T(o, n);
82
+ var r = O(o);
83
+ function o(t) {
84
+ var e;
85
+ return q(this, o), e = r.call(this), e._ua = t, e._request = null, e._closed = !1, e._direction = null, e._local_identity = null, e._remote_identity = null, e._is_replied = !1, e._data = {}, e;
86
+ }
87
+ return S(o, [{
88
+ key: "send",
89
+ value: function(e, i) {
90
+ var s = this, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, p = e;
91
+ if (e === void 0 || i === void 0)
92
+ throw new TypeError("Not enough arguments");
93
+ if (e = this._ua.normalizeTarget(e), !e)
94
+ throw new TypeError("Invalid target: ".concat(p));
95
+ var h = u.cloneArray(a.extraHeaders), y = u.cloneObject(a.eventHandlers), U = a.contentType || "text/plain", m = {};
96
+ a.fromUserName && (m.from_uri = new H("sip", a.fromUserName, this._ua.configuration.uri.host), h.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))), a.fromDisplayName && (m.from_display_name = a.fromDisplayName);
97
+ for (var g in y)
98
+ Object.prototype.hasOwnProperty.call(y, g) && this.on(g, y[g]);
99
+ h.push("Content-Type: ".concat(U)), this._request = new N.OutgoingRequest(d.MESSAGE, e, this._ua, m, h), i && (this._request.body = i);
100
+ var A = new j(this._ua, this._request, {
101
+ onRequestTimeout: function() {
102
+ s._onRequestTimeout();
103
+ },
104
+ onTransportError: function() {
105
+ s._onTransportError();
106
+ },
107
+ onReceiveResponse: function(C) {
108
+ s._receiveResponse(C);
109
+ }
110
+ });
111
+ this._newMessage("local", this._request), A.send();
112
+ }
113
+ }, {
114
+ key: "init_incoming",
115
+ value: function(e) {
116
+ this._request = e, this._newMessage("remote", e), this._is_replied || (this._is_replied = !0, e.reply(200)), this._close();
117
+ }
118
+ /**
119
+ * Accept the incoming Message
120
+ * Only valid for incoming Messages
121
+ */
122
+ }, {
123
+ key: "accept",
124
+ value: function() {
125
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = u.cloneArray(e.extraHeaders), s = e.body;
126
+ if (this._direction !== "incoming")
127
+ throw new E.NotSupportedError('"accept" not supported for outgoing Message');
128
+ if (this._is_replied)
129
+ throw new Error("incoming Message already replied");
130
+ this._is_replied = !0, this._request.reply(200, null, i, s);
131
+ }
132
+ /**
133
+ * Reject the incoming Message
134
+ * Only valid for incoming Messages
135
+ */
136
+ }, {
137
+ key: "reject",
138
+ value: function() {
139
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = e.status_code || 480, s = e.reason_phrase, a = u.cloneArray(e.extraHeaders), p = e.body;
140
+ if (this._direction !== "incoming")
141
+ throw new E.NotSupportedError('"reject" not supported for outgoing Message');
142
+ if (this._is_replied)
143
+ throw new Error("incoming Message already replied");
144
+ if (i < 300 || i >= 700)
145
+ throw new TypeError("Invalid status_code: ".concat(i));
146
+ this._is_replied = !0, this._request.reply(i, s, a, p);
147
+ }
148
+ }, {
149
+ key: "_receiveResponse",
150
+ value: function(e) {
151
+ if (!this._closed)
152
+ switch (!0) {
153
+ case /^1[0-9]{2}$/.test(e.status_code):
154
+ break;
155
+ case /^2[0-9]{2}$/.test(e.status_code):
156
+ this._succeeded("remote", e);
157
+ break;
158
+ default: {
159
+ var i = u.sipErrorCause(e.status_code);
160
+ this._failed("remote", e, i);
161
+ break;
162
+ }
163
+ }
164
+ }
165
+ }, {
166
+ key: "_onRequestTimeout",
167
+ value: function() {
168
+ this._closed || this._failed("system", null, d.causes.REQUEST_TIMEOUT);
169
+ }
170
+ }, {
171
+ key: "_onTransportError",
172
+ value: function() {
173
+ this._closed || this._failed("system", null, d.causes.CONNECTION_ERROR);
174
+ }
175
+ }, {
176
+ key: "_close",
177
+ value: function() {
178
+ this._closed = !0, this._ua.destroyMessage(this);
179
+ }
180
+ /**
181
+ * Internal Callbacks
182
+ */
183
+ }, {
184
+ key: "_newMessage",
185
+ value: function(e, i) {
186
+ e === "remote" ? (this._direction = "incoming", this._local_identity = i.to, this._remote_identity = i.from) : e === "local" && (this._direction = "outgoing", this._local_identity = i.from, this._remote_identity = i.to), this._ua.newMessage(this, {
187
+ originator: e,
188
+ message: this,
189
+ request: i
190
+ });
191
+ }
192
+ }, {
193
+ key: "_failed",
194
+ value: function(e, i, s) {
195
+ _.debug("MESSAGE failed"), this._close(), _.debug('emit "failed"'), this.emit("failed", {
196
+ originator: e,
197
+ response: i || null,
198
+ cause: s
199
+ });
200
+ }
201
+ }, {
202
+ key: "_succeeded",
203
+ value: function(e, i) {
204
+ _.debug("MESSAGE succeeded"), this._close(), _.debug('emit "succeeded"'), this.emit("succeeded", {
205
+ originator: e,
206
+ response: i
207
+ });
208
+ }
209
+ }, {
210
+ key: "direction",
211
+ get: function() {
212
+ return this._direction;
213
+ }
214
+ }, {
215
+ key: "local_identity",
216
+ get: function() {
217
+ return this._local_identity;
218
+ }
219
+ }, {
220
+ key: "remote_identity",
221
+ get: function() {
222
+ return this._remote_identity;
223
+ }
224
+ }]), o;
225
+ }(x), v;
226
+ }
227
+ export {
228
+ te as __require
229
+ };
@@ -0,0 +1,107 @@
1
+ import { __require as _ } from "./URI.js";
2
+ import { __require as h } from "./Grammar.js";
3
+ var i, o;
4
+ function p() {
5
+ if (o) return i;
6
+ o = 1;
7
+ function l(a, r) {
8
+ if (!(a instanceof r))
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ function s(a, r) {
12
+ for (var e = 0; e < r.length; e++) {
13
+ var t = r[e];
14
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(a, t.key, t);
15
+ }
16
+ }
17
+ function u(a, r, e) {
18
+ return r && s(a.prototype, r), e && s(a, e), a;
19
+ }
20
+ var f = _(), c = h();
21
+ return i = /* @__PURE__ */ function() {
22
+ u(a, null, [{
23
+ key: "parse",
24
+ /**
25
+ * Parse the given string and returns a NameAddrHeader instance or undefined if
26
+ * it is an invalid NameAddrHeader.
27
+ */
28
+ value: function(e) {
29
+ if (e = c.parse(e, "Name_Addr_Header"), e !== -1)
30
+ return e;
31
+ }
32
+ }]);
33
+ function a(r, e, t) {
34
+ if (l(this, a), !r || !(r instanceof f))
35
+ throw new TypeError('missing or invalid "uri" parameter');
36
+ this._uri = r, this._parameters = {}, this.display_name = e;
37
+ for (var n in t)
38
+ Object.prototype.hasOwnProperty.call(t, n) && this.setParam(n, t[n]);
39
+ }
40
+ return u(a, [{
41
+ key: "setParam",
42
+ value: function(e, t) {
43
+ e && (this._parameters[e.toLowerCase()] = typeof t > "u" || t === null ? null : t.toString());
44
+ }
45
+ }, {
46
+ key: "getParam",
47
+ value: function(e) {
48
+ if (e)
49
+ return this._parameters[e.toLowerCase()];
50
+ }
51
+ }, {
52
+ key: "hasParam",
53
+ value: function(e) {
54
+ if (e)
55
+ return this._parameters.hasOwnProperty(e.toLowerCase()) && !0 || !1;
56
+ }
57
+ }, {
58
+ key: "deleteParam",
59
+ value: function(e) {
60
+ if (e = e.toLowerCase(), this._parameters.hasOwnProperty(e)) {
61
+ var t = this._parameters[e];
62
+ return delete this._parameters[e], t;
63
+ }
64
+ }
65
+ }, {
66
+ key: "clearParams",
67
+ value: function() {
68
+ this._parameters = {};
69
+ }
70
+ }, {
71
+ key: "clone",
72
+ value: function() {
73
+ return new a(this._uri.clone(), this._display_name, JSON.parse(JSON.stringify(this._parameters)));
74
+ }
75
+ }, {
76
+ key: "_quote",
77
+ value: function(e) {
78
+ return e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
79
+ }
80
+ }, {
81
+ key: "toString",
82
+ value: function() {
83
+ var e = this._display_name ? '"'.concat(this._quote(this._display_name), '" ') : "";
84
+ e += "<".concat(this._uri.toString(), ">");
85
+ for (var t in this._parameters)
86
+ Object.prototype.hasOwnProperty.call(this._parameters, t) && (e += ";".concat(t), this._parameters[t] !== null && (e += "=".concat(this._parameters[t])));
87
+ return e;
88
+ }
89
+ }, {
90
+ key: "uri",
91
+ get: function() {
92
+ return this._uri;
93
+ }
94
+ }, {
95
+ key: "display_name",
96
+ get: function() {
97
+ return this._display_name;
98
+ },
99
+ set: function(e) {
100
+ this._display_name = e === 0 ? "0" : e;
101
+ }
102
+ }]), a;
103
+ }(), i;
104
+ }
105
+ export {
106
+ p as __require
107
+ };
@@ -0,0 +1,227 @@
1
+ import { __require as M } from "../../events/events.js";
2
+ import { __require as U } from "./Logger.js";
3
+ import { __require as z } from "./Constants.js";
4
+ import { __require as D } from "./SIPMessage.js";
5
+ import { __require as L } from "./Utils.js";
6
+ import { __require as $ } from "./RequestSender.js";
7
+ import { __require as J } from "./Exceptions.js";
8
+ var m, b;
9
+ function X() {
10
+ if (b) return m;
11
+ b = 1;
12
+ function c(n) {
13
+ "@babel/helpers - typeof";
14
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? c = function(o) {
15
+ return typeof o;
16
+ } : c = function(o) {
17
+ return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
18
+ }, c(n);
19
+ }
20
+ function w(n, r) {
21
+ if (!(n instanceof r))
22
+ throw new TypeError("Cannot call a class as a function");
23
+ }
24
+ function q(n, r) {
25
+ for (var o = 0; o < r.length; o++) {
26
+ var t = r[o];
27
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
28
+ }
29
+ }
30
+ function R(n, r, o) {
31
+ return r && q(n.prototype, r), n;
32
+ }
33
+ function T(n, r) {
34
+ if (typeof r != "function" && r !== null)
35
+ throw new TypeError("Super expression must either be null or a function");
36
+ n.prototype = Object.create(r && r.prototype, { constructor: { value: n, writable: !0, configurable: !0 } }), r && l(n, r);
37
+ }
38
+ function l(n, r) {
39
+ return l = Object.setPrototypeOf || function(t, e) {
40
+ return t.__proto__ = e, t;
41
+ }, l(n, r);
42
+ }
43
+ function E(n) {
44
+ var r = P();
45
+ return function() {
46
+ var t = _(n), e;
47
+ if (r) {
48
+ var i = _(this).constructor;
49
+ e = Reflect.construct(t, arguments, i);
50
+ } else
51
+ e = t.apply(this, arguments);
52
+ return S(this, e);
53
+ };
54
+ }
55
+ function S(n, r) {
56
+ return r && (c(r) === "object" || typeof r == "function") ? r : k(n);
57
+ }
58
+ function k(n) {
59
+ if (n === void 0)
60
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
61
+ return n;
62
+ }
63
+ function P() {
64
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
65
+ if (typeof Proxy == "function") return !0;
66
+ try {
67
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
68
+ })), !0;
69
+ } catch {
70
+ return !1;
71
+ }
72
+ }
73
+ function _(n) {
74
+ return _ = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {
75
+ return o.__proto__ || Object.getPrototypeOf(o);
76
+ }, _(n);
77
+ }
78
+ var I = M().EventEmitter, x = U(), p = z(), N = D(), u = L(), j = $(), v = J(), f = new x("Options");
79
+ return m = /* @__PURE__ */ function(n) {
80
+ T(o, n);
81
+ var r = E(o);
82
+ function o(t) {
83
+ var e;
84
+ return w(this, o), e = r.call(this), e._ua = t, e._request = null, e._closed = !1, e._direction = null, e._local_identity = null, e._remote_identity = null, e._is_replied = !1, e._data = {}, e;
85
+ }
86
+ return R(o, [{
87
+ key: "send",
88
+ value: function(e, i) {
89
+ var s = this, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, d = e;
90
+ if (e === void 0)
91
+ throw new TypeError("A target is required for OPTIONS");
92
+ if (e = this._ua.normalizeTarget(e), !e)
93
+ throw new TypeError("Invalid target: ".concat(d));
94
+ var g = u.cloneArray(a.extraHeaders), h = u.cloneObject(a.eventHandlers), H = a.contentType || "application/sdp";
95
+ for (var y in h)
96
+ Object.prototype.hasOwnProperty.call(h, y) && this.on(y, h[y]);
97
+ g.push("Content-Type: ".concat(H)), this._request = new N.OutgoingRequest(p.OPTIONS, e, this._ua, null, g), i && (this._request.body = i);
98
+ var C = new j(this._ua, this._request, {
99
+ onRequestTimeout: function() {
100
+ s._onRequestTimeout();
101
+ },
102
+ onTransportError: function() {
103
+ s._onTransportError();
104
+ },
105
+ onReceiveResponse: function(A) {
106
+ s._receiveResponse(A);
107
+ }
108
+ });
109
+ this._newOptions("local", this._request), C.send();
110
+ }
111
+ }, {
112
+ key: "init_incoming",
113
+ value: function(e) {
114
+ this._request = e, this._newOptions("remote", e), this._is_replied || (this._is_replied = !0, e.reply(200)), this._close();
115
+ }
116
+ /**
117
+ * Accept the incoming Options
118
+ * Only valid for incoming Options
119
+ */
120
+ }, {
121
+ key: "accept",
122
+ value: function() {
123
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = u.cloneArray(e.extraHeaders), s = e.body;
124
+ if (this._direction !== "incoming")
125
+ throw new v.NotSupportedError('"accept" not supported for outgoing Options');
126
+ if (this._is_replied)
127
+ throw new Error("incoming Options already replied");
128
+ this._is_replied = !0, this._request.reply(200, null, i, s);
129
+ }
130
+ /**
131
+ * Reject the incoming Options
132
+ * Only valid for incoming Options
133
+ */
134
+ }, {
135
+ key: "reject",
136
+ value: function() {
137
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = e.status_code || 480, s = e.reason_phrase, a = u.cloneArray(e.extraHeaders), d = e.body;
138
+ if (this._direction !== "incoming")
139
+ throw new v.NotSupportedError('"reject" not supported for outgoing Options');
140
+ if (this._is_replied)
141
+ throw new Error("incoming Options already replied");
142
+ if (i < 300 || i >= 700)
143
+ throw new TypeError("Invalid status_code: ".concat(i));
144
+ this._is_replied = !0, this._request.reply(i, s, a, d);
145
+ }
146
+ }, {
147
+ key: "_receiveResponse",
148
+ value: function(e) {
149
+ if (!this._closed)
150
+ switch (!0) {
151
+ case /^1[0-9]{2}$/.test(e.status_code):
152
+ break;
153
+ case /^2[0-9]{2}$/.test(e.status_code):
154
+ this._succeeded("remote", e);
155
+ break;
156
+ default: {
157
+ var i = u.sipErrorCause(e.status_code);
158
+ this._failed("remote", e, i);
159
+ break;
160
+ }
161
+ }
162
+ }
163
+ }, {
164
+ key: "_onRequestTimeout",
165
+ value: function() {
166
+ this._closed || this._failed("system", null, p.causes.REQUEST_TIMEOUT);
167
+ }
168
+ }, {
169
+ key: "_onTransportError",
170
+ value: function() {
171
+ this._closed || this._failed("system", null, p.causes.CONNECTION_ERROR);
172
+ }
173
+ }, {
174
+ key: "_close",
175
+ value: function() {
176
+ this._closed = !0, this._ua.destroyMessage(this);
177
+ }
178
+ /**
179
+ * Internal Callbacks
180
+ */
181
+ }, {
182
+ key: "_newOptions",
183
+ value: function(e, i) {
184
+ e === "remote" ? (this._direction = "incoming", this._local_identity = i.to, this._remote_identity = i.from) : e === "local" && (this._direction = "outgoing", this._local_identity = i.from, this._remote_identity = i.to), this._ua.newOptions(this, {
185
+ originator: e,
186
+ message: this,
187
+ request: i
188
+ });
189
+ }
190
+ }, {
191
+ key: "_failed",
192
+ value: function(e, i, s) {
193
+ f.debug("OPTIONS failed"), this._close(), f.debug('emit "failed"'), this.emit("failed", {
194
+ originator: e,
195
+ response: i || null,
196
+ cause: s
197
+ });
198
+ }
199
+ }, {
200
+ key: "_succeeded",
201
+ value: function(e, i) {
202
+ f.debug("OPTIONS succeeded"), this._close(), f.debug('emit "succeeded"'), this.emit("succeeded", {
203
+ originator: e,
204
+ response: i
205
+ });
206
+ }
207
+ }, {
208
+ key: "direction",
209
+ get: function() {
210
+ return this._direction;
211
+ }
212
+ }, {
213
+ key: "local_identity",
214
+ get: function() {
215
+ return this._local_identity;
216
+ }
217
+ }, {
218
+ key: "remote_identity",
219
+ get: function() {
220
+ return this._remote_identity;
221
+ }
222
+ }]), o;
223
+ }(I), m;
224
+ }
225
+ export {
226
+ X as __require
227
+ };