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,202 @@
1
+ import { __exports as H } from "../../../commonjs-virtual-dir/Parser2.js";
2
+ import { __require as S } from "./Logger.js";
3
+ import { __require as P } from "./Grammar.js";
4
+ import { __require as A } from "./SIPMessage.js";
5
+ var k;
6
+ function L() {
7
+ if (k) return H;
8
+ k = 1;
9
+ function y(e, n) {
10
+ var t;
11
+ if (typeof Symbol > "u" || e[Symbol.iterator] == null) {
12
+ if (Array.isArray(e) || (t = _(e)) || n) {
13
+ t && (e = t);
14
+ var i = 0, r = function() {
15
+ };
16
+ return { s: r, n: function() {
17
+ return i >= e.length ? { done: !0 } : { done: !1, value: e[i++] };
18
+ }, e: function(c) {
19
+ throw c;
20
+ }, f: r };
21
+ }
22
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
24
+ }
25
+ var f = !0, o = !1, a;
26
+ return { s: function() {
27
+ t = e[Symbol.iterator]();
28
+ }, n: function() {
29
+ var c = t.next();
30
+ return f = c.done, c;
31
+ }, e: function(c) {
32
+ o = !0, a = c;
33
+ }, f: function() {
34
+ try {
35
+ !f && t.return != null && t.return();
36
+ } finally {
37
+ if (o) throw a;
38
+ }
39
+ } };
40
+ }
41
+ function _(e, n) {
42
+ if (e) {
43
+ if (typeof e == "string") return w(e, n);
44
+ var t = Object.prototype.toString.call(e).slice(8, -1);
45
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e);
46
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return w(e, n);
47
+ }
48
+ }
49
+ function w(e, n) {
50
+ (n == null || n > e.length) && (n = e.length);
51
+ for (var t = 0, i = new Array(n); t < n; t++)
52
+ i[t] = e[t];
53
+ return i;
54
+ }
55
+ var q = S(), p = P(), l = A(), u = new q("Parser");
56
+ H.parseMessage = function(e, n) {
57
+ var t, i, r = e.indexOf(`\r
58
+ `);
59
+ if (r === -1) {
60
+ u.warn("parseMessage() | no CRLF found, not a SIP message");
61
+ return;
62
+ }
63
+ var f = e.substring(0, r), o = p.parse(f, "Request_Response");
64
+ if (o === -1) {
65
+ u.warn('parseMessage() | error parsing first line of SIP message: "'.concat(f, '"'));
66
+ return;
67
+ } else o.status_code ? (t = new l.IncomingResponse(), t.status_code = o.status_code, t.reason_phrase = o.reason_phrase) : (t = new l.IncomingRequest(n), t.method = o.method, t.ruri = o.uri);
68
+ t.data = e;
69
+ for (var a = r + 2; ; ) {
70
+ if (r = I(e, a), r === -2) {
71
+ i = a + 2;
72
+ break;
73
+ } else if (r === -1) {
74
+ u.warn("parseMessage() | malformed message");
75
+ return;
76
+ }
77
+ if (o = R(t, e, a, r), o !== !0) {
78
+ u.warn("parseMessage() |", o.error);
79
+ return;
80
+ }
81
+ a = r + 2;
82
+ }
83
+ if (t.hasHeader("content-length")) {
84
+ var s = t.getHeader("content-length");
85
+ t.body = e.substr(i, s);
86
+ } else
87
+ t.body = e.substring(i);
88
+ return t;
89
+ };
90
+ function I(e, n) {
91
+ var t = n, i = 0, r = 0;
92
+ if (e.substring(t, t + 2).match(/(^\r\n)/))
93
+ return -2;
94
+ for (; i === 0; ) {
95
+ if (r = e.indexOf(`\r
96
+ `, t), r === -1)
97
+ return r;
98
+ !e.substring(r + 2, r + 4).match(/(^\r\n)/) && e.charAt(r + 2).match(/(^\s+)/) ? t = r + 2 : i = r;
99
+ }
100
+ return i;
101
+ }
102
+ function R(e, n, t, i) {
103
+ var r, f = n.indexOf(":", t), o = n.substring(t, f).trim(), a = n.substring(f + 1, i).trim();
104
+ switch (o.toLowerCase()) {
105
+ case "via":
106
+ case "v":
107
+ e.addHeader("via", a), e.getHeaders("via").length === 1 ? (r = e.parseHeader("Via"), r && (e.via = r, e.via_branch = r.branch)) : r = 0;
108
+ break;
109
+ case "from":
110
+ case "f":
111
+ e.setHeader("from", a), r = e.parseHeader("from"), r && (e.from = r, e.from_tag = r.getParam("tag"));
112
+ break;
113
+ case "to":
114
+ case "t":
115
+ e.setHeader("to", a), r = e.parseHeader("to"), r && (e.to = r, e.to_tag = r.getParam("tag"));
116
+ break;
117
+ case "record-route":
118
+ if (r = p.parse(a, "Record_Route"), r === -1)
119
+ r = void 0;
120
+ else {
121
+ var s = y(r), c;
122
+ try {
123
+ for (s.s(); !(c = s.n()).done; ) {
124
+ var h = c.value;
125
+ e.addHeader("record-route", a.substring(h.possition, h.offset)), e.headers["Record-Route"][e.getHeaders("record-route").length - 1].parsed = h.parsed;
126
+ }
127
+ } catch (b) {
128
+ s.e(b);
129
+ } finally {
130
+ s.f();
131
+ }
132
+ }
133
+ break;
134
+ case "call-id":
135
+ case "i":
136
+ e.setHeader("call-id", a), r = e.parseHeader("call-id"), r && (e.call_id = a);
137
+ break;
138
+ case "contact":
139
+ case "m":
140
+ if (r = p.parse(a, "Contact"), r === -1)
141
+ r = void 0;
142
+ else {
143
+ var d = y(r), x;
144
+ try {
145
+ for (d.s(); !(x = d.n()).done; ) {
146
+ var v = x.value;
147
+ e.addHeader("contact", a.substring(v.possition, v.offset)), e.headers.Contact[e.getHeaders("contact").length - 1].parsed = v.parsed;
148
+ }
149
+ } catch (b) {
150
+ d.e(b);
151
+ } finally {
152
+ d.f();
153
+ }
154
+ }
155
+ break;
156
+ case "content-length":
157
+ case "l":
158
+ e.setHeader("content-length", a), r = e.parseHeader("content-length");
159
+ break;
160
+ case "content-type":
161
+ case "c":
162
+ e.setHeader("content-type", a), r = e.parseHeader("content-type");
163
+ break;
164
+ case "cseq":
165
+ e.setHeader("cseq", a), r = e.parseHeader("cseq"), r && (e.cseq = r.value), e instanceof l.IncomingResponse && (e.method = r.method);
166
+ break;
167
+ case "max-forwards":
168
+ e.setHeader("max-forwards", a), r = e.parseHeader("max-forwards");
169
+ break;
170
+ case "www-authenticate":
171
+ e.setHeader("www-authenticate", a), r = e.parseHeader("www-authenticate");
172
+ break;
173
+ case "proxy-authenticate":
174
+ e.setHeader("proxy-authenticate", a), r = e.parseHeader("proxy-authenticate");
175
+ break;
176
+ case "session-expires":
177
+ case "x":
178
+ e.setHeader("session-expires", a), r = e.parseHeader("session-expires"), r && (e.session_expires = r.expires, e.session_expires_refresher = r.refresher);
179
+ break;
180
+ case "refer-to":
181
+ case "r":
182
+ e.setHeader("refer-to", a), r = e.parseHeader("refer-to"), r && (e.refer_to = r);
183
+ break;
184
+ case "replaces":
185
+ e.setHeader("replaces", a), r = e.parseHeader("replaces"), r && (e.replaces = r);
186
+ break;
187
+ case "event":
188
+ case "o":
189
+ e.setHeader("event", a), r = e.parseHeader("event"), r && (e.event = r);
190
+ break;
191
+ default:
192
+ e.addHeader(o, a), r = 0;
193
+ }
194
+ return r === void 0 ? {
195
+ error: 'error parsing header "'.concat(o, '"')
196
+ } : !0;
197
+ }
198
+ return H;
199
+ }
200
+ export {
201
+ L as __require
202
+ };
@@ -0,0 +1,175 @@
1
+ import { __module as _ } from "../../../../commonjs-virtual-dir/DTMF.js";
2
+ import { __require as F } from "../../../events/events.js";
3
+ import { __require as N } from "../Logger.js";
4
+ import { __require as P } from "../Constants.js";
5
+ import { __require as x } from "../Exceptions.js";
6
+ import { __require as M } from "../Utils.js";
7
+ var m;
8
+ function G() {
9
+ if (m) return _.exports;
10
+ m = 1;
11
+ function a(r) {
12
+ "@babel/helpers - typeof";
13
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? a = function(n) {
14
+ return typeof n;
15
+ } : a = function(n) {
16
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
17
+ }, a(r);
18
+ }
19
+ function g(r, t) {
20
+ if (!(r instanceof t))
21
+ throw new TypeError("Cannot call a class as a function");
22
+ }
23
+ function v(r, t) {
24
+ for (var n = 0; n < t.length; n++) {
25
+ var o = t[n];
26
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
27
+ }
28
+ }
29
+ function T(r, t, n) {
30
+ return t && v(r.prototype, t), r;
31
+ }
32
+ function E(r, t) {
33
+ if (typeof t != "function" && t !== null)
34
+ throw new TypeError("Super expression must either be null or a function");
35
+ r.prototype = Object.create(t && t.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), t && l(r, t);
36
+ }
37
+ function l(r, t) {
38
+ return l = Object.setPrototypeOf || function(o, e) {
39
+ return o.__proto__ = e, o;
40
+ }, l(r, t);
41
+ }
42
+ function R(r) {
43
+ var t = b();
44
+ return function() {
45
+ var o = f(r), e;
46
+ if (t) {
47
+ var i = f(this).constructor;
48
+ e = Reflect.construct(o, arguments, i);
49
+ } else
50
+ e = o.apply(this, arguments);
51
+ return D(this, e);
52
+ };
53
+ }
54
+ function D(r, t) {
55
+ return t && (a(t) === "object" || typeof t == "function") ? t : O(r);
56
+ }
57
+ function O(r) {
58
+ if (r === void 0)
59
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
60
+ return r;
61
+ }
62
+ function b() {
63
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
64
+ if (typeof Proxy == "function") return !0;
65
+ try {
66
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
67
+ })), !0;
68
+ } catch {
69
+ return !1;
70
+ }
71
+ }
72
+ function f(r) {
73
+ return f = Object.setPrototypeOf ? Object.getPrototypeOf : function(n) {
74
+ return n.__proto__ || Object.getPrototypeOf(n);
75
+ }, f(r);
76
+ }
77
+ var S = F().EventEmitter, I = N(), w = P(), q = x(), h = M(), A = new I("RTCSession:DTMF"), y = {
78
+ MIN_DURATION: 70,
79
+ MAX_DURATION: 6e3,
80
+ DEFAULT_DURATION: 100,
81
+ MIN_INTER_TONE_GAP: 50,
82
+ DEFAULT_INTER_TONE_GAP: 500
83
+ };
84
+ return _.exports = /* @__PURE__ */ function(r) {
85
+ E(n, r);
86
+ var t = R(n);
87
+ function n(o) {
88
+ var e;
89
+ return g(this, n), e = t.call(this), e._session = o, e._direction = null, e._tone = null, e._duration = null, e._request = null, e;
90
+ }
91
+ return T(n, [{
92
+ key: "send",
93
+ value: function(e) {
94
+ var i = this, u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
95
+ if (e === void 0)
96
+ throw new TypeError("Not enough arguments");
97
+ if (this._direction = "outgoing", this._session.status !== this._session.C.STATUS_CONFIRMED && this._session.status !== this._session.C.STATUS_WAITING_FOR_ACK)
98
+ throw new q.InvalidStateError(this._session.status);
99
+ var s = h.cloneArray(u.extraHeaders);
100
+ if (this.eventHandlers = h.cloneObject(u.eventHandlers), typeof e == "string")
101
+ e = e.toUpperCase();
102
+ else if (typeof e == "number")
103
+ e = e.toString();
104
+ else
105
+ throw new TypeError("Invalid tone: ".concat(e));
106
+ if (e.match(/^[0-9A-DR#*]$/))
107
+ this._tone = e;
108
+ else
109
+ throw new TypeError("Invalid tone: ".concat(e));
110
+ this._duration = u.duration, s.push("Content-Type: application/dtmf-relay");
111
+ var d = "Signal=".concat(this._tone, `\r
112
+ `);
113
+ d += "Duration=".concat(this._duration), this._session.newDTMF({
114
+ originator: "local",
115
+ dtmf: this,
116
+ request: this._request
117
+ }), this._session.sendRequest(w.INFO, {
118
+ extraHeaders: s,
119
+ eventHandlers: {
120
+ onSuccessResponse: function(p) {
121
+ i.emit("succeeded", {
122
+ originator: "remote",
123
+ response: p
124
+ });
125
+ },
126
+ onErrorResponse: function(p) {
127
+ i.eventHandlers.onFailed && i.eventHandlers.onFailed(), i.emit("failed", {
128
+ originator: "remote",
129
+ response: p
130
+ });
131
+ },
132
+ onRequestTimeout: function() {
133
+ i._session.onRequestTimeout();
134
+ },
135
+ onTransportError: function() {
136
+ i._session.onTransportError();
137
+ },
138
+ onDialogError: function() {
139
+ i._session.onDialogError();
140
+ }
141
+ },
142
+ body: d
143
+ });
144
+ }
145
+ }, {
146
+ key: "init_incoming",
147
+ value: function(e) {
148
+ var i = /^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/, u = /^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;
149
+ if (this._direction = "incoming", this._request = e, e.reply(200), e.body) {
150
+ var s = e.body.split(`
151
+ `);
152
+ s.length >= 1 && i.test(s[0]) && (this._tone = s[0].replace(i, "$2")), s.length >= 2 && u.test(s[1]) && (this._duration = parseInt(s[1].replace(u, "$2"), 10));
153
+ }
154
+ this._duration || (this._duration = y.DEFAULT_DURATION), this._tone ? this._session.newDTMF({
155
+ originator: "remote",
156
+ dtmf: this,
157
+ request: e
158
+ }) : A.debug("invalid INFO DTMF received, discarded");
159
+ }
160
+ }, {
161
+ key: "tone",
162
+ get: function() {
163
+ return this._tone;
164
+ }
165
+ }, {
166
+ key: "duration",
167
+ get: function() {
168
+ return this._duration;
169
+ }
170
+ }]), n;
171
+ }(S), _.exports.C = y, _.exports;
172
+ }
173
+ export {
174
+ G as __require
175
+ };
@@ -0,0 +1,149 @@
1
+ import { __require as I } from "../../../events/events.js";
2
+ import { __require as P } from "../Constants.js";
3
+ import { __require as C } from "../Exceptions.js";
4
+ import { __require as x } from "../Utils.js";
5
+ var l, y;
6
+ function A() {
7
+ if (y) return l;
8
+ y = 1;
9
+ function s(t) {
10
+ "@babel/helpers - typeof";
11
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? s = function(r) {
12
+ return typeof r;
13
+ } : s = function(r) {
14
+ return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
15
+ }, s(t);
16
+ }
17
+ function h(t, e) {
18
+ if (!(t instanceof e))
19
+ throw new TypeError("Cannot call a class as a function");
20
+ }
21
+ function m(t, e) {
22
+ for (var r = 0; r < e.length; r++) {
23
+ var o = e[r];
24
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
25
+ }
26
+ }
27
+ function g(t, e, r) {
28
+ return e && m(t.prototype, e), t;
29
+ }
30
+ function d(t, e) {
31
+ if (typeof e != "function" && e !== null)
32
+ throw new TypeError("Super expression must either be null or a function");
33
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && c(t, e);
34
+ }
35
+ function c(t, e) {
36
+ return c = Object.setPrototypeOf || function(o, n) {
37
+ return o.__proto__ = n, o;
38
+ }, c(t, e);
39
+ }
40
+ function v(t) {
41
+ var e = T();
42
+ return function() {
43
+ var o = u(t), n;
44
+ if (e) {
45
+ var f = u(this).constructor;
46
+ n = Reflect.construct(o, arguments, f);
47
+ } else
48
+ n = o.apply(this, arguments);
49
+ return b(this, n);
50
+ };
51
+ }
52
+ function b(t, e) {
53
+ return e && (s(e) === "object" || typeof e == "function") ? e : E(t);
54
+ }
55
+ function E(t) {
56
+ if (t === void 0)
57
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
58
+ return t;
59
+ }
60
+ function T() {
61
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
62
+ if (typeof Proxy == "function") return !0;
63
+ try {
64
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
65
+ })), !0;
66
+ } catch {
67
+ return !1;
68
+ }
69
+ }
70
+ function u(t) {
71
+ return u = Object.setPrototypeOf ? Object.getPrototypeOf : function(r) {
72
+ return r.__proto__ || Object.getPrototypeOf(r);
73
+ }, u(t);
74
+ }
75
+ var R = I().EventEmitter, S = P(), O = C(), w = x();
76
+ return l = /* @__PURE__ */ function(t) {
77
+ d(r, t);
78
+ var e = v(r);
79
+ function r(o) {
80
+ var n;
81
+ return h(this, r), n = e.call(this), n._session = o, n._direction = null, n._contentType = null, n._body = null, n;
82
+ }
83
+ return g(r, [{
84
+ key: "send",
85
+ value: function(n, f) {
86
+ var i = this, q = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
87
+ if (this._direction = "outgoing", n === void 0)
88
+ throw new TypeError("Not enough arguments");
89
+ if (this._session.status !== this._session.C.STATUS_CONFIRMED && this._session.status !== this._session.C.STATUS_WAITING_FOR_ACK)
90
+ throw new O.InvalidStateError(this._session.status);
91
+ this._contentType = n, this._body = f;
92
+ var p = w.cloneArray(q.extraHeaders);
93
+ p.push("Content-Type: ".concat(n)), this._session.newInfo({
94
+ originator: "local",
95
+ info: this,
96
+ request: this.request
97
+ }), this._session.sendRequest(S.INFO, {
98
+ extraHeaders: p,
99
+ eventHandlers: {
100
+ onSuccessResponse: function(_) {
101
+ i.emit("succeeded", {
102
+ originator: "remote",
103
+ response: _
104
+ });
105
+ },
106
+ onErrorResponse: function(_) {
107
+ i.emit("failed", {
108
+ originator: "remote",
109
+ response: _
110
+ });
111
+ },
112
+ onTransportError: function() {
113
+ i._session.onTransportError();
114
+ },
115
+ onRequestTimeout: function() {
116
+ i._session.onRequestTimeout();
117
+ },
118
+ onDialogError: function() {
119
+ i._session.onDialogError();
120
+ }
121
+ },
122
+ body: f
123
+ });
124
+ }
125
+ }, {
126
+ key: "init_incoming",
127
+ value: function(n) {
128
+ this._direction = "incoming", this.request = n, n.reply(200), this._contentType = n.hasHeader("Content-Type") ? n.getHeader("Content-Type").toLowerCase() : void 0, this._body = n.body, this._session.newInfo({
129
+ originator: "remote",
130
+ info: this,
131
+ request: n
132
+ });
133
+ }
134
+ }, {
135
+ key: "contentType",
136
+ get: function() {
137
+ return this._contentType;
138
+ }
139
+ }, {
140
+ key: "body",
141
+ get: function() {
142
+ return this._body;
143
+ }
144
+ }]), r;
145
+ }(R), l;
146
+ }
147
+ export {
148
+ A as __require
149
+ };
@@ -0,0 +1,52 @@
1
+ import { __require as y } from "../Logger.js";
2
+ import { __require as h } from "../Constants.js";
3
+ var s, f;
4
+ function b() {
5
+ if (f) return s;
6
+ f = 1;
7
+ function u(t, r) {
8
+ if (!(t instanceof r))
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ function c(t, r) {
12
+ for (var i = 0; i < r.length; i++) {
13
+ var e = r[i];
14
+ e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(t, e.key, e);
15
+ }
16
+ }
17
+ function _(t, r, i) {
18
+ return r && c(t.prototype, r), t;
19
+ }
20
+ var l = y(), o = h(), v = new l("RTCSession:ReferNotifier"), n = {
21
+ event_type: "refer",
22
+ body_type: "message/sipfrag;version=2.0",
23
+ expires: 300
24
+ };
25
+ return s = /* @__PURE__ */ function() {
26
+ function t(r, i, e) {
27
+ u(this, t), this._session = r, this._id = i, this._expires = e || n.expires, this._active = !0, this.notify(100);
28
+ }
29
+ return _(t, [{
30
+ key: "notify",
31
+ value: function(i, e) {
32
+ if (v.debug("notify()"), this._active !== !1) {
33
+ e = e || o.REASON_PHRASE[i] || "";
34
+ var a;
35
+ i >= 200 ? a = "terminated;reason=noresource" : a = "active;expires=".concat(this._expires), this._session.sendRequest(o.NOTIFY, {
36
+ extraHeaders: ["Event: ".concat(n.event_type, ";id=").concat(this._id), "Subscription-State: ".concat(a), "Content-Type: ".concat(n.body_type)],
37
+ body: "SIP/2.0 ".concat(i, " ").concat(e),
38
+ eventHandlers: {
39
+ // If a negative response is received, subscription is canceled.
40
+ onErrorResponse: function() {
41
+ this._active = !1;
42
+ }
43
+ }
44
+ });
45
+ }
46
+ }
47
+ }]), t;
48
+ }(), s;
49
+ }
50
+ export {
51
+ b as __require
52
+ };