module-develop-kit 0.5.9 → 0.5.11

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 +4 -0
  31. package/dist/commonjs-virtual-dir/index5.js +7 -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 +26 -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,180 @@
1
+ import t from "../package.json.js";
2
+ var e, o;
3
+ function i() {
4
+ if (o) return e;
5
+ o = 1;
6
+ const E = t;
7
+ return e = {
8
+ USER_AGENT: `${E.title} ${E.version}`,
9
+ // SIP scheme.
10
+ SIP: "sip",
11
+ SIPS: "sips",
12
+ // End and Failure causes.
13
+ causes: {
14
+ // Generic error causes.
15
+ CONNECTION_ERROR: "Connection Error",
16
+ REQUEST_TIMEOUT: "Request Timeout",
17
+ SIP_FAILURE_CODE: "SIP Failure Code",
18
+ INTERNAL_ERROR: "Internal Error",
19
+ // SIP error causes.
20
+ BUSY: "Busy",
21
+ REJECTED: "Rejected",
22
+ REDIRECTED: "Redirected",
23
+ UNAVAILABLE: "Unavailable",
24
+ NOT_FOUND: "Not Found",
25
+ ADDRESS_INCOMPLETE: "Address Incomplete",
26
+ INCOMPATIBLE_SDP: "Incompatible SDP",
27
+ MISSING_SDP: "Missing SDP",
28
+ AUTHENTICATION_ERROR: "Authentication Error",
29
+ // Session error causes.
30
+ BYE: "Terminated",
31
+ WEBRTC_ERROR: "WebRTC Error",
32
+ CANCELED: "Canceled",
33
+ NO_ANSWER: "No Answer",
34
+ EXPIRES: "Expires",
35
+ NO_ACK: "No ACK",
36
+ DIALOG_ERROR: "Dialog Error",
37
+ USER_DENIED_MEDIA_ACCESS: "User Denied Media Access",
38
+ BAD_MEDIA_DESCRIPTION: "Bad Media Description",
39
+ RTP_TIMEOUT: "RTP Timeout"
40
+ },
41
+ SIP_ERROR_CAUSES: {
42
+ REDIRECTED: [300, 301, 302, 305, 380],
43
+ BUSY: [486, 600],
44
+ REJECTED: [403, 603],
45
+ NOT_FOUND: [404, 604],
46
+ UNAVAILABLE: [480, 410, 408, 430],
47
+ ADDRESS_INCOMPLETE: [484, 424],
48
+ INCOMPATIBLE_SDP: [488, 606],
49
+ AUTHENTICATION_ERROR: [401, 407]
50
+ },
51
+ // SIP Methods.
52
+ ACK: "ACK",
53
+ BYE: "BYE",
54
+ CANCEL: "CANCEL",
55
+ INFO: "INFO",
56
+ INVITE: "INVITE",
57
+ MESSAGE: "MESSAGE",
58
+ NOTIFY: "NOTIFY",
59
+ OPTIONS: "OPTIONS",
60
+ REGISTER: "REGISTER",
61
+ REFER: "REFER",
62
+ UPDATE: "UPDATE",
63
+ SUBSCRIBE: "SUBSCRIBE",
64
+ // DTMF transport methods.
65
+ DTMF_TRANSPORT: {
66
+ INFO: "INFO",
67
+ RFC2833: "RFC2833"
68
+ },
69
+ /* SIP Response Reasons
70
+ * DOC: https://www.iana.org/assignments/sip-parameters
71
+ * Copied from https://github.com/versatica/OverSIP/blob/master/lib/oversip/sip/constants.rb#L7
72
+ */
73
+ REASON_PHRASE: {
74
+ 100: "Trying",
75
+ 180: "Ringing",
76
+ 181: "Call Is Being Forwarded",
77
+ 182: "Queued",
78
+ 183: "Session Progress",
79
+ 199: "Early Dialog Terminated",
80
+ // draft-ietf-sipcore-199
81
+ 200: "OK",
82
+ 202: "Accepted",
83
+ // RFC 3265
84
+ 204: "No Notification",
85
+ // RFC 5839
86
+ 300: "Multiple Choices",
87
+ 301: "Moved Permanently",
88
+ 302: "Moved Temporarily",
89
+ 305: "Use Proxy",
90
+ 380: "Alternative Service",
91
+ 400: "Bad Request",
92
+ 401: "Unauthorized",
93
+ 402: "Payment Required",
94
+ 403: "Forbidden",
95
+ 404: "Not Found",
96
+ 405: "Method Not Allowed",
97
+ 406: "Not Acceptable",
98
+ 407: "Proxy Authentication Required",
99
+ 408: "Request Timeout",
100
+ 410: "Gone",
101
+ 412: "Conditional Request Failed",
102
+ // RFC 3903
103
+ 413: "Request Entity Too Large",
104
+ 414: "Request-URI Too Long",
105
+ 415: "Unsupported Media Type",
106
+ 416: "Unsupported URI Scheme",
107
+ 417: "Unknown Resource-Priority",
108
+ // RFC 4412
109
+ 420: "Bad Extension",
110
+ 421: "Extension Required",
111
+ 422: "Session Interval Too Small",
112
+ // RFC 4028
113
+ 423: "Interval Too Brief",
114
+ 424: "Bad Location Information",
115
+ // RFC 6442
116
+ 428: "Use Identity Header",
117
+ // RFC 4474
118
+ 429: "Provide Referrer Identity",
119
+ // RFC 3892
120
+ 430: "Flow Failed",
121
+ // RFC 5626
122
+ 433: "Anonymity Disallowed",
123
+ // RFC 5079
124
+ 436: "Bad Identity-Info",
125
+ // RFC 4474
126
+ 437: "Unsupported Certificate",
127
+ // RFC 4744
128
+ 438: "Invalid Identity Header",
129
+ // RFC 4744
130
+ 439: "First Hop Lacks Outbound Support",
131
+ // RFC 5626
132
+ 440: "Max-Breadth Exceeded",
133
+ // RFC 5393
134
+ 469: "Bad Info Package",
135
+ // draft-ietf-sipcore-info-events
136
+ 470: "Consent Needed",
137
+ // RFC 5360
138
+ 478: "Unresolvable Destination",
139
+ // Custom code copied from Kamailio.
140
+ 480: "Temporarily Unavailable",
141
+ 481: "Call/Transaction Does Not Exist",
142
+ 482: "Loop Detected",
143
+ 483: "Too Many Hops",
144
+ 484: "Address Incomplete",
145
+ 485: "Ambiguous",
146
+ 486: "Busy Here",
147
+ 487: "Request Terminated",
148
+ 488: "Not Acceptable Here",
149
+ 489: "Bad Event",
150
+ // RFC 3265
151
+ 491: "Request Pending",
152
+ 493: "Undecipherable",
153
+ 494: "Security Agreement Required",
154
+ // RFC 3329
155
+ 500: "JsSIP Internal Error",
156
+ 501: "Not Implemented",
157
+ 502: "Bad Gateway",
158
+ 503: "Service Unavailable",
159
+ 504: "Server Time-out",
160
+ 505: "Version Not Supported",
161
+ 513: "Message Too Large",
162
+ 580: "Precondition Failure",
163
+ // RFC 3312
164
+ 600: "Busy Everywhere",
165
+ 603: "Decline",
166
+ 604: "Does Not Exist Anywhere",
167
+ 606: "Not Acceptable"
168
+ },
169
+ ALLOWED_METHODS: "INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",
170
+ ACCEPTED_BODY_TYPES: "application/sdp, application/dtmf-relay",
171
+ MAX_FORWARDS: 69,
172
+ SESSION_EXPIRES: 90,
173
+ MIN_SESSION_EXPIRES: 60,
174
+ CONNECTION_RECOVERY_MAX_INTERVAL: 30,
175
+ CONNECTION_RECOVERY_MIN_INTERVAL: 2
176
+ }, e;
177
+ }
178
+ export {
179
+ i as __require
180
+ };
@@ -0,0 +1,263 @@
1
+ import { __exports as m } from "../../../commonjs-virtual-dir/Config.js";
2
+ import { __require as E } from "./Utils.js";
3
+ import { __require as I } from "./Constants.js";
4
+ import { __require as S } from "./Grammar.js";
5
+ import { __require as A } from "./URI.js";
6
+ import { __require as C } from "./Socket.js";
7
+ import { __require as q } from "./Exceptions.js";
8
+ var b;
9
+ function j() {
10
+ if (b) return m;
11
+ b = 1;
12
+ function _(n, r) {
13
+ var e;
14
+ if (typeof Symbol > "u" || n[Symbol.iterator] == null) {
15
+ if (Array.isArray(n) || (e = w(n)) || r) {
16
+ e && (n = e);
17
+ var t = 0, o = function() {
18
+ };
19
+ return { s: o, n: function() {
20
+ return t >= n.length ? { done: !0 } : { done: !1, value: n[t++] };
21
+ }, e: function(l) {
22
+ throw l;
23
+ }, f: o };
24
+ }
25
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
27
+ }
28
+ var i = !0, u = !1, c;
29
+ return { s: function() {
30
+ e = n[Symbol.iterator]();
31
+ }, n: function() {
32
+ var l = e.next();
33
+ return i = l.done, l;
34
+ }, e: function(l) {
35
+ u = !0, c = l;
36
+ }, f: function() {
37
+ try {
38
+ !i && e.return != null && e.return();
39
+ } finally {
40
+ if (u) throw c;
41
+ }
42
+ } };
43
+ }
44
+ function w(n, r) {
45
+ if (n) {
46
+ if (typeof n == "string") return h(n, r);
47
+ var e = Object.prototype.toString.call(n).slice(8, -1);
48
+ if (e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set") return Array.from(n);
49
+ if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return h(n, r);
50
+ }
51
+ }
52
+ function h(n, r) {
53
+ (r == null || r > n.length) && (r = n.length);
54
+ for (var e = 0, t = new Array(r); e < r; e++)
55
+ t[e] = n[e];
56
+ return t;
57
+ }
58
+ var a = E(), s = I(), y = S(), g = A(), v = C(), d = q();
59
+ m.settings = {
60
+ // SIP authentication.
61
+ authorization_user: null,
62
+ password: null,
63
+ realm: null,
64
+ ha1: null,
65
+ authorization_jwt: null,
66
+ // SIP account.
67
+ display_name: null,
68
+ uri: null,
69
+ contact_uri: null,
70
+ // SIP instance id (GRUU).
71
+ instance_id: null,
72
+ // Preloaded SIP Route header field.
73
+ use_preloaded_route: !1,
74
+ // Session parameters.
75
+ session_timers: !0,
76
+ session_timers_refresh_method: s.UPDATE,
77
+ session_timers_force_refresher: !1,
78
+ no_answer_timeout: 60,
79
+ // Registration parameters.
80
+ register: !0,
81
+ register_expires: 600,
82
+ registrar_server: null,
83
+ // Connection options.
84
+ sockets: null,
85
+ connection_recovery_max_interval: s.CONNECTION_RECOVERY_MAX_INTERVAL,
86
+ connection_recovery_min_interval: s.CONNECTION_RECOVERY_MIN_INTERVAL,
87
+ // Global extra headers, to be added to every request and response
88
+ extra_headers: null,
89
+ /*
90
+ * Host address.
91
+ * Value to be set in Via sent_by and host part of Contact FQDN.
92
+ */
93
+ via_host: "".concat(a.createRandomToken(12), ".invalid")
94
+ };
95
+ var p = {
96
+ mandatory: {
97
+ sockets: function(r) {
98
+ var e = [];
99
+ if (v.isSocket(r))
100
+ e.push({
101
+ socket: r
102
+ });
103
+ else if (Array.isArray(r) && r.length) {
104
+ var t = _(r), o;
105
+ try {
106
+ for (t.s(); !(o = t.n()).done; ) {
107
+ var i = o.value;
108
+ Object.prototype.hasOwnProperty.call(i, "socket") && v.isSocket(i.socket) ? e.push(i) : v.isSocket(i) && e.push({
109
+ socket: i
110
+ });
111
+ }
112
+ } catch (u) {
113
+ t.e(u);
114
+ } finally {
115
+ t.f();
116
+ }
117
+ } else
118
+ return;
119
+ return e;
120
+ },
121
+ uri: function(r) {
122
+ /^sip:/i.test(r) || (r = "".concat(s.SIP, ":").concat(r));
123
+ var e = g.parse(r);
124
+ if (e)
125
+ return e.user ? e : void 0;
126
+ }
127
+ },
128
+ optional: {
129
+ authorization_user: function(r) {
130
+ if (y.parse('"'.concat(r, '"'), "quoted_string") !== -1)
131
+ return r;
132
+ },
133
+ authorization_jwt: function(r) {
134
+ if (typeof r == "string")
135
+ return r;
136
+ },
137
+ user_agent: function(r) {
138
+ if (typeof r == "string")
139
+ return r;
140
+ },
141
+ connection_recovery_max_interval: function(r) {
142
+ if (a.isDecimal(r)) {
143
+ var e = Number(r);
144
+ if (e > 0)
145
+ return e;
146
+ }
147
+ },
148
+ connection_recovery_min_interval: function(r) {
149
+ if (a.isDecimal(r)) {
150
+ var e = Number(r);
151
+ if (e > 0)
152
+ return e;
153
+ }
154
+ },
155
+ contact_uri: function(r) {
156
+ if (typeof r == "string") {
157
+ var e = y.parse(r, "SIP_URI");
158
+ if (e !== -1)
159
+ return e;
160
+ }
161
+ },
162
+ display_name: function(r) {
163
+ return r;
164
+ },
165
+ instance_id: function(r) {
166
+ if (/^uuid:/i.test(r) && (r = r.substr(5)), y.parse(r, "uuid") !== -1)
167
+ return r;
168
+ },
169
+ no_answer_timeout: function(r) {
170
+ if (a.isDecimal(r)) {
171
+ var e = Number(r);
172
+ if (e > 0)
173
+ return e;
174
+ }
175
+ },
176
+ session_timers: function(r) {
177
+ if (typeof r == "boolean")
178
+ return r;
179
+ },
180
+ session_timers_refresh_method: function(r) {
181
+ if (typeof r == "string" && (r = r.toUpperCase(), r === s.INVITE || r === s.UPDATE))
182
+ return r;
183
+ },
184
+ session_timers_force_refresher: function(r) {
185
+ if (typeof r == "boolean")
186
+ return r;
187
+ },
188
+ password: function(r) {
189
+ return String(r);
190
+ },
191
+ realm: function(r) {
192
+ return String(r);
193
+ },
194
+ ha1: function(r) {
195
+ return String(r);
196
+ },
197
+ register: function(r) {
198
+ if (typeof r == "boolean")
199
+ return r;
200
+ },
201
+ register_expires: function(r) {
202
+ if (a.isDecimal(r)) {
203
+ var e = Number(r);
204
+ if (e > 0)
205
+ return e;
206
+ }
207
+ },
208
+ registrar_server: function(r) {
209
+ /^sip:/i.test(r) || (r = "".concat(s.SIP, ":").concat(r));
210
+ var e = g.parse(r);
211
+ if (e)
212
+ return e.user ? void 0 : e;
213
+ },
214
+ use_preloaded_route: function(r) {
215
+ if (typeof r == "boolean")
216
+ return r;
217
+ },
218
+ extra_headers: function(r) {
219
+ var e = [];
220
+ if (Array.isArray(r) && r.length) {
221
+ var t = _(r), o;
222
+ try {
223
+ for (t.s(); !(o = t.n()).done; ) {
224
+ var i = o.value;
225
+ typeof i == "string" && e.push(i);
226
+ }
227
+ } catch (u) {
228
+ t.e(u);
229
+ } finally {
230
+ t.f();
231
+ }
232
+ } else
233
+ return;
234
+ return e;
235
+ }
236
+ }
237
+ };
238
+ return m.load = function(n, r) {
239
+ for (var e in p.mandatory)
240
+ if (r.hasOwnProperty(e)) {
241
+ var t = r[e], o = p.mandatory[e](t);
242
+ if (o !== void 0)
243
+ n[e] = o;
244
+ else
245
+ throw new d.ConfigurationError(e, t);
246
+ } else
247
+ throw new d.ConfigurationError(e);
248
+ for (var i in p.optional)
249
+ if (r.hasOwnProperty(i)) {
250
+ var u = r[i];
251
+ if (a.isEmpty(u))
252
+ continue;
253
+ var c = p.optional[i](u);
254
+ if (c !== void 0)
255
+ n[i] = c;
256
+ else
257
+ throw new d.ConfigurationError(i, u);
258
+ }
259
+ }, m;
260
+ }
261
+ export {
262
+ j as __require
263
+ };
@@ -0,0 +1,180 @@
1
+ import t from "../package.json.js";
2
+ var e, o;
3
+ function n() {
4
+ if (o) return e;
5
+ o = 1;
6
+ var E = t;
7
+ return e = {
8
+ USER_AGENT: "".concat(E.title, " ").concat(E.version),
9
+ // SIP scheme.
10
+ SIP: "sip",
11
+ SIPS: "sips",
12
+ // End and Failure causes.
13
+ causes: {
14
+ // Generic error causes.
15
+ CONNECTION_ERROR: "Connection Error",
16
+ REQUEST_TIMEOUT: "Request Timeout",
17
+ SIP_FAILURE_CODE: "SIP Failure Code",
18
+ INTERNAL_ERROR: "Internal Error",
19
+ // SIP error causes.
20
+ BUSY: "Busy",
21
+ REJECTED: "Rejected",
22
+ REDIRECTED: "Redirected",
23
+ UNAVAILABLE: "Unavailable",
24
+ NOT_FOUND: "Not Found",
25
+ ADDRESS_INCOMPLETE: "Address Incomplete",
26
+ INCOMPATIBLE_SDP: "Incompatible SDP",
27
+ MISSING_SDP: "Missing SDP",
28
+ AUTHENTICATION_ERROR: "Authentication Error",
29
+ // Session error causes.
30
+ BYE: "Terminated",
31
+ WEBRTC_ERROR: "WebRTC Error",
32
+ CANCELED: "Canceled",
33
+ NO_ANSWER: "No Answer",
34
+ EXPIRES: "Expires",
35
+ NO_ACK: "No ACK",
36
+ DIALOG_ERROR: "Dialog Error",
37
+ USER_DENIED_MEDIA_ACCESS: "User Denied Media Access",
38
+ BAD_MEDIA_DESCRIPTION: "Bad Media Description",
39
+ RTP_TIMEOUT: "RTP Timeout"
40
+ },
41
+ SIP_ERROR_CAUSES: {
42
+ REDIRECTED: [300, 301, 302, 305, 380],
43
+ BUSY: [486, 600],
44
+ REJECTED: [403, 603],
45
+ NOT_FOUND: [404, 604],
46
+ UNAVAILABLE: [480, 410, 408, 430],
47
+ ADDRESS_INCOMPLETE: [484, 424],
48
+ INCOMPATIBLE_SDP: [488, 606],
49
+ AUTHENTICATION_ERROR: [401, 407]
50
+ },
51
+ // SIP Methods.
52
+ ACK: "ACK",
53
+ BYE: "BYE",
54
+ CANCEL: "CANCEL",
55
+ INFO: "INFO",
56
+ INVITE: "INVITE",
57
+ MESSAGE: "MESSAGE",
58
+ NOTIFY: "NOTIFY",
59
+ OPTIONS: "OPTIONS",
60
+ REGISTER: "REGISTER",
61
+ REFER: "REFER",
62
+ UPDATE: "UPDATE",
63
+ SUBSCRIBE: "SUBSCRIBE",
64
+ // DTMF transport methods.
65
+ DTMF_TRANSPORT: {
66
+ INFO: "INFO",
67
+ RFC2833: "RFC2833"
68
+ },
69
+ /* SIP Response Reasons
70
+ * DOC: https://www.iana.org/assignments/sip-parameters
71
+ * Copied from https://github.com/versatica/OverSIP/blob/master/lib/oversip/sip/constants.rb#L7
72
+ */
73
+ REASON_PHRASE: {
74
+ 100: "Trying",
75
+ 180: "Ringing",
76
+ 181: "Call Is Being Forwarded",
77
+ 182: "Queued",
78
+ 183: "Session Progress",
79
+ 199: "Early Dialog Terminated",
80
+ // draft-ietf-sipcore-199
81
+ 200: "OK",
82
+ 202: "Accepted",
83
+ // RFC 3265
84
+ 204: "No Notification",
85
+ // RFC 5839
86
+ 300: "Multiple Choices",
87
+ 301: "Moved Permanently",
88
+ 302: "Moved Temporarily",
89
+ 305: "Use Proxy",
90
+ 380: "Alternative Service",
91
+ 400: "Bad Request",
92
+ 401: "Unauthorized",
93
+ 402: "Payment Required",
94
+ 403: "Forbidden",
95
+ 404: "Not Found",
96
+ 405: "Method Not Allowed",
97
+ 406: "Not Acceptable",
98
+ 407: "Proxy Authentication Required",
99
+ 408: "Request Timeout",
100
+ 410: "Gone",
101
+ 412: "Conditional Request Failed",
102
+ // RFC 3903
103
+ 413: "Request Entity Too Large",
104
+ 414: "Request-URI Too Long",
105
+ 415: "Unsupported Media Type",
106
+ 416: "Unsupported URI Scheme",
107
+ 417: "Unknown Resource-Priority",
108
+ // RFC 4412
109
+ 420: "Bad Extension",
110
+ 421: "Extension Required",
111
+ 422: "Session Interval Too Small",
112
+ // RFC 4028
113
+ 423: "Interval Too Brief",
114
+ 424: "Bad Location Information",
115
+ // RFC 6442
116
+ 428: "Use Identity Header",
117
+ // RFC 4474
118
+ 429: "Provide Referrer Identity",
119
+ // RFC 3892
120
+ 430: "Flow Failed",
121
+ // RFC 5626
122
+ 433: "Anonymity Disallowed",
123
+ // RFC 5079
124
+ 436: "Bad Identity-Info",
125
+ // RFC 4474
126
+ 437: "Unsupported Certificate",
127
+ // RFC 4744
128
+ 438: "Invalid Identity Header",
129
+ // RFC 4744
130
+ 439: "First Hop Lacks Outbound Support",
131
+ // RFC 5626
132
+ 440: "Max-Breadth Exceeded",
133
+ // RFC 5393
134
+ 469: "Bad Info Package",
135
+ // draft-ietf-sipcore-info-events
136
+ 470: "Consent Needed",
137
+ // RFC 5360
138
+ 478: "Unresolvable Destination",
139
+ // Custom code copied from Kamailio.
140
+ 480: "Temporarily Unavailable",
141
+ 481: "Call/Transaction Does Not Exist",
142
+ 482: "Loop Detected",
143
+ 483: "Too Many Hops",
144
+ 484: "Address Incomplete",
145
+ 485: "Ambiguous",
146
+ 486: "Busy Here",
147
+ 487: "Request Terminated",
148
+ 488: "Not Acceptable Here",
149
+ 489: "Bad Event",
150
+ // RFC 3265
151
+ 491: "Request Pending",
152
+ 493: "Undecipherable",
153
+ 494: "Security Agreement Required",
154
+ // RFC 3329
155
+ 500: "JsSIP Internal Error",
156
+ 501: "Not Implemented",
157
+ 502: "Bad Gateway",
158
+ 503: "Service Unavailable",
159
+ 504: "Server Time-out",
160
+ 505: "Version Not Supported",
161
+ 513: "Message Too Large",
162
+ 580: "Precondition Failure",
163
+ // RFC 3312
164
+ 600: "Busy Everywhere",
165
+ 603: "Decline",
166
+ 604: "Does Not Exist Anywhere",
167
+ 606: "Not Acceptable"
168
+ },
169
+ ALLOWED_METHODS: "INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",
170
+ ACCEPTED_BODY_TYPES: "application/sdp, application/dtmf-relay",
171
+ MAX_FORWARDS: 69,
172
+ SESSION_EXPIRES: 90,
173
+ MIN_SESSION_EXPIRES: 60,
174
+ CONNECTION_RECOVERY_MAX_INTERVAL: 30,
175
+ CONNECTION_RECOVERY_MIN_INTERVAL: 2
176
+ }, e;
177
+ }
178
+ export {
179
+ n as __require
180
+ };
@@ -0,0 +1,84 @@
1
+ import { __require as v } from "../Constants.js";
2
+ import { __require as q } from "../Transactions.js";
3
+ import { __require as R } from "../RequestSender.js";
4
+ var _, l;
5
+ function g() {
6
+ if (l) return _;
7
+ l = 1;
8
+ function f(n, s) {
9
+ if (!(n instanceof s))
10
+ throw new TypeError("Cannot call a class as a function");
11
+ }
12
+ function d(n, s) {
13
+ for (var e = 0; e < s.length; e++) {
14
+ var t = s[e];
15
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
16
+ }
17
+ }
18
+ function h(n, s, e) {
19
+ return s && d(n.prototype, s), n;
20
+ }
21
+ var o = v(), a = q(), T = R(), u = {
22
+ onRequestTimeout: function() {
23
+ },
24
+ onTransportError: function() {
25
+ },
26
+ onSuccessResponse: function() {
27
+ },
28
+ onErrorResponse: function() {
29
+ },
30
+ onAuthenticated: function() {
31
+ },
32
+ onDialogError: function() {
33
+ }
34
+ };
35
+ return _ = /* @__PURE__ */ function() {
36
+ function n(s, e, t) {
37
+ f(this, n), this._dialog = s, this._ua = s._ua, this._request = e, this._eventHandlers = t, this._reattempt = !1, this._reattemptTimer = null;
38
+ for (var r in u)
39
+ Object.prototype.hasOwnProperty.call(u, r) && (this._eventHandlers[r] || (this._eventHandlers[r] = u[r]));
40
+ }
41
+ return h(n, [{
42
+ key: "send",
43
+ value: function() {
44
+ var e = this, t = new T(this._ua, this._request, {
45
+ onRequestTimeout: function() {
46
+ e._eventHandlers.onRequestTimeout();
47
+ },
48
+ onTransportError: function() {
49
+ e._eventHandlers.onTransportError();
50
+ },
51
+ onAuthenticated: function(c) {
52
+ e._eventHandlers.onAuthenticated(c);
53
+ },
54
+ onReceiveResponse: function(c) {
55
+ e._receiveResponse(c);
56
+ }
57
+ });
58
+ if (t.send(), (this._request.method === o.INVITE || this._request.method === o.UPDATE && this._request.body) && t.clientTransaction.state !== a.C.STATUS_TERMINATED) {
59
+ this._dialog.uac_pending_reply = !0;
60
+ var r = function i() {
61
+ (t.clientTransaction.state === a.C.STATUS_ACCEPTED || t.clientTransaction.state === a.C.STATUS_COMPLETED || t.clientTransaction.state === a.C.STATUS_TERMINATED) && (t.clientTransaction.removeListener("stateChanged", i), e._dialog.uac_pending_reply = !1);
62
+ };
63
+ t.clientTransaction.on("stateChanged", r);
64
+ }
65
+ }
66
+ }, {
67
+ key: "_receiveResponse",
68
+ value: function(e) {
69
+ var t = this;
70
+ e.status_code === 408 || e.status_code === 481 ? this._eventHandlers.onDialogError(e) : e.method === o.INVITE && e.status_code === 491 ? this._reattempt ? e.status_code >= 200 && e.status_code < 300 ? this._eventHandlers.onSuccessResponse(e) : e.status_code >= 300 && this._eventHandlers.onErrorResponse(e) : (this._request.cseq = this._dialog.local_seqnum += 1, this._reattemptTimer = setTimeout(function() {
71
+ t._dialog.isTerminated() || (t._reattempt = !0, t.send());
72
+ }, 1e3)) : e.status_code >= 200 && e.status_code < 300 ? this._eventHandlers.onSuccessResponse(e) : e.status_code >= 300 && this._eventHandlers.onErrorResponse(e);
73
+ }
74
+ }, {
75
+ key: "request",
76
+ get: function() {
77
+ return this._request;
78
+ }
79
+ }]), n;
80
+ }(), _;
81
+ }
82
+ export {
83
+ g as __require
84
+ };