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,623 @@
1
+ import { __require as ee } from "../../sdp-transform/lib/index.js";
2
+ import { __require as te } from "./Logger.js";
3
+ import { __require as re } from "./Constants.js";
4
+ import { __require as ne } from "./Utils.js";
5
+ import { __require as ae } from "./NameAddrHeader.js";
6
+ import { __require as ie } from "./Grammar.js";
7
+ var P, j;
8
+ function fe() {
9
+ if (j) return P;
10
+ j = 1;
11
+ function H(a) {
12
+ "@babel/helpers - typeof";
13
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? H = function(e) {
14
+ return typeof e;
15
+ } : H = function(e) {
16
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
17
+ }, H(a);
18
+ }
19
+ function E(a, n) {
20
+ if (typeof n != "function" && n !== null)
21
+ throw new TypeError("Super expression must either be null or a function");
22
+ a.prototype = Object.create(n && n.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), n && q(a, n);
23
+ }
24
+ function q(a, n) {
25
+ return q = Object.setPrototypeOf || function(r, t) {
26
+ return r.__proto__ = t, r;
27
+ }, q(a, n);
28
+ }
29
+ function R(a) {
30
+ var n = U();
31
+ return function() {
32
+ var r = S(a), t;
33
+ if (n) {
34
+ var i = S(this).constructor;
35
+ t = Reflect.construct(r, arguments, i);
36
+ } else
37
+ t = r.apply(this, arguments);
38
+ return z(this, t);
39
+ };
40
+ }
41
+ function z(a, n) {
42
+ return n && (H(n) === "object" || typeof n == "function") ? n : N(a);
43
+ }
44
+ function N(a) {
45
+ if (a === void 0)
46
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
47
+ return a;
48
+ }
49
+ function U() {
50
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
51
+ if (typeof Proxy == "function") return !0;
52
+ try {
53
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
54
+ })), !0;
55
+ } catch {
56
+ return !1;
57
+ }
58
+ }
59
+ function S(a) {
60
+ return S = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
61
+ return e.__proto__ || Object.getPrototypeOf(e);
62
+ }, S(a);
63
+ }
64
+ function g(a, n) {
65
+ var e;
66
+ if (typeof Symbol > "u" || a[Symbol.iterator] == null) {
67
+ if (Array.isArray(a) || (e = F(a)) || n) {
68
+ e && (a = e);
69
+ var r = 0, t = function() {
70
+ };
71
+ return { s: t, n: function() {
72
+ return r >= a.length ? { done: !0 } : { done: !1, value: a[r++] };
73
+ }, e: function(f) {
74
+ throw f;
75
+ }, f: t };
76
+ }
77
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
78
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
79
+ }
80
+ var i = !0, u = !1, s;
81
+ return { s: function() {
82
+ e = a[Symbol.iterator]();
83
+ }, n: function() {
84
+ var f = e.next();
85
+ return i = f.done, f;
86
+ }, e: function(f) {
87
+ u = !0, s = f;
88
+ }, f: function() {
89
+ try {
90
+ !i && e.return != null && e.return();
91
+ } finally {
92
+ if (u) throw s;
93
+ }
94
+ } };
95
+ }
96
+ function F(a, n) {
97
+ if (a) {
98
+ if (typeof a == "string") return T(a, n);
99
+ var e = Object.prototype.toString.call(a).slice(8, -1);
100
+ if (e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set") return Array.from(a);
101
+ if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return T(a, n);
102
+ }
103
+ }
104
+ function T(a, n) {
105
+ (n == null || n > a.length) && (n = a.length);
106
+ for (var e = 0, r = new Array(n); e < n; e++)
107
+ r[e] = a[e];
108
+ return r;
109
+ }
110
+ function m(a, n) {
111
+ if (!(a instanceof n))
112
+ throw new TypeError("Cannot call a class as a function");
113
+ }
114
+ function V(a, n) {
115
+ for (var e = 0; e < n.length; e++) {
116
+ var r = n[e];
117
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(a, r.key, r);
118
+ }
119
+ }
120
+ function w(a, n, e) {
121
+ return n && V(a.prototype, n), a;
122
+ }
123
+ var k = ee(), G = te(), d = re(), l = ne(), x = ae(), W = ie(), A = new G("SIPMessage"), D = /* @__PURE__ */ function() {
124
+ function a(n, e, r, t, i, u) {
125
+ if (m(this, a), !n || !e || !r)
126
+ return null;
127
+ t = t || {}, this.ua = r, this.headers = {}, this.method = n, this.ruri = e, this.body = u, this.extraHeaders = l.cloneArray(i), this.ua.configuration.extra_headers && (this.extraHeaders = this.extraHeaders.concat(this.ua.configuration.extra_headers)), t.route_set ? this.setHeader("route", t.route_set) : r.configuration.use_preloaded_route && this.setHeader("route", "<".concat(r.transport.sip_uri, ";lr>")), this.setHeader("via", ""), this.setHeader("max-forwards", d.MAX_FORWARDS);
128
+ var s = t.to_uri || e, c = t.to_tag ? {
129
+ tag: t.to_tag
130
+ } : null, f = typeof t.to_display_name < "u" ? t.to_display_name : null;
131
+ this.to = new x(s, f, c), this.setHeader("to", this.to.toString());
132
+ var h = t.from_uri || r.configuration.uri, v = {
133
+ tag: t.from_tag || l.newTag()
134
+ }, o;
135
+ typeof t.from_display_name < "u" ? o = t.from_display_name : r.configuration.display_name ? o = r.configuration.display_name : o = null, this.from = new x(h, o, v), this.setHeader("from", this.from.toString());
136
+ var p = t.call_id || r.configuration.jssip_id + l.createRandomToken(15);
137
+ this.call_id = p, this.setHeader("call-id", p);
138
+ var y = t.cseq || Math.floor(Math.random() * 1e4);
139
+ this.cseq = y, this.setHeader("cseq", "".concat(y, " ").concat(n));
140
+ }
141
+ return w(a, [{
142
+ key: "setHeader",
143
+ value: function(e, r) {
144
+ for (var t = new RegExp("^\\s*".concat(e, "\\s*:"), "i"), i = 0; i < this.extraHeaders.length; i++)
145
+ t.test(this.extraHeaders[i]) && this.extraHeaders.splice(i, 1);
146
+ this.headers[l.headerize(e)] = Array.isArray(r) ? r : [r];
147
+ }
148
+ /**
149
+ * Get the value of the given header name at the given position.
150
+ * -param {String} name header name
151
+ * -returns {String|undefined} Returns the specified header, null if header doesn't exist.
152
+ */
153
+ }, {
154
+ key: "getHeader",
155
+ value: function(e) {
156
+ var r = this.headers[l.headerize(e)];
157
+ if (r) {
158
+ if (r[0])
159
+ return r[0];
160
+ } else {
161
+ var t = new RegExp("^\\s*".concat(e, "\\s*:"), "i"), i = g(this.extraHeaders), u;
162
+ try {
163
+ for (i.s(); !(u = i.n()).done; ) {
164
+ var s = u.value;
165
+ if (t.test(s))
166
+ return s.substring(s.indexOf(":") + 1).trim();
167
+ }
168
+ } catch (c) {
169
+ i.e(c);
170
+ } finally {
171
+ i.f();
172
+ }
173
+ }
174
+ }
175
+ /**
176
+ * Get the header/s of the given name.
177
+ * -param {String} name header name
178
+ * -returns {Array} Array with all the headers of the specified name.
179
+ */
180
+ }, {
181
+ key: "getHeaders",
182
+ value: function(e) {
183
+ var r = this.headers[l.headerize(e)], t = [];
184
+ if (r) {
185
+ var i = g(r), u;
186
+ try {
187
+ for (i.s(); !(u = i.n()).done; ) {
188
+ var s = u.value;
189
+ t.push(s);
190
+ }
191
+ } catch (o) {
192
+ i.e(o);
193
+ } finally {
194
+ i.f();
195
+ }
196
+ return t;
197
+ } else {
198
+ var c = new RegExp("^\\s*".concat(e, "\\s*:"), "i"), f = g(this.extraHeaders), h;
199
+ try {
200
+ for (f.s(); !(h = f.n()).done; ) {
201
+ var v = h.value;
202
+ c.test(v) && t.push(v.substring(v.indexOf(":") + 1).trim());
203
+ }
204
+ } catch (o) {
205
+ f.e(o);
206
+ } finally {
207
+ f.f();
208
+ }
209
+ return t;
210
+ }
211
+ }
212
+ /**
213
+ * Verify the existence of the given header.
214
+ * -param {String} name header name
215
+ * -returns {boolean} true if header with given name exists, false otherwise
216
+ */
217
+ }, {
218
+ key: "hasHeader",
219
+ value: function(e) {
220
+ if (this.headers[l.headerize(e)])
221
+ return !0;
222
+ var r = new RegExp("^\\s*".concat(e, "\\s*:"), "i"), t = g(this.extraHeaders), i;
223
+ try {
224
+ for (t.s(); !(i = t.n()).done; ) {
225
+ var u = i.value;
226
+ if (r.test(u))
227
+ return !0;
228
+ }
229
+ } catch (s) {
230
+ t.e(s);
231
+ } finally {
232
+ t.f();
233
+ }
234
+ return !1;
235
+ }
236
+ /**
237
+ * Parse the current body as a SDP and store the resulting object
238
+ * into this.sdp.
239
+ * -param {Boolean} force: Parse even if this.sdp already exists.
240
+ *
241
+ * Returns this.sdp.
242
+ */
243
+ }, {
244
+ key: "parseSDP",
245
+ value: function(e) {
246
+ return !e && this.sdp ? this.sdp : (this.sdp = k.parse(this.body || ""), this.sdp);
247
+ }
248
+ }, {
249
+ key: "toString",
250
+ value: function() {
251
+ var e = "".concat(this.method, " ").concat(this.ruri, ` SIP/2.0\r
252
+ `);
253
+ for (var r in this.headers)
254
+ if (Object.prototype.hasOwnProperty.call(this.headers, r)) {
255
+ var t = g(this.headers[r]), i;
256
+ try {
257
+ for (t.s(); !(i = t.n()).done; ) {
258
+ var u = i.value;
259
+ e += "".concat(r, ": ").concat(u, `\r
260
+ `);
261
+ }
262
+ } catch (p) {
263
+ t.e(p);
264
+ } finally {
265
+ t.f();
266
+ }
267
+ }
268
+ var s = g(this.extraHeaders), c;
269
+ try {
270
+ for (s.s(); !(c = s.n()).done; ) {
271
+ var f = c.value;
272
+ e += "".concat(f.trim(), `\r
273
+ `);
274
+ }
275
+ } catch (p) {
276
+ s.e(p);
277
+ } finally {
278
+ s.f();
279
+ }
280
+ var h = [];
281
+ switch (this.method) {
282
+ case d.REGISTER:
283
+ h.push("path", "gruu");
284
+ break;
285
+ case d.INVITE:
286
+ this.ua.configuration.session_timers && h.push("timer"), (this.ua.contact.pub_gruu || this.ua.contact.temp_gruu) && h.push("gruu"), h.push("ice", "replaces");
287
+ break;
288
+ case d.UPDATE:
289
+ this.ua.configuration.session_timers && h.push("timer"), h.push("ice");
290
+ break;
291
+ }
292
+ h.push("outbound");
293
+ var v = this.ua.configuration.user_agent || d.USER_AGENT;
294
+ if (e += "Allow: ".concat(d.ALLOWED_METHODS, `\r
295
+ `), e += "Supported: ".concat(h, `\r
296
+ `), e += "User-Agent: ".concat(v, `\r
297
+ `), this.body) {
298
+ var o = l.str_utf8_length(this.body);
299
+ e += "Content-Length: ".concat(o, `\r
300
+ \r
301
+ `), e += this.body;
302
+ } else
303
+ e += `Content-Length: 0\r
304
+ \r
305
+ `;
306
+ return e;
307
+ }
308
+ }, {
309
+ key: "clone",
310
+ value: function() {
311
+ var e = new a(this.method, this.ruri, this.ua);
312
+ return Object.keys(this.headers).forEach(function(r) {
313
+ e.headers[r] = this.headers[r].slice();
314
+ }, this), e.body = this.body, e.extraHeaders = l.cloneArray(this.extraHeaders), e.to = this.to, e.from = this.from, e.call_id = this.call_id, e.cseq = this.cseq, e;
315
+ }
316
+ }]), a;
317
+ }(), Y = /* @__PURE__ */ function(a) {
318
+ E(e, a);
319
+ var n = R(e);
320
+ function e(r, t, i, u, s) {
321
+ var c;
322
+ return m(this, e), c = n.call(this, d.INVITE, r, t, i, u, s), c.transaction = null, c;
323
+ }
324
+ return w(e, [{
325
+ key: "cancel",
326
+ value: function(t) {
327
+ this.transaction.cancel(t);
328
+ }
329
+ }, {
330
+ key: "clone",
331
+ value: function() {
332
+ var t = new e(this.ruri, this.ua);
333
+ return Object.keys(this.headers).forEach(function(i) {
334
+ t.headers[i] = this.headers[i].slice();
335
+ }, this), t.body = this.body, t.extraHeaders = l.cloneArray(this.extraHeaders), t.to = this.to, t.from = this.from, t.call_id = this.call_id, t.cseq = this.cseq, t.transaction = this.transaction, t;
336
+ }
337
+ }]), e;
338
+ }(D), C = /* @__PURE__ */ function() {
339
+ function a() {
340
+ m(this, a), this.data = null, this.headers = null, this.method = null, this.via = null, this.via_branch = null, this.call_id = null, this.cseq = null, this.from = null, this.from_tag = null, this.to = null, this.to_tag = null, this.body = null, this.sdp = null;
341
+ }
342
+ return w(a, [{
343
+ key: "addHeader",
344
+ value: function(e, r) {
345
+ var t = {
346
+ raw: r
347
+ };
348
+ e = l.headerize(e), this.headers[e] ? this.headers[e].push(t) : this.headers[e] = [t];
349
+ }
350
+ /**
351
+ * Get the value of the given header name at the given position.
352
+ */
353
+ }, {
354
+ key: "getHeader",
355
+ value: function(e) {
356
+ var r = this.headers[l.headerize(e)];
357
+ if (r) {
358
+ if (r[0])
359
+ return r[0].raw;
360
+ } else
361
+ return;
362
+ }
363
+ /**
364
+ * Get the header/s of the given name.
365
+ */
366
+ }, {
367
+ key: "getHeaders",
368
+ value: function(e) {
369
+ var r = this.headers[l.headerize(e)], t = [];
370
+ if (!r)
371
+ return [];
372
+ var i = g(r), u;
373
+ try {
374
+ for (i.s(); !(u = i.n()).done; ) {
375
+ var s = u.value;
376
+ t.push(s.raw);
377
+ }
378
+ } catch (c) {
379
+ i.e(c);
380
+ } finally {
381
+ i.f();
382
+ }
383
+ return t;
384
+ }
385
+ /**
386
+ * Verify the existence of the given header.
387
+ */
388
+ }, {
389
+ key: "hasHeader",
390
+ value: function(e) {
391
+ return !!this.headers[l.headerize(e)];
392
+ }
393
+ /**
394
+ * Parse the given header on the given index.
395
+ * -param {String} name header name
396
+ * -param {Number} [idx=0] header index
397
+ * -returns {Object|undefined} Parsed header object, undefined if the header
398
+ * is not present or in case of a parsing error.
399
+ */
400
+ }, {
401
+ key: "parseHeader",
402
+ value: function(e) {
403
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
404
+ if (e = l.headerize(e), this.headers[e]) {
405
+ if (r >= this.headers[e].length) {
406
+ A.debug('not so many "'.concat(e, '" headers present'));
407
+ return;
408
+ }
409
+ } else {
410
+ A.debug('header "'.concat(e, '" not present'));
411
+ return;
412
+ }
413
+ var t = this.headers[e][r], i = t.raw;
414
+ if (t.parsed)
415
+ return t.parsed;
416
+ var u = W.parse(i, e.replace(/-/g, "_"));
417
+ if (u === -1) {
418
+ this.headers[e].splice(r, 1), A.debug('error parsing "'.concat(e, '" header field with value "').concat(i, '"'));
419
+ return;
420
+ } else
421
+ return t.parsed = u, u;
422
+ }
423
+ /**
424
+ * Message Header attribute selector. Alias of parseHeader.
425
+ * -param {String} name header name
426
+ * -param {Number} [idx=0] header index
427
+ * -returns {Object|undefined} Parsed header object, undefined if the header
428
+ * is not present or in case of a parsing error.
429
+ *
430
+ * -example
431
+ * message.s('via',3).port
432
+ */
433
+ }, {
434
+ key: "s",
435
+ value: function(e, r) {
436
+ return this.parseHeader(e, r);
437
+ }
438
+ /**
439
+ * Replace the value of the given header by the value.
440
+ * -param {String} name header name
441
+ * -param {String} value header value
442
+ */
443
+ }, {
444
+ key: "setHeader",
445
+ value: function(e, r) {
446
+ var t = {
447
+ raw: r
448
+ };
449
+ this.headers[l.headerize(e)] = [t];
450
+ }
451
+ /**
452
+ * Parse the current body as a SDP and store the resulting object
453
+ * into this.sdp.
454
+ * -param {Boolean} force: Parse even if this.sdp already exists.
455
+ *
456
+ * Returns this.sdp.
457
+ */
458
+ }, {
459
+ key: "parseSDP",
460
+ value: function(e) {
461
+ return !e && this.sdp ? this.sdp : (this.sdp = k.parse(this.body || ""), this.sdp);
462
+ }
463
+ }, {
464
+ key: "toString",
465
+ value: function() {
466
+ return this.data;
467
+ }
468
+ }]), a;
469
+ }(), B = /* @__PURE__ */ function(a) {
470
+ E(e, a);
471
+ var n = R(e);
472
+ function e(r) {
473
+ var t;
474
+ return m(this, e), t = n.call(this), t.ua = r, t.headers = {}, t.ruri = null, t.transport = null, t.server_transaction = null, t;
475
+ }
476
+ return w(e, [{
477
+ key: "reply",
478
+ value: function(t, i, u, s, c, f) {
479
+ var h = [], v = this.getHeader("To");
480
+ if (t = t || null, i = i || null, !t || t < 100 || t > 699)
481
+ throw new TypeError("Invalid status_code: ".concat(t));
482
+ if (i && typeof i != "string" && !(i instanceof String))
483
+ throw new TypeError("Invalid reason_phrase: ".concat(i));
484
+ i = i || d.REASON_PHRASE[t] || "", u = l.cloneArray(u), this.ua.configuration.extra_headers && (u = u.concat(this.ua.configuration.extra_headers));
485
+ var o = "SIP/2.0 ".concat(t, " ").concat(i, `\r
486
+ `);
487
+ if (this.method === d.INVITE && t > 100 && t <= 200) {
488
+ var p = this.getHeaders("record-route"), y = g(p), _;
489
+ try {
490
+ for (y.s(); !(_ = y.n()).done; ) {
491
+ var X = _.value;
492
+ o += "Record-Route: ".concat(X, `\r
493
+ `);
494
+ }
495
+ } catch (b) {
496
+ y.e(b);
497
+ } finally {
498
+ y.f();
499
+ }
500
+ }
501
+ var $ = this.getHeaders("via"), I = g($), L;
502
+ try {
503
+ for (I.s(); !(L = I.n()).done; ) {
504
+ var K = L.value;
505
+ o += "Via: ".concat(K, `\r
506
+ `);
507
+ }
508
+ } catch (b) {
509
+ I.e(b);
510
+ } finally {
511
+ I.f();
512
+ }
513
+ !this.to_tag && t > 100 ? v += ";tag=".concat(l.newTag()) : this.to_tag && !this.s("to").hasParam("tag") && (v += ";tag=".concat(this.to_tag)), o += "To: ".concat(v, `\r
514
+ `), o += "From: ".concat(this.getHeader("From"), `\r
515
+ `), o += "Call-ID: ".concat(this.call_id, `\r
516
+ `), o += "CSeq: ".concat(this.cseq, " ").concat(this.method, `\r
517
+ `);
518
+ var O = g(u), M;
519
+ try {
520
+ for (O.s(); !(M = O.n()).done; ) {
521
+ var Q = M.value;
522
+ o += "".concat(Q.trim(), `\r
523
+ `);
524
+ }
525
+ } catch (b) {
526
+ O.e(b);
527
+ } finally {
528
+ O.f();
529
+ }
530
+ switch (this.method) {
531
+ case d.INVITE:
532
+ this.ua.configuration.session_timers && h.push("timer"), (this.ua.contact.pub_gruu || this.ua.contact.temp_gruu) && h.push("gruu"), h.push("ice", "replaces");
533
+ break;
534
+ case d.UPDATE:
535
+ this.ua.configuration.session_timers && h.push("timer"), s && h.push("ice"), h.push("replaces");
536
+ }
537
+ if (h.push("outbound"), this.method === d.OPTIONS ? (o += "Allow: ".concat(d.ALLOWED_METHODS, `\r
538
+ `), o += "Accept: ".concat(d.ACCEPTED_BODY_TYPES, `\r
539
+ `)) : t === 405 ? o += "Allow: ".concat(d.ALLOWED_METHODS, `\r
540
+ `) : t === 415 && (o += "Accept: ".concat(d.ACCEPTED_BODY_TYPES, `\r
541
+ `)), o += "Supported: ".concat(h, `\r
542
+ `), s) {
543
+ var Z = l.str_utf8_length(s);
544
+ o += `Content-Type: application/sdp\r
545
+ `, o += "Content-Length: ".concat(Z, `\r
546
+ \r
547
+ `), o += s;
548
+ } else
549
+ o += "Content-Length: ".concat(0, `\r
550
+ \r
551
+ `);
552
+ this.server_transaction.receiveResponse(t, o, c, f);
553
+ }
554
+ /**
555
+ * Stateless reply.
556
+ * -param {Number} code status code
557
+ * -param {String} reason reason phrase
558
+ */
559
+ }, {
560
+ key: "reply_sl",
561
+ value: function() {
562
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, u = this.getHeaders("via");
563
+ if (!t || t < 100 || t > 699)
564
+ throw new TypeError("Invalid status_code: ".concat(t));
565
+ if (i && typeof i != "string" && !(i instanceof String))
566
+ throw new TypeError("Invalid reason_phrase: ".concat(i));
567
+ i = i || d.REASON_PHRASE[t] || "";
568
+ var s = "SIP/2.0 ".concat(t, " ").concat(i, `\r
569
+ `), c = g(u), f;
570
+ try {
571
+ for (c.s(); !(f = c.n()).done; ) {
572
+ var h = f.value;
573
+ s += "Via: ".concat(h, `\r
574
+ `);
575
+ }
576
+ } catch (_) {
577
+ c.e(_);
578
+ } finally {
579
+ c.f();
580
+ }
581
+ var v = this.getHeader("To");
582
+ if (!this.to_tag && t > 100 ? v += ";tag=".concat(l.newTag()) : this.to_tag && !this.s("to").hasParam("tag") && (v += ";tag=".concat(this.to_tag)), s += "To: ".concat(v, `\r
583
+ `), s += "From: ".concat(this.getHeader("From"), `\r
584
+ `), s += "Call-ID: ".concat(this.call_id, `\r
585
+ `), s += "CSeq: ".concat(this.cseq, " ").concat(this.method, `\r
586
+ `), this.ua.configuration.extra_headers) {
587
+ var o = g(this.ua.configuration.extra_headers), p;
588
+ try {
589
+ for (o.s(); !(p = o.n()).done; ) {
590
+ var y = p.value;
591
+ s += "".concat(y.trim(), `\r
592
+ `);
593
+ }
594
+ } catch (_) {
595
+ o.e(_);
596
+ } finally {
597
+ o.f();
598
+ }
599
+ }
600
+ s += "Content-Length: ".concat(0, `\r
601
+ \r
602
+ `), this.transport.send(s);
603
+ }
604
+ }]), e;
605
+ }(C), J = /* @__PURE__ */ function(a) {
606
+ E(e, a);
607
+ var n = R(e);
608
+ function e() {
609
+ var r;
610
+ return m(this, e), r = n.call(this), r.headers = {}, r.status_code = null, r.reason_phrase = null, r;
611
+ }
612
+ return e;
613
+ }(C);
614
+ return P = {
615
+ OutgoingRequest: D,
616
+ InitialOutgoingInviteRequest: Y,
617
+ IncomingRequest: B,
618
+ IncomingResponse: J
619
+ }, P;
620
+ }
621
+ export {
622
+ fe as __require
623
+ };
@@ -0,0 +1,38 @@
1
+ import { __exports as o } from "../../../commonjs-virtual-dir/Socket.js";
2
+ import { __require as u } from "./Logger.js";
3
+ import { __require as c } from "./Utils.js";
4
+ import { __require as p } from "./Grammar.js";
5
+ var t;
6
+ function _() {
7
+ if (t) return o;
8
+ t = 1;
9
+ var s = u(), n = c(), a = p(), i = new s("Socket");
10
+ return o.isSocket = function(r) {
11
+ if (Array.isArray(r))
12
+ return !1;
13
+ if (typeof r > "u")
14
+ return i.warn("undefined JsSIP.Socket instance"), !1;
15
+ try {
16
+ if (!n.isString(r.url))
17
+ throw i.warn("missing or invalid JsSIP.Socket url property"), new Error("Missing or invalid JsSIP.Socket url property");
18
+ if (!n.isString(r.via_transport))
19
+ throw i.warn("missing or invalid JsSIP.Socket via_transport property"), new Error("Missing or invalid JsSIP.Socket via_transport property");
20
+ if (a.parse(r.sip_uri, "SIP_URI") === -1)
21
+ throw i.warn("missing or invalid JsSIP.Socket sip_uri property"), new Error("missing or invalid JsSIP.Socket sip_uri property");
22
+ } catch {
23
+ return !1;
24
+ }
25
+ try {
26
+ ["connect", "disconnect", "send"].forEach(function(e) {
27
+ if (!n.isFunction(r[e]))
28
+ throw i.warn("missing or invalid JsSIP.Socket method: ".concat(e)), new Error("Missing or invalid JsSIP.Socket method: ".concat(e));
29
+ });
30
+ } catch {
31
+ return !1;
32
+ }
33
+ return !0;
34
+ }, o;
35
+ }
36
+ export {
37
+ _ as __require
38
+ };
@@ -0,0 +1,25 @@
1
+ var r, R;
2
+ function e() {
3
+ if (R) return r;
4
+ R = 1;
5
+ var T = 500, _ = 4e3, I = 5e3;
6
+ return r = {
7
+ T1: T,
8
+ T2: _,
9
+ T4: I,
10
+ TIMER_B: 64 * T,
11
+ TIMER_D: 0 * T,
12
+ TIMER_F: 64 * T,
13
+ TIMER_H: 64 * T,
14
+ TIMER_I: 0 * T,
15
+ TIMER_J: 0 * T,
16
+ TIMER_K: 0 * I,
17
+ TIMER_L: 64 * T,
18
+ TIMER_M: 64 * T,
19
+ PROVISIONAL_RESPONSE_INTERVAL: 6e4
20
+ // See RFC 3261 Section 13.3.1.1
21
+ }, r;
22
+ }
23
+ export {
24
+ e as __require
25
+ };