module-develop-kit 0.5.10 → 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 (163) 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/{vite-plugins/index.es.js → commonjs-virtual-dir/_virtual_mobile-compatibility-detection.js} +2 -31
  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.js +6 -0
  162. package/package.json +6 -5
  163. package/dist/index.es.js +0 -18159
@@ -0,0 +1,194 @@
1
+ import { __require as P } from "./Logger.js";
2
+ import { __require as k } from "./Utils.js";
3
+ import { __require as y } from "./Constants.js";
4
+ import { __require as O } from "./SIPMessage.js";
5
+ import { __require as S } from "./RequestSender.js";
6
+ var m, T;
7
+ function A() {
8
+ if (T) return m;
9
+ T = 1;
10
+ function E(a, r) {
11
+ if (!(a instanceof r))
12
+ throw new TypeError("Cannot call a class as a function");
13
+ }
14
+ function p(a, r) {
15
+ for (var e = 0; e < r.length; e++) {
16
+ var t = r[e];
17
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(a, t.key, t);
18
+ }
19
+ }
20
+ function q(a, r, e) {
21
+ return r && p(a.prototype, r), a;
22
+ }
23
+ var C = P(), f = k(), _ = y(), R = O(), v = S(), g = new C("Registrator"), h = 10;
24
+ return m = /* @__PURE__ */ function() {
25
+ function a(r, e) {
26
+ E(this, a), this._reg_id = 1, this._ua = r, this._transport = e, this._registrar = r.configuration.registrar_server, this._expires = r.configuration.register_expires, this._call_id = f.createRandomToken(22), this._cseq = 0, this._to_uri = r.configuration.uri, this._registrationTimer = null, this._registering = !1, this._registered = !1, this._contact = this._ua.contact.toString(), this._contact += ";+sip.ice", this._extraHeaders = [], this._extraContactParams = "", this._sipInstance = '"<urn:uuid:'.concat(this._ua.configuration.instance_id, '>"'), this._contact += ";reg-id=".concat(this._reg_id), this._contact += ";+sip.instance=".concat(this._sipInstance);
27
+ }
28
+ return q(a, [{
29
+ key: "setExtraHeaders",
30
+ value: function(e) {
31
+ Array.isArray(e) || (e = []), this._extraHeaders = e.slice();
32
+ }
33
+ }, {
34
+ key: "setExtraContactParams",
35
+ value: function(e) {
36
+ e instanceof Object || (e = {}), this._extraContactParams = "";
37
+ for (var t in e)
38
+ if (Object.prototype.hasOwnProperty.call(e, t)) {
39
+ var u = e[t];
40
+ this._extraContactParams += ";".concat(t), u && (this._extraContactParams += "=".concat(u));
41
+ }
42
+ }
43
+ }, {
44
+ key: "register",
45
+ value: function() {
46
+ var e = this;
47
+ if (this._registering) {
48
+ g.debug("Register request in progress...");
49
+ return;
50
+ }
51
+ var t = this._extraHeaders.slice();
52
+ t.push("Contact: ".concat(this._contact, ";expires=").concat(this._expires).concat(this._extraContactParams)), t.push("Expires: ".concat(this._expires));
53
+ var u = new R.OutgoingRequest(_.REGISTER, this._registrar, this._ua, {
54
+ to_uri: this._to_uri,
55
+ call_id: this._call_id,
56
+ cseq: this._cseq += 1
57
+ }, t), d = new v(this._ua, u, {
58
+ onRequestTimeout: function() {
59
+ e._registrationFailure(null, _.causes.REQUEST_TIMEOUT);
60
+ },
61
+ onTransportError: function() {
62
+ e._registrationFailure(null, _.causes.CONNECTION_ERROR);
63
+ },
64
+ // Increase the CSeq on authentication.
65
+ onAuthenticated: function() {
66
+ e._cseq += 1;
67
+ },
68
+ onReceiveResponse: function(i) {
69
+ if (i.cseq === e._cseq)
70
+ switch (e._registrationTimer !== null && (clearTimeout(e._registrationTimer), e._registrationTimer = null), !0) {
71
+ case /^1[0-9]{2}$/.test(i.status_code):
72
+ break;
73
+ case /^2[0-9]{2}$/.test(i.status_code): {
74
+ if (e._registering = !1, !i.hasHeader("Contact")) {
75
+ g.debug("no Contact header in response to REGISTER, response ignored");
76
+ break;
77
+ }
78
+ var o = i.headers.Contact.reduce(function(c, I) {
79
+ return c.concat(I.parsed);
80
+ }, []), n = o.find(function(c) {
81
+ return e._sipInstance === c.getParam("+sip.instance") && e._reg_id === parseInt(c.getParam("reg-id"));
82
+ });
83
+ if (n || (n = o.find(function(c) {
84
+ return c.uri.user === e._ua.contact.uri.user;
85
+ })), !n) {
86
+ g.debug("no Contact header pointing to us, response ignored");
87
+ break;
88
+ }
89
+ var s = n.getParam("expires");
90
+ !s && i.hasHeader("expires") && (s = i.getHeader("expires")), s || (s = e._expires), s = Number(s), s < h && (s = h);
91
+ var b = s > 64 ? s * 1e3 / 2 + Math.floor((s / 2 - 32) * 1e3 * Math.random()) : s * 1e3 - 5e3;
92
+ e._registrationTimer = setTimeout(function() {
93
+ e._registrationTimer = null, e._ua.listeners("registrationExpiring").length === 0 ? e.register() : e._ua.emit("registrationExpiring");
94
+ }, b), n.hasParam("temp-gruu") && (e._ua.contact.temp_gruu = n.getParam("temp-gruu").replace(/"/g, "")), n.hasParam("pub-gruu") && (e._ua.contact.pub_gruu = n.getParam("pub-gruu").replace(/"/g, "")), e._registered || (e._registered = !0, e._ua.registered({
95
+ response: i
96
+ }));
97
+ break;
98
+ }
99
+ // Interval too brief RFC3261 10.2.8.
100
+ case /^423$/.test(i.status_code): {
101
+ i.hasHeader("min-expires") ? (e._expires = Number(i.getHeader("min-expires")), e._expires < h && (e._expires = h), e.register()) : (g.debug("423 response received for REGISTER without Min-Expires"), e._registrationFailure(i, _.causes.SIP_FAILURE_CODE));
102
+ break;
103
+ }
104
+ default: {
105
+ var x = f.sipErrorCause(i.status_code);
106
+ e._registrationFailure(i, x);
107
+ }
108
+ }
109
+ }
110
+ });
111
+ this._registering = !0, d.send();
112
+ }
113
+ }, {
114
+ key: "unregister",
115
+ value: function() {
116
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
117
+ if (!this._registered) {
118
+ g.debug("already unregistered");
119
+ return;
120
+ }
121
+ this._registered = !1, this._registrationTimer !== null && (clearTimeout(this._registrationTimer), this._registrationTimer = null);
122
+ var u = this._extraHeaders.slice();
123
+ t.all ? u.push("Contact: *".concat(this._extraContactParams)) : u.push("Contact: ".concat(this._contact, ";expires=0").concat(this._extraContactParams)), u.push("Expires: 0");
124
+ var d = new R.OutgoingRequest(_.REGISTER, this._registrar, this._ua, {
125
+ to_uri: this._to_uri,
126
+ call_id: this._call_id,
127
+ cseq: this._cseq += 1
128
+ }, u), l = new v(this._ua, d, {
129
+ onRequestTimeout: function() {
130
+ e._unregistered(null, _.causes.REQUEST_TIMEOUT);
131
+ },
132
+ onTransportError: function() {
133
+ e._unregistered(null, _.causes.CONNECTION_ERROR);
134
+ },
135
+ // Increase the CSeq on authentication.
136
+ onAuthenticated: function() {
137
+ e._cseq += 1;
138
+ },
139
+ onReceiveResponse: function(o) {
140
+ switch (!0) {
141
+ case /^1[0-9]{2}$/.test(o.status_code):
142
+ break;
143
+ case /^2[0-9]{2}$/.test(o.status_code):
144
+ e._unregistered(o);
145
+ break;
146
+ default: {
147
+ var n = f.sipErrorCause(o.status_code);
148
+ e._unregistered(o, n);
149
+ }
150
+ }
151
+ }
152
+ });
153
+ l.send();
154
+ }
155
+ }, {
156
+ key: "close",
157
+ value: function() {
158
+ this._registered && this.unregister();
159
+ }
160
+ }, {
161
+ key: "onTransportClosed",
162
+ value: function() {
163
+ this._registering = !1, this._registrationTimer !== null && (clearTimeout(this._registrationTimer), this._registrationTimer = null), this._registered && (this._registered = !1, this._ua.unregistered({}));
164
+ }
165
+ }, {
166
+ key: "_registrationFailure",
167
+ value: function(e, t) {
168
+ this._registering = !1, this._ua.registrationFailed({
169
+ response: e || null,
170
+ cause: t
171
+ }), this._registered && (this._registered = !1, this._ua.unregistered({
172
+ response: e || null,
173
+ cause: t
174
+ }));
175
+ }
176
+ }, {
177
+ key: "_unregistered",
178
+ value: function(e, t) {
179
+ this._registering = !1, this._registered = !1, this._ua.unregistered({
180
+ response: e || null,
181
+ cause: t || null
182
+ });
183
+ }
184
+ }, {
185
+ key: "registered",
186
+ get: function() {
187
+ return this._registered;
188
+ }
189
+ }]), a;
190
+ }(), m;
191
+ }
192
+ export {
193
+ A as __require
194
+ };
@@ -0,0 +1,99 @@
1
+ import { __require as R } from "./Logger.js";
2
+ import { __require as g } from "./Constants.js";
3
+ import { __require as m } from "./DigestAuthentication.js";
4
+ import { __require as T } from "./Transactions.js";
5
+ var u, _;
6
+ function E() {
7
+ if (_) return u;
8
+ _ = 1;
9
+ function c(n, i) {
10
+ if (!(n instanceof i))
11
+ throw new TypeError("Cannot call a class as a function");
12
+ }
13
+ function l(n, i) {
14
+ for (var e = 0; e < i.length; e++) {
15
+ var t = i[e];
16
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
17
+ }
18
+ }
19
+ function f(n, i, e) {
20
+ return i && l(n.prototype, i), n;
21
+ }
22
+ var d = R(), h = g(), v = m(), r = T(), q = new d("RequestSender"), o = {
23
+ onRequestTimeout: function() {
24
+ },
25
+ onTransportError: function() {
26
+ },
27
+ onReceiveResponse: function() {
28
+ },
29
+ onAuthenticated: function() {
30
+ }
31
+ };
32
+ return u = /* @__PURE__ */ function() {
33
+ function n(i, e, t) {
34
+ c(this, n), this._ua = i, this._eventHandlers = t, this._method = e.method, this._request = e, this._auth = null, this._challenged = !1, this._staled = !1;
35
+ for (var s in o)
36
+ Object.prototype.hasOwnProperty.call(o, s) && (this._eventHandlers[s] || (this._eventHandlers[s] = o[s]));
37
+ i.status === i.C.STATUS_USER_CLOSED && (this._method !== h.BYE || this._method !== h.ACK) && this._eventHandlers.onTransportError();
38
+ }
39
+ return f(n, [{
40
+ key: "send",
41
+ value: function() {
42
+ var e = this, t = {
43
+ onRequestTimeout: function() {
44
+ e._eventHandlers.onRequestTimeout();
45
+ },
46
+ onTransportError: function() {
47
+ e._eventHandlers.onTransportError();
48
+ },
49
+ onReceiveResponse: function(a) {
50
+ e._receiveResponse(a);
51
+ }
52
+ };
53
+ switch (this._method) {
54
+ case "INVITE":
55
+ this.clientTransaction = new r.InviteClientTransaction(this._ua, this._ua.transport, this._request, t);
56
+ break;
57
+ case "ACK":
58
+ this.clientTransaction = new r.AckClientTransaction(this._ua, this._ua.transport, this._request, t);
59
+ break;
60
+ default:
61
+ this.clientTransaction = new r.NonInviteClientTransaction(this._ua, this._ua.transport, this._request, t);
62
+ }
63
+ this._ua._configuration.authorization_jwt && this._request.setHeader("Authorization", this._ua._configuration.authorization_jwt), this.clientTransaction.send();
64
+ }
65
+ /**
66
+ * Called from client transaction when receiving a correct response to the request.
67
+ * Authenticate request if needed or pass the response back to the applicant.
68
+ */
69
+ }, {
70
+ key: "_receiveResponse",
71
+ value: function(e) {
72
+ var t, s, a = e.status_code;
73
+ if ((a === 401 || a === 407) && (this._ua.configuration.password !== null || this._ua.configuration.ha1 !== null)) {
74
+ if (e.status_code === 401 ? (t = e.parseHeader("www-authenticate"), s = "authorization") : (t = e.parseHeader("proxy-authenticate"), s = "proxy-authorization"), !t) {
75
+ q.debug("".concat(e.status_code, " with wrong or missing challenge, cannot authenticate")), this._eventHandlers.onReceiveResponse(e);
76
+ return;
77
+ }
78
+ if (!this._challenged || !this._staled && t.stale === !0) {
79
+ if (this._auth || (this._auth = new v({
80
+ username: this._ua.configuration.authorization_user,
81
+ password: this._ua.configuration.password,
82
+ realm: this._ua.configuration.realm,
83
+ ha1: this._ua.configuration.ha1
84
+ })), !this._auth.authenticate(this._request, t)) {
85
+ this._eventHandlers.onReceiveResponse(e);
86
+ return;
87
+ }
88
+ this._challenged = !0, this._ua.set("realm", this._auth.get("realm")), this._ua.set("ha1", this._auth.get("ha1")), t.stale && (this._staled = !0), this._request = this._request.clone(), this._request.cseq += 1, this._request.setHeader("cseq", "".concat(this._request.cseq, " ").concat(this._method)), this._request.setHeader(s, this._auth.toString()), this._eventHandlers.onAuthenticated(this._request), this.send();
89
+ } else
90
+ this._eventHandlers.onReceiveResponse(e);
91
+ } else
92
+ this._eventHandlers.onReceiveResponse(e);
93
+ }
94
+ }]), n;
95
+ }(), u;
96
+ }
97
+ export {
98
+ E as __require
99
+ };