@shenyin/embedded-call-widget 2.3.0 → 2.4.0
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.
- package/README.md +31 -39
- package/checksums.txt +5 -5
- package/embedded-call-widget-runtime.iife.js +8 -8
- package/embedded-call-widget-runtime.js +261 -246
- package/embedded-call-widget.iife.js +4 -4
- package/embedded-call-widget.js +18 -16
- package/manifest.json +19 -21
- package/package.json +1 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const lt = "0.21.1";
|
|
2
2
|
class de extends Error {
|
|
3
3
|
constructor(e) {
|
|
4
4
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
@@ -15,7 +15,7 @@ class we extends de {
|
|
|
15
15
|
super(e || "Request pending.");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class ht extends de {
|
|
19
19
|
constructor(e) {
|
|
20
20
|
super(e || "Unspecified session description handler error.");
|
|
21
21
|
}
|
|
@@ -355,9 +355,9 @@ function Ge(a, e) {
|
|
|
355
355
|
function ke(a, e, t) {
|
|
356
356
|
return t = t || " ", a.length > e ? a : (e -= a.length, t += t.repeat(e), a + t.slice(0, e));
|
|
357
357
|
}
|
|
358
|
-
class
|
|
358
|
+
class le extends Error {
|
|
359
359
|
constructor(e, t, s, i) {
|
|
360
|
-
super(), this.message = e, this.expected = t, this.found = s, this.location = i, this.name = "SyntaxError", typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(this,
|
|
360
|
+
super(), this.message = e, this.expected = t, this.found = s, this.location = i, this.name = "SyntaxError", typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(this, le.prototype) : this.__proto__ = le.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, le);
|
|
361
361
|
}
|
|
362
362
|
static buildMessage(e, t) {
|
|
363
363
|
function s(p) {
|
|
@@ -564,8 +564,8 @@ function mt(a, e) {
|
|
|
564
564
|
$([["*", "["]], !1, !1),
|
|
565
565
|
/^[\]-~]/,
|
|
566
566
|
$([["]", "~"]], !1, !1),
|
|
567
|
-
function(
|
|
568
|
-
return
|
|
567
|
+
function(l) {
|
|
568
|
+
return l;
|
|
569
569
|
},
|
|
570
570
|
/^[#-[]/,
|
|
571
571
|
$([["#", "["]], !1, !1),
|
|
@@ -585,8 +585,8 @@ function mt(a, e) {
|
|
|
585
585
|
f("sips", !0),
|
|
586
586
|
"sip",
|
|
587
587
|
f("sip", !0),
|
|
588
|
-
function(
|
|
589
|
-
e = e || { data: {} }, e.data.scheme =
|
|
588
|
+
function(l) {
|
|
589
|
+
e = e || { data: {} }, e.data.scheme = l;
|
|
590
590
|
},
|
|
591
591
|
function() {
|
|
592
592
|
e = e || { data: {} }, e.data.user = decodeURIComponent(C().slice(0, -1));
|
|
@@ -627,8 +627,8 @@ function mt(a, e) {
|
|
|
627
627
|
f("1", !1),
|
|
628
628
|
/^[1-9]/,
|
|
629
629
|
$([["1", "9"]], !1, !1),
|
|
630
|
-
function(
|
|
631
|
-
return e = e || { data: {} },
|
|
630
|
+
function(l) {
|
|
631
|
+
return e = e || { data: {} }, l = parseInt(l.join("")), e.data.port = l, l;
|
|
632
632
|
},
|
|
633
633
|
"transport=",
|
|
634
634
|
f("transport=", !0),
|
|
@@ -640,8 +640,8 @@ function mt(a, e) {
|
|
|
640
640
|
f("sctp", !0),
|
|
641
641
|
"tls",
|
|
642
642
|
f("tls", !0),
|
|
643
|
-
function(
|
|
644
|
-
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.transport =
|
|
643
|
+
function(l) {
|
|
644
|
+
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.transport = l.toLowerCase();
|
|
645
645
|
},
|
|
646
646
|
"user=",
|
|
647
647
|
f("user=", !0),
|
|
@@ -649,34 +649,34 @@ function mt(a, e) {
|
|
|
649
649
|
f("phone", !0),
|
|
650
650
|
"ip",
|
|
651
651
|
f("ip", !0),
|
|
652
|
-
function(
|
|
653
|
-
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.user =
|
|
652
|
+
function(l) {
|
|
653
|
+
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.user = l.toLowerCase();
|
|
654
654
|
},
|
|
655
655
|
"method=",
|
|
656
656
|
f("method=", !0),
|
|
657
|
-
function(
|
|
658
|
-
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.method =
|
|
657
|
+
function(l) {
|
|
658
|
+
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.method = l;
|
|
659
659
|
},
|
|
660
660
|
"ttl=",
|
|
661
661
|
f("ttl=", !0),
|
|
662
|
-
function(
|
|
663
|
-
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.ttl =
|
|
662
|
+
function(l) {
|
|
663
|
+
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.ttl = l;
|
|
664
664
|
},
|
|
665
665
|
"maddr=",
|
|
666
666
|
f("maddr=", !0),
|
|
667
|
-
function(
|
|
668
|
-
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.maddr =
|
|
667
|
+
function(l) {
|
|
668
|
+
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.maddr = l;
|
|
669
669
|
},
|
|
670
670
|
"lr",
|
|
671
671
|
f("lr", !0),
|
|
672
672
|
function() {
|
|
673
673
|
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), e.data.uri_params.lr = void 0;
|
|
674
674
|
},
|
|
675
|
-
function(
|
|
676
|
-
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), b === null ? b = void 0 : b = b[1], e.data.uri_params[
|
|
675
|
+
function(l, b) {
|
|
676
|
+
e = e || { data: {} }, e.data.uri_params || (e.data.uri_params = {}), b === null ? b = void 0 : b = b[1], e.data.uri_params[l.toLowerCase()] = b;
|
|
677
677
|
},
|
|
678
|
-
function(
|
|
679
|
-
|
|
678
|
+
function(l, b) {
|
|
679
|
+
l = l.join("").toLowerCase(), b = b.join(""), e = e || { data: {} }, e.data.uri_headers || (e.data.uri_headers = {}), e.data.uri_headers[l] ? e.data.uri_headers[l].push(b) : e.data.uri_headers[l] = [b];
|
|
680
680
|
},
|
|
681
681
|
function() {
|
|
682
682
|
e = e || { data: {} }, e.startRule === "Refer_To" && (e.data.uri = new z(e.data.scheme, e.data.user, e.data.host, e.data.port, e.data.uri_params, e.data.uri_headers), delete e.data.scheme, delete e.data.user, delete e.data.host, delete e.data.host_type, delete e.data.port, delete e.data.uri_params);
|
|
@@ -715,8 +715,8 @@ function mt(a, e) {
|
|
|
715
715
|
function() {
|
|
716
716
|
return e = e || { data: {} }, e.data.method = C(), e.data.method;
|
|
717
717
|
},
|
|
718
|
-
function(
|
|
719
|
-
e = e || { data: {} }, e.data.status_code = parseInt(
|
|
718
|
+
function(l) {
|
|
719
|
+
e = e || { data: {} }, e.data.status_code = parseInt(l.join(""));
|
|
720
720
|
},
|
|
721
721
|
function() {
|
|
722
722
|
e = e || { data: {} }, e.data.reason_phrase = C();
|
|
@@ -725,51 +725,51 @@ function mt(a, e) {
|
|
|
725
725
|
e = e || { data: {} }, e.data = C();
|
|
726
726
|
},
|
|
727
727
|
function() {
|
|
728
|
-
var
|
|
729
|
-
for (e = e || { data: {} }, b = e.data.multi_header.length,
|
|
730
|
-
if (e.data.multi_header[
|
|
728
|
+
var l, b;
|
|
729
|
+
for (e = e || { data: {} }, b = e.data.multi_header.length, l = 0; l < b; l++)
|
|
730
|
+
if (e.data.multi_header[l].parsed === null) {
|
|
731
731
|
e.data = null;
|
|
732
732
|
break;
|
|
733
733
|
}
|
|
734
734
|
e.data !== null ? e.data = e.data.multi_header : e.data = -1;
|
|
735
735
|
},
|
|
736
736
|
function() {
|
|
737
|
-
var
|
|
737
|
+
var l;
|
|
738
738
|
e = e || { data: {} }, e.data.multi_header || (e.data.multi_header = []);
|
|
739
739
|
try {
|
|
740
|
-
|
|
740
|
+
l = new O(e.data.uri, e.data.displayName, e.data.params), delete e.data.uri, delete e.data.displayName, delete e.data.params;
|
|
741
741
|
} catch {
|
|
742
|
-
|
|
742
|
+
l = null;
|
|
743
743
|
}
|
|
744
744
|
e.data.multi_header.push({
|
|
745
745
|
position: d,
|
|
746
746
|
offset: ne().start.offset,
|
|
747
|
-
parsed:
|
|
747
|
+
parsed: l
|
|
748
748
|
});
|
|
749
749
|
},
|
|
750
|
-
function(
|
|
751
|
-
|
|
750
|
+
function(l) {
|
|
751
|
+
l = C().trim(), l[0] === '"' && (l = l.substring(1, l.length - 1)), e = e || { data: {} }, e.data.displayName = l;
|
|
752
752
|
},
|
|
753
753
|
"q",
|
|
754
754
|
f("q", !0),
|
|
755
|
-
function(
|
|
756
|
-
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.q =
|
|
755
|
+
function(l) {
|
|
756
|
+
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.q = l;
|
|
757
757
|
},
|
|
758
758
|
"expires",
|
|
759
759
|
f("expires", !0),
|
|
760
|
-
function(
|
|
761
|
-
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.expires =
|
|
760
|
+
function(l) {
|
|
761
|
+
e = e || { data: {} }, e.data.params || (e.data.params = {}), e.data.params.expires = l;
|
|
762
762
|
},
|
|
763
|
-
function(
|
|
764
|
-
return parseInt(
|
|
763
|
+
function(l) {
|
|
764
|
+
return parseInt(l.join(""));
|
|
765
765
|
},
|
|
766
766
|
"0",
|
|
767
767
|
f("0", !1),
|
|
768
768
|
function() {
|
|
769
769
|
return parseFloat(C());
|
|
770
770
|
},
|
|
771
|
-
function(
|
|
772
|
-
e = e || { data: {} }, e.data.params || (e.data.params = {}), b === null ? b = void 0 : b = b[1], e.data.params[
|
|
771
|
+
function(l, b) {
|
|
772
|
+
e = e || { data: {} }, e.data.params || (e.data.params = {}), b === null ? b = void 0 : b = b[1], e.data.params[l.toLowerCase()] = b;
|
|
773
773
|
},
|
|
774
774
|
"render",
|
|
775
775
|
f("render", !0),
|
|
@@ -788,8 +788,8 @@ function mt(a, e) {
|
|
|
788
788
|
f("optional", !0),
|
|
789
789
|
"required",
|
|
790
790
|
f("required", !0),
|
|
791
|
-
function(
|
|
792
|
-
e = e || { data: {} }, e.data = parseInt(
|
|
791
|
+
function(l) {
|
|
792
|
+
e = e || { data: {} }, e.data = parseInt(l.join(""));
|
|
793
793
|
},
|
|
794
794
|
function() {
|
|
795
795
|
e = e || { data: {} }, e.data = C();
|
|
@@ -810,30 +810,30 @@ function mt(a, e) {
|
|
|
810
810
|
f("multipart", !0),
|
|
811
811
|
"x-",
|
|
812
812
|
f("x-", !0),
|
|
813
|
-
function(
|
|
814
|
-
e = e || { data: {} }, e.data.value = parseInt(
|
|
813
|
+
function(l) {
|
|
814
|
+
e = e || { data: {} }, e.data.value = parseInt(l.join(""));
|
|
815
815
|
},
|
|
816
|
-
function(
|
|
817
|
-
e = e || { data: {} }, e.data =
|
|
816
|
+
function(l) {
|
|
817
|
+
e = e || { data: {} }, e.data = l;
|
|
818
818
|
},
|
|
819
|
-
function(
|
|
820
|
-
e = e || { data: {} }, e.data.event =
|
|
819
|
+
function(l) {
|
|
820
|
+
e = e || { data: {} }, e.data.event = l.toLowerCase();
|
|
821
821
|
},
|
|
822
822
|
function() {
|
|
823
823
|
e = e || { data: {} };
|
|
824
|
-
var
|
|
825
|
-
e.data = new O(e.data.uri, e.data.displayName, e.data.params),
|
|
824
|
+
var l = e.data.tag;
|
|
825
|
+
e.data = new O(e.data.uri, e.data.displayName, e.data.params), l && e.data.setParam("tag", l);
|
|
826
826
|
},
|
|
827
827
|
"tag",
|
|
828
828
|
f("tag", !0),
|
|
829
|
-
function(
|
|
830
|
-
e = e || { data: {} }, e.data.tag =
|
|
829
|
+
function(l) {
|
|
830
|
+
e = e || { data: {} }, e.data.tag = l;
|
|
831
831
|
},
|
|
832
|
-
function(
|
|
833
|
-
e = e || { data: {} }, e.data = parseInt(
|
|
832
|
+
function(l) {
|
|
833
|
+
e = e || { data: {} }, e.data = parseInt(l.join(""));
|
|
834
834
|
},
|
|
835
|
-
function(
|
|
836
|
-
e = e || { data: {} }, e.data =
|
|
835
|
+
function(l) {
|
|
836
|
+
e = e || { data: {} }, e.data = l;
|
|
837
837
|
},
|
|
838
838
|
function() {
|
|
839
839
|
e = e || { data: {} }, e.data = new O(e.data.uri, e.data.displayName, e.data.params);
|
|
@@ -842,20 +842,20 @@ function mt(a, e) {
|
|
|
842
842
|
f("Digest", !0),
|
|
843
843
|
"realm",
|
|
844
844
|
f("realm", !0),
|
|
845
|
-
function(
|
|
846
|
-
e = e || { data: {} }, e.data.realm =
|
|
845
|
+
function(l) {
|
|
846
|
+
e = e || { data: {} }, e.data.realm = l;
|
|
847
847
|
},
|
|
848
848
|
"domain",
|
|
849
849
|
f("domain", !0),
|
|
850
850
|
"nonce",
|
|
851
851
|
f("nonce", !0),
|
|
852
|
-
function(
|
|
853
|
-
e = e || { data: {} }, e.data.nonce =
|
|
852
|
+
function(l) {
|
|
853
|
+
e = e || { data: {} }, e.data.nonce = l;
|
|
854
854
|
},
|
|
855
855
|
"opaque",
|
|
856
856
|
f("opaque", !0),
|
|
857
|
-
function(
|
|
858
|
-
e = e || { data: {} }, e.data.opaque =
|
|
857
|
+
function(l) {
|
|
858
|
+
e = e || { data: {} }, e.data.opaque = l;
|
|
859
859
|
},
|
|
860
860
|
"stale",
|
|
861
861
|
f("stale", !0),
|
|
@@ -875,8 +875,8 @@ function mt(a, e) {
|
|
|
875
875
|
f("MD5", !0),
|
|
876
876
|
"md5-sess",
|
|
877
877
|
f("MD5-sess", !0),
|
|
878
|
-
function(
|
|
879
|
-
e = e || { data: {} }, e.data.algorithm =
|
|
878
|
+
function(l) {
|
|
879
|
+
e = e || { data: {} }, e.data.algorithm = l.toUpperCase();
|
|
880
880
|
},
|
|
881
881
|
"qop",
|
|
882
882
|
f("qop", !0),
|
|
@@ -884,33 +884,33 @@ function mt(a, e) {
|
|
|
884
884
|
f("auth-int", !0),
|
|
885
885
|
"auth",
|
|
886
886
|
f("auth", !0),
|
|
887
|
-
function(
|
|
888
|
-
e = e || { data: {} }, e.data.qop || (e.data.qop = []), e.data.qop.push(
|
|
887
|
+
function(l) {
|
|
888
|
+
e = e || { data: {} }, e.data.qop || (e.data.qop = []), e.data.qop.push(l.toLowerCase());
|
|
889
889
|
},
|
|
890
|
-
function(
|
|
891
|
-
e = e || { data: {} }, e.data.value = parseInt(
|
|
890
|
+
function(l) {
|
|
891
|
+
e = e || { data: {} }, e.data.value = parseInt(l.join(""));
|
|
892
892
|
},
|
|
893
893
|
function() {
|
|
894
|
-
var
|
|
895
|
-
for (e = e || { data: {} }, b = e.data.multi_header.length,
|
|
896
|
-
if (e.data.multi_header[
|
|
894
|
+
var l, b;
|
|
895
|
+
for (e = e || { data: {} }, b = e.data.multi_header.length, l = 0; l < b; l++)
|
|
896
|
+
if (e.data.multi_header[l].parsed === null) {
|
|
897
897
|
e.data = null;
|
|
898
898
|
break;
|
|
899
899
|
}
|
|
900
900
|
e.data !== null ? e.data = e.data.multi_header : e.data = -1;
|
|
901
901
|
},
|
|
902
902
|
function() {
|
|
903
|
-
var
|
|
903
|
+
var l;
|
|
904
904
|
e = e || { data: {} }, e.data.multi_header || (e.data.multi_header = []);
|
|
905
905
|
try {
|
|
906
|
-
|
|
906
|
+
l = new O(e.data.uri, e.data.displayName, e.data.params), delete e.data.uri, delete e.data.displayName, delete e.data.params;
|
|
907
907
|
} catch {
|
|
908
|
-
|
|
908
|
+
l = null;
|
|
909
909
|
}
|
|
910
910
|
e.data.multi_header.push({
|
|
911
911
|
position: d,
|
|
912
912
|
offset: ne().start.offset,
|
|
913
|
-
parsed:
|
|
913
|
+
parsed: l
|
|
914
914
|
});
|
|
915
915
|
},
|
|
916
916
|
function() {
|
|
@@ -926,30 +926,30 @@ function mt(a, e) {
|
|
|
926
926
|
},
|
|
927
927
|
"from-tag",
|
|
928
928
|
f("from-tag", !0),
|
|
929
|
-
function(
|
|
930
|
-
e = e || { data: {} }, e.data.replaces_from_tag =
|
|
929
|
+
function(l) {
|
|
930
|
+
e = e || { data: {} }, e.data.replaces_from_tag = l;
|
|
931
931
|
},
|
|
932
932
|
"to-tag",
|
|
933
933
|
f("to-tag", !0),
|
|
934
|
-
function(
|
|
935
|
-
e = e || { data: {} }, e.data.replaces_to_tag =
|
|
934
|
+
function(l) {
|
|
935
|
+
e = e || { data: {} }, e.data.replaces_to_tag = l;
|
|
936
936
|
},
|
|
937
937
|
"early-only",
|
|
938
938
|
f("early-only", !0),
|
|
939
939
|
function() {
|
|
940
940
|
e = e || { data: {} }, e.data.early_only = !0;
|
|
941
941
|
},
|
|
942
|
-
function(
|
|
942
|
+
function(l, b) {
|
|
943
943
|
return b;
|
|
944
944
|
},
|
|
945
|
-
function(
|
|
946
|
-
return ct(
|
|
945
|
+
function(l, b) {
|
|
946
|
+
return ct(l, b);
|
|
947
947
|
},
|
|
948
|
-
function(
|
|
949
|
-
e = e || { data: {} }, e.startRule === "Require" && (e.data =
|
|
948
|
+
function(l) {
|
|
949
|
+
e = e || { data: {} }, e.startRule === "Require" && (e.data = l || []);
|
|
950
950
|
},
|
|
951
|
-
function(
|
|
952
|
-
e = e || { data: {} }, e.data.value = parseInt(
|
|
951
|
+
function(l) {
|
|
952
|
+
e = e || { data: {} }, e.data.value = parseInt(l.join(""));
|
|
953
953
|
},
|
|
954
954
|
"active",
|
|
955
955
|
f("active", !0),
|
|
@@ -962,16 +962,16 @@ function mt(a, e) {
|
|
|
962
962
|
},
|
|
963
963
|
"reason",
|
|
964
964
|
f("reason", !0),
|
|
965
|
-
function(
|
|
966
|
-
e = e || { data: {} }, typeof
|
|
965
|
+
function(l) {
|
|
966
|
+
e = e || { data: {} }, typeof l < "u" && (e.data.reason = l);
|
|
967
967
|
},
|
|
968
|
-
function(
|
|
969
|
-
e = e || { data: {} }, typeof
|
|
968
|
+
function(l) {
|
|
969
|
+
e = e || { data: {} }, typeof l < "u" && (e.data.expires = l);
|
|
970
970
|
},
|
|
971
971
|
"retry_after",
|
|
972
972
|
f("retry_after", !0),
|
|
973
|
-
function(
|
|
974
|
-
e = e || { data: {} }, typeof
|
|
973
|
+
function(l) {
|
|
974
|
+
e = e || { data: {} }, typeof l < "u" && (e.data.retry_after = l);
|
|
975
975
|
},
|
|
976
976
|
"deactivated",
|
|
977
977
|
f("deactivated", !0),
|
|
@@ -987,60 +987,60 @@ function mt(a, e) {
|
|
|
987
987
|
f("noresource", !0),
|
|
988
988
|
"invariant",
|
|
989
989
|
f("invariant", !0),
|
|
990
|
-
function(
|
|
991
|
-
e = e || { data: {} }, e.startRule === "Supported" && (e.data =
|
|
990
|
+
function(l) {
|
|
991
|
+
e = e || { data: {} }, e.startRule === "Supported" && (e.data = l || []);
|
|
992
992
|
},
|
|
993
993
|
function() {
|
|
994
994
|
e = e || { data: {} };
|
|
995
|
-
var
|
|
996
|
-
e.data = new O(e.data.uri, e.data.displayName, e.data.params),
|
|
995
|
+
var l = e.data.tag;
|
|
996
|
+
e.data = new O(e.data.uri, e.data.displayName, e.data.params), l && e.data.setParam("tag", l);
|
|
997
997
|
},
|
|
998
998
|
"ttl",
|
|
999
999
|
f("ttl", !0),
|
|
1000
|
-
function(
|
|
1001
|
-
e = e || { data: {} }, e.data.ttl =
|
|
1000
|
+
function(l) {
|
|
1001
|
+
e = e || { data: {} }, e.data.ttl = l;
|
|
1002
1002
|
},
|
|
1003
1003
|
"maddr",
|
|
1004
1004
|
f("maddr", !0),
|
|
1005
|
-
function(
|
|
1006
|
-
e = e || { data: {} }, e.data.maddr =
|
|
1005
|
+
function(l) {
|
|
1006
|
+
e = e || { data: {} }, e.data.maddr = l;
|
|
1007
1007
|
},
|
|
1008
1008
|
"received",
|
|
1009
1009
|
f("received", !0),
|
|
1010
|
-
function(
|
|
1011
|
-
e = e || { data: {} }, e.data.received =
|
|
1010
|
+
function(l) {
|
|
1011
|
+
e = e || { data: {} }, e.data.received = l;
|
|
1012
1012
|
},
|
|
1013
1013
|
"branch",
|
|
1014
1014
|
f("branch", !0),
|
|
1015
|
-
function(
|
|
1016
|
-
e = e || { data: {} }, e.data.branch =
|
|
1015
|
+
function(l) {
|
|
1016
|
+
e = e || { data: {} }, e.data.branch = l;
|
|
1017
1017
|
},
|
|
1018
1018
|
"rport",
|
|
1019
1019
|
f("rport", !0),
|
|
1020
|
-
function(
|
|
1021
|
-
e = e || { data: {} }, typeof
|
|
1020
|
+
function(l) {
|
|
1021
|
+
e = e || { data: {} }, typeof l < "u" && (e.data.rport = l.join(""));
|
|
1022
1022
|
},
|
|
1023
|
-
function(
|
|
1024
|
-
e = e || { data: {} }, e.data.protocol =
|
|
1023
|
+
function(l) {
|
|
1024
|
+
e = e || { data: {} }, e.data.protocol = l;
|
|
1025
1025
|
},
|
|
1026
1026
|
f("UDP", !0),
|
|
1027
1027
|
f("TCP", !0),
|
|
1028
1028
|
f("TLS", !0),
|
|
1029
1029
|
f("SCTP", !0),
|
|
1030
|
-
function(
|
|
1031
|
-
e = e || { data: {} }, e.data.transport =
|
|
1030
|
+
function(l) {
|
|
1031
|
+
e = e || { data: {} }, e.data.transport = l;
|
|
1032
1032
|
},
|
|
1033
1033
|
function() {
|
|
1034
1034
|
e = e || { data: {} }, e.data.host = C();
|
|
1035
1035
|
},
|
|
1036
|
-
function(
|
|
1037
|
-
e = e || { data: {} }, e.data.port = parseInt(
|
|
1036
|
+
function(l) {
|
|
1037
|
+
e = e || { data: {} }, e.data.port = parseInt(l.join(""));
|
|
1038
1038
|
},
|
|
1039
|
-
function(
|
|
1040
|
-
return parseInt(
|
|
1039
|
+
function(l) {
|
|
1040
|
+
return parseInt(l.join(""));
|
|
1041
1041
|
},
|
|
1042
|
-
function(
|
|
1043
|
-
e = e || { data: {} }, e.startRule === "Session_Expires" && (e.data.deltaSeconds =
|
|
1042
|
+
function(l) {
|
|
1043
|
+
e = e || { data: {} }, e.startRule === "Session_Expires" && (e.data.deltaSeconds = l);
|
|
1044
1044
|
},
|
|
1045
1045
|
"refresher",
|
|
1046
1046
|
f("refresher", !1),
|
|
@@ -1048,21 +1048,21 @@ function mt(a, e) {
|
|
|
1048
1048
|
f("uas", !1),
|
|
1049
1049
|
"uac",
|
|
1050
1050
|
f("uac", !1),
|
|
1051
|
-
function(
|
|
1052
|
-
e = e || { data: {} }, e.startRule === "Session_Expires" && (e.data.refresher =
|
|
1051
|
+
function(l) {
|
|
1052
|
+
e = e || { data: {} }, e.startRule === "Session_Expires" && (e.data.refresher = l);
|
|
1053
1053
|
},
|
|
1054
|
-
function(
|
|
1055
|
-
e = e || { data: {} }, e.startRule === "Min_SE" && (e.data =
|
|
1054
|
+
function(l) {
|
|
1055
|
+
e = e || { data: {} }, e.startRule === "Min_SE" && (e.data = l);
|
|
1056
1056
|
},
|
|
1057
1057
|
"stuns",
|
|
1058
1058
|
f("stuns", !0),
|
|
1059
1059
|
"stun",
|
|
1060
1060
|
f("stun", !0),
|
|
1061
|
-
function(
|
|
1062
|
-
e = e || { data: {} }, e.data.scheme =
|
|
1061
|
+
function(l) {
|
|
1062
|
+
e = e || { data: {} }, e.data.scheme = l;
|
|
1063
1063
|
},
|
|
1064
|
-
function(
|
|
1065
|
-
e = e || { data: {} }, e.data.host =
|
|
1064
|
+
function(l) {
|
|
1065
|
+
e = e || { data: {} }, e.data.host = l;
|
|
1066
1066
|
},
|
|
1067
1067
|
"?transport=",
|
|
1068
1068
|
f("?transport=", !1),
|
|
@@ -1070,8 +1070,8 @@ function mt(a, e) {
|
|
|
1070
1070
|
f("turns", !0),
|
|
1071
1071
|
"turn",
|
|
1072
1072
|
f("turn", !0),
|
|
1073
|
-
function(
|
|
1074
|
-
e = e || { data: {} }, e.data.transport =
|
|
1073
|
+
function(l) {
|
|
1074
|
+
e = e || { data: {} }, e.data.transport = l;
|
|
1075
1075
|
},
|
|
1076
1076
|
function() {
|
|
1077
1077
|
e = e || { data: {} }, e.data = C();
|
|
@@ -1333,172 +1333,172 @@ function mt(a, e) {
|
|
|
1333
1333
|
function ne() {
|
|
1334
1334
|
return _e(p, d);
|
|
1335
1335
|
}
|
|
1336
|
-
function f(
|
|
1337
|
-
return { type: "literal", text:
|
|
1336
|
+
function f(l, b) {
|
|
1337
|
+
return { type: "literal", text: l, ignoreCase: b };
|
|
1338
1338
|
}
|
|
1339
|
-
function $(
|
|
1340
|
-
return { type: "class", parts:
|
|
1339
|
+
function $(l, b, h) {
|
|
1340
|
+
return { type: "class", parts: l, inverted: b, ignoreCase: h };
|
|
1341
1341
|
}
|
|
1342
1342
|
function $e() {
|
|
1343
1343
|
return { type: "end" };
|
|
1344
1344
|
}
|
|
1345
|
-
function Ue(
|
|
1346
|
-
let b = u[
|
|
1345
|
+
function Ue(l) {
|
|
1346
|
+
let b = u[l], h;
|
|
1347
1347
|
if (b)
|
|
1348
1348
|
return b;
|
|
1349
|
-
for (
|
|
1350
|
-
|
|
1351
|
-
for (b = u[
|
|
1349
|
+
for (h = l - 1; !u[h]; )
|
|
1350
|
+
h--;
|
|
1351
|
+
for (b = u[h], b = {
|
|
1352
1352
|
line: b.line,
|
|
1353
1353
|
column: b.column
|
|
1354
|
-
};
|
|
1355
|
-
a.charCodeAt(
|
|
1356
|
-
return u[
|
|
1354
|
+
}; h < l; )
|
|
1355
|
+
a.charCodeAt(h) === 10 ? (b.line++, b.column = 1) : b.column++, h++;
|
|
1356
|
+
return u[l] = b, b;
|
|
1357
1357
|
}
|
|
1358
|
-
function _e(
|
|
1359
|
-
const
|
|
1358
|
+
function _e(l, b) {
|
|
1359
|
+
const h = Ue(l), B = Ue(b);
|
|
1360
1360
|
return {
|
|
1361
1361
|
source: s,
|
|
1362
1362
|
start: {
|
|
1363
|
-
offset:
|
|
1364
|
-
line:
|
|
1365
|
-
column:
|
|
1363
|
+
offset: l,
|
|
1364
|
+
line: h.line,
|
|
1365
|
+
column: h.column
|
|
1366
1366
|
},
|
|
1367
1367
|
end: {
|
|
1368
1368
|
offset: b,
|
|
1369
|
-
line:
|
|
1370
|
-
column:
|
|
1369
|
+
line: B.line,
|
|
1370
|
+
column: B.column
|
|
1371
1371
|
}
|
|
1372
1372
|
};
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
d < w || (d > w && (w = d, S = []), S.push(
|
|
1374
|
+
function Le(l) {
|
|
1375
|
+
d < w || (d > w && (w = d, S = []), S.push(l));
|
|
1376
1376
|
}
|
|
1377
|
-
function at(
|
|
1378
|
-
return new
|
|
1377
|
+
function at(l, b, h) {
|
|
1378
|
+
return new le(le.buildMessage(l, b), l, b, h);
|
|
1379
1379
|
}
|
|
1380
|
-
function c(
|
|
1381
|
-
return
|
|
1380
|
+
function c(l) {
|
|
1381
|
+
return l.split("").map((b) => b.charCodeAt(0) - 32);
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1384
|
-
const b = o[
|
|
1385
|
-
let
|
|
1386
|
-
const
|
|
1383
|
+
function Be(l) {
|
|
1384
|
+
const b = o[l];
|
|
1385
|
+
let h = 0;
|
|
1386
|
+
const B = [];
|
|
1387
1387
|
let _ = b.length;
|
|
1388
1388
|
const K = [], E = [];
|
|
1389
1389
|
let je;
|
|
1390
1390
|
for (; ; ) {
|
|
1391
|
-
for (;
|
|
1392
|
-
switch (b[
|
|
1391
|
+
for (; h < _; )
|
|
1392
|
+
switch (b[h]) {
|
|
1393
1393
|
case 0:
|
|
1394
|
-
E.push(n[b[
|
|
1394
|
+
E.push(n[b[h + 1]]), h += 2;
|
|
1395
1395
|
break;
|
|
1396
1396
|
case 1:
|
|
1397
|
-
E.push(void 0),
|
|
1397
|
+
E.push(void 0), h++;
|
|
1398
1398
|
break;
|
|
1399
1399
|
case 2:
|
|
1400
|
-
E.push(null),
|
|
1400
|
+
E.push(null), h++;
|
|
1401
1401
|
break;
|
|
1402
1402
|
case 3:
|
|
1403
|
-
E.push(t),
|
|
1403
|
+
E.push(t), h++;
|
|
1404
1404
|
break;
|
|
1405
1405
|
case 4:
|
|
1406
|
-
E.push([]),
|
|
1406
|
+
E.push([]), h++;
|
|
1407
1407
|
break;
|
|
1408
1408
|
case 5:
|
|
1409
|
-
E.push(d),
|
|
1409
|
+
E.push(d), h++;
|
|
1410
1410
|
break;
|
|
1411
1411
|
case 6:
|
|
1412
|
-
E.pop(),
|
|
1412
|
+
E.pop(), h++;
|
|
1413
1413
|
break;
|
|
1414
1414
|
case 7:
|
|
1415
|
-
d = E.pop(),
|
|
1415
|
+
d = E.pop(), h++;
|
|
1416
1416
|
break;
|
|
1417
1417
|
case 8:
|
|
1418
|
-
E.length -= b[
|
|
1418
|
+
E.length -= b[h + 1], h += 2;
|
|
1419
1419
|
break;
|
|
1420
1420
|
case 9:
|
|
1421
|
-
E.splice(-2, 1),
|
|
1421
|
+
E.splice(-2, 1), h++;
|
|
1422
1422
|
break;
|
|
1423
1423
|
case 10:
|
|
1424
|
-
E[E.length - 2].push(E.pop()),
|
|
1424
|
+
E[E.length - 2].push(E.pop()), h++;
|
|
1425
1425
|
break;
|
|
1426
1426
|
case 11:
|
|
1427
|
-
E.push(E.splice(E.length - b[
|
|
1427
|
+
E.push(E.splice(E.length - b[h + 1], b[h + 1])), h += 2;
|
|
1428
1428
|
break;
|
|
1429
1429
|
case 12:
|
|
1430
|
-
E.push(a.substring(E.pop(), d)),
|
|
1430
|
+
E.push(a.substring(E.pop(), d)), h++;
|
|
1431
1431
|
break;
|
|
1432
1432
|
case 13:
|
|
1433
|
-
K.push(_),
|
|
1433
|
+
K.push(_), B.push(h + 3 + b[h + 1] + b[h + 2]), E[E.length - 1] ? (_ = h + 3 + b[h + 1], h += 3) : (_ = h + 3 + b[h + 1] + b[h + 2], h += 3 + b[h + 1]);
|
|
1434
1434
|
break;
|
|
1435
1435
|
case 14:
|
|
1436
|
-
K.push(_),
|
|
1436
|
+
K.push(_), B.push(h + 3 + b[h + 1] + b[h + 2]), E[E.length - 1] === t ? (_ = h + 3 + b[h + 1], h += 3) : (_ = h + 3 + b[h + 1] + b[h + 2], h += 3 + b[h + 1]);
|
|
1437
1437
|
break;
|
|
1438
1438
|
case 15:
|
|
1439
|
-
K.push(_),
|
|
1439
|
+
K.push(_), B.push(h + 3 + b[h + 1] + b[h + 2]), E[E.length - 1] !== t ? (_ = h + 3 + b[h + 1], h += 3) : (_ = h + 3 + b[h + 1] + b[h + 2], h += 3 + b[h + 1]);
|
|
1440
1440
|
break;
|
|
1441
1441
|
case 16:
|
|
1442
|
-
E[E.length - 1] !== t ? (K.push(_),
|
|
1442
|
+
E[E.length - 1] !== t ? (K.push(_), B.push(h), _ = h + 2 + b[h + 1], h += 2) : h += 2 + b[h + 1];
|
|
1443
1443
|
break;
|
|
1444
1444
|
case 17:
|
|
1445
|
-
K.push(_),
|
|
1445
|
+
K.push(_), B.push(h + 3 + b[h + 1] + b[h + 2]), a.length > d ? (_ = h + 3 + b[h + 1], h += 3) : (_ = h + 3 + b[h + 1] + b[h + 2], h += 3 + b[h + 1]);
|
|
1446
1446
|
break;
|
|
1447
1447
|
case 18:
|
|
1448
|
-
K.push(_),
|
|
1448
|
+
K.push(_), B.push(h + 4 + b[h + 2] + b[h + 3]), a.substr(d, n[b[h + 1]].length) === n[b[h + 1]] ? (_ = h + 4 + b[h + 2], h += 4) : (_ = h + 4 + b[h + 2] + b[h + 3], h += 4 + b[h + 2]);
|
|
1449
1449
|
break;
|
|
1450
1450
|
case 19:
|
|
1451
|
-
K.push(_),
|
|
1451
|
+
K.push(_), B.push(h + 4 + b[h + 2] + b[h + 3]), a.substr(d, n[b[h + 1]].length).toLowerCase() === n[b[h + 1]] ? (_ = h + 4 + b[h + 2], h += 4) : (_ = h + 4 + b[h + 2] + b[h + 3], h += 4 + b[h + 2]);
|
|
1452
1452
|
break;
|
|
1453
1453
|
case 20:
|
|
1454
|
-
K.push(_),
|
|
1454
|
+
K.push(_), B.push(h + 4 + b[h + 2] + b[h + 3]), n[b[h + 1]].test(a.charAt(d)) ? (_ = h + 4 + b[h + 2], h += 4) : (_ = h + 4 + b[h + 2] + b[h + 3], h += 4 + b[h + 2]);
|
|
1455
1455
|
break;
|
|
1456
1456
|
case 21:
|
|
1457
|
-
E.push(a.substr(d, b[
|
|
1457
|
+
E.push(a.substr(d, b[h + 1])), d += b[h + 1], h += 2;
|
|
1458
1458
|
break;
|
|
1459
1459
|
case 22:
|
|
1460
|
-
E.push(n[b[
|
|
1460
|
+
E.push(n[b[h + 1]]), d += n[b[h + 1]].length, h += 2;
|
|
1461
1461
|
break;
|
|
1462
1462
|
case 23:
|
|
1463
|
-
E.push(t), I === 0 &&
|
|
1463
|
+
E.push(t), I === 0 && Le(n[b[h + 1]]), h += 2;
|
|
1464
1464
|
break;
|
|
1465
1465
|
case 24:
|
|
1466
|
-
p = E[E.length - 1 - b[
|
|
1466
|
+
p = E[E.length - 1 - b[h + 1]], h += 2;
|
|
1467
1467
|
break;
|
|
1468
1468
|
case 25:
|
|
1469
|
-
p = d,
|
|
1469
|
+
p = d, h++;
|
|
1470
1470
|
break;
|
|
1471
1471
|
case 26:
|
|
1472
|
-
je = b.slice(
|
|
1472
|
+
je = b.slice(h + 4, h + 4 + b[h + 3]).map(function(dt) {
|
|
1473
1473
|
return E[E.length - 1 - dt];
|
|
1474
|
-
}), E.splice(E.length - b[
|
|
1474
|
+
}), E.splice(E.length - b[h + 2], b[h + 2], n[b[h + 1]].apply(null, je)), h += 4 + b[h + 3];
|
|
1475
1475
|
break;
|
|
1476
1476
|
case 27:
|
|
1477
|
-
E.push(
|
|
1477
|
+
E.push(Be(b[h + 1])), h += 2;
|
|
1478
1478
|
break;
|
|
1479
1479
|
case 28:
|
|
1480
|
-
I++,
|
|
1480
|
+
I++, h++;
|
|
1481
1481
|
break;
|
|
1482
1482
|
case 29:
|
|
1483
|
-
I--,
|
|
1483
|
+
I--, h++;
|
|
1484
1484
|
break;
|
|
1485
1485
|
default:
|
|
1486
|
-
throw new Error("Invalid opcode: " + b[
|
|
1486
|
+
throw new Error("Invalid opcode: " + b[h] + ".");
|
|
1487
1487
|
}
|
|
1488
1488
|
if (K.length > 0)
|
|
1489
|
-
_ = K.pop(),
|
|
1489
|
+
_ = K.pop(), h = B.pop();
|
|
1490
1490
|
else
|
|
1491
1491
|
break;
|
|
1492
1492
|
}
|
|
1493
1493
|
return E[0];
|
|
1494
1494
|
}
|
|
1495
1495
|
e.data = {};
|
|
1496
|
-
function ct(
|
|
1497
|
-
return [
|
|
1496
|
+
function ct(l, b) {
|
|
1497
|
+
return [l].concat(b);
|
|
1498
1498
|
}
|
|
1499
|
-
if (A =
|
|
1499
|
+
if (A = Be(r), A !== t && d === a.length)
|
|
1500
1500
|
return A;
|
|
1501
|
-
throw A !== t && d < a.length &&
|
|
1501
|
+
throw A !== t && d < a.length && Le($e()), at(S, w < a.length ? a.charAt(w) : null, w < a.length ? _e(w, w + 1) : _e(w, w));
|
|
1502
1502
|
}
|
|
1503
1503
|
const wt = mt;
|
|
1504
1504
|
var k;
|
|
@@ -1725,7 +1725,7 @@ class Je {
|
|
|
1725
1725
|
return this.data;
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
|
-
class
|
|
1728
|
+
class he extends Je {
|
|
1729
1729
|
constructor() {
|
|
1730
1730
|
super();
|
|
1731
1731
|
}
|
|
@@ -1882,7 +1882,7 @@ function Xe(a) {
|
|
|
1882
1882
|
}
|
|
1883
1883
|
function me(a) {
|
|
1884
1884
|
let e, t, s;
|
|
1885
|
-
if (a instanceof
|
|
1885
|
+
if (a instanceof he && a.body) {
|
|
1886
1886
|
const i = a.parseHeader("Content-Disposition");
|
|
1887
1887
|
e = i ? i.type : void 0, t = a.parseHeader("Content-Type"), s = a.body;
|
|
1888
1888
|
}
|
|
@@ -3092,7 +3092,7 @@ class ae extends ue {
|
|
|
3092
3092
|
*/
|
|
3093
3093
|
handleResponseError(e) {
|
|
3094
3094
|
let t = 480;
|
|
3095
|
-
if (e instanceof Error ? this.logger.error(e.message) : this.logger.error(e), e instanceof qe ? (this.logger.error("A session description handler occurred while sending response (content type unsupported"), t = 415) : e instanceof
|
|
3095
|
+
if (e instanceof Error ? this.logger.error(e.message) : this.logger.error(e), e instanceof qe ? (this.logger.error("A session description handler occurred while sending response (content type unsupported"), t = 415) : e instanceof ht ? this.logger.error("A session description handler occurred while sending response") : e instanceof De ? this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)") : e instanceof te && this.logger.error("Session changed state before response could be formulated and sent"), this.state === m.Initial || this.state === m.Establishing)
|
|
3096
3096
|
try {
|
|
3097
3097
|
this.incomingInviteRequest.reject({ statusCode: t }), this.stateTransition(m.Terminated);
|
|
3098
3098
|
} catch (s) {
|
|
@@ -4460,7 +4460,7 @@ var Te;
|
|
|
4460
4460
|
if (p === -1) {
|
|
4461
4461
|
r.warn('error parsing first line of SIP message: "' + d + '"');
|
|
4462
4462
|
return;
|
|
4463
|
-
} else p.status_code ? (u = new re(), u.statusCode = p.status_code, u.reasonPhrase = p.reason_phrase) : (u = new
|
|
4463
|
+
} else p.status_code ? (u = new re(), u.statusCode = p.status_code, u.reasonPhrase = p.reason_phrase) : (u = new he(), u.method = p.method, u.ruri = p.uri);
|
|
4464
4464
|
u.data = i, n = o + 2;
|
|
4465
4465
|
let w;
|
|
4466
4466
|
for (; ; ) {
|
|
@@ -4878,7 +4878,7 @@ class Ae extends tt {
|
|
|
4878
4878
|
this.user.onRequestTimeout && this.user.onRequestTimeout();
|
|
4879
4879
|
}
|
|
4880
4880
|
}
|
|
4881
|
-
class
|
|
4881
|
+
class L extends Ae {
|
|
4882
4882
|
/**
|
|
4883
4883
|
* Constructor
|
|
4884
4884
|
* Upon construction, the outgoing request's Via header is updated by calling `setViaHeader`.
|
|
@@ -5528,8 +5528,8 @@ class q {
|
|
|
5528
5528
|
callId: this.message.callId,
|
|
5529
5529
|
cseq: this.message.cseq
|
|
5530
5530
|
}, t.extraHeaders);
|
|
5531
|
-
return s.branch = this.message.branch, this.message.headers.Route && (s.headers.Route = this.message.headers.Route), e && s.setHeader("Reason", e), this.transaction.state === g.Proceeding ? new q(
|
|
5532
|
-
this.transaction && this.transaction.state === g.Proceeding && new q(
|
|
5531
|
+
return s.branch = this.message.branch, this.message.headers.Route && (s.headers.Route = this.message.headers.Route), e && s.setHeader("Reason", e), this.transaction.state === g.Proceeding ? new q(L, this.core, s) : this.transaction.addStateChangeListener(() => {
|
|
5532
|
+
this.transaction && this.transaction.state === g.Proceeding && new q(L, this.core, s);
|
|
5533
5533
|
}, { once: !0 }), s;
|
|
5534
5534
|
}
|
|
5535
5535
|
/**
|
|
@@ -5656,7 +5656,7 @@ class q {
|
|
|
5656
5656
|
class xt extends q {
|
|
5657
5657
|
constructor(e, t, s) {
|
|
5658
5658
|
const i = e.createOutgoingRequestMessage(y.BYE, s);
|
|
5659
|
-
super(
|
|
5659
|
+
super(L, e.userAgentCore, i, t), e.dispose();
|
|
5660
5660
|
}
|
|
5661
5661
|
}
|
|
5662
5662
|
class U extends st {
|
|
@@ -5950,7 +5950,7 @@ class Rt extends J {
|
|
|
5950
5950
|
class It extends q {
|
|
5951
5951
|
constructor(e, t, s) {
|
|
5952
5952
|
const i = e.createOutgoingRequestMessage(y.INFO, s);
|
|
5953
|
-
super(
|
|
5953
|
+
super(L, e.userAgentCore, i, t);
|
|
5954
5954
|
}
|
|
5955
5955
|
}
|
|
5956
5956
|
class At extends J {
|
|
@@ -5960,7 +5960,7 @@ class At extends J {
|
|
|
5960
5960
|
}
|
|
5961
5961
|
class it extends q {
|
|
5962
5962
|
constructor(e, t, s) {
|
|
5963
|
-
super(
|
|
5963
|
+
super(L, e, t, s);
|
|
5964
5964
|
}
|
|
5965
5965
|
}
|
|
5966
5966
|
class rt extends J {
|
|
@@ -5971,7 +5971,7 @@ class rt extends J {
|
|
|
5971
5971
|
class $t extends q {
|
|
5972
5972
|
constructor(e, t, s) {
|
|
5973
5973
|
const i = e.createOutgoingRequestMessage(y.NOTIFY, s);
|
|
5974
|
-
super(
|
|
5974
|
+
super(L, e.userAgentCore, i, t);
|
|
5975
5975
|
}
|
|
5976
5976
|
}
|
|
5977
5977
|
function _t(a) {
|
|
@@ -5991,7 +5991,7 @@ class Ce extends J {
|
|
|
5991
5991
|
class Dt extends q {
|
|
5992
5992
|
constructor(e, t, s) {
|
|
5993
5993
|
const i = e.createOutgoingRequestMessage(y.PRACK, s);
|
|
5994
|
-
super(
|
|
5994
|
+
super(L, e.userAgentCore, i, t), e.signalingStateTransition(i);
|
|
5995
5995
|
}
|
|
5996
5996
|
}
|
|
5997
5997
|
class kt extends J {
|
|
@@ -6094,7 +6094,7 @@ class Ht extends J {
|
|
|
6094
6094
|
class Mt extends q {
|
|
6095
6095
|
constructor(e, t, s) {
|
|
6096
6096
|
const i = e.createOutgoingRequestMessage(y.REFER, s);
|
|
6097
|
-
super(
|
|
6097
|
+
super(L, e.userAgentCore, i, t);
|
|
6098
6098
|
}
|
|
6099
6099
|
}
|
|
6100
6100
|
function qt(a) {
|
|
@@ -6471,7 +6471,7 @@ class xe extends ge {
|
|
|
6471
6471
|
signalingStateTransition(e) {
|
|
6472
6472
|
const t = me(e);
|
|
6473
6473
|
if (!(!t || t.contentDisposition !== "session")) {
|
|
6474
|
-
if (this._signalingState === v.Stable && (this._rollbackOffer = this._offer, this._rollbackAnswer = this._answer), e instanceof
|
|
6474
|
+
if (this._signalingState === v.Stable && (this._rollbackOffer = this._offer, this._rollbackAnswer = this._answer), e instanceof he)
|
|
6475
6475
|
switch (this._signalingState) {
|
|
6476
6476
|
case v.Initial:
|
|
6477
6477
|
case v.Stable:
|
|
@@ -6801,12 +6801,12 @@ class He extends J {
|
|
|
6801
6801
|
}
|
|
6802
6802
|
class Ot extends q {
|
|
6803
6803
|
constructor(e, t, s) {
|
|
6804
|
-
super(
|
|
6804
|
+
super(L, e, t, s);
|
|
6805
6805
|
}
|
|
6806
6806
|
}
|
|
6807
6807
|
class Nt extends q {
|
|
6808
6808
|
constructor(e, t, s) {
|
|
6809
|
-
super(
|
|
6809
|
+
super(L, e, t, s);
|
|
6810
6810
|
}
|
|
6811
6811
|
}
|
|
6812
6812
|
class Ut extends J {
|
|
@@ -6814,10 +6814,10 @@ class Ut extends J {
|
|
|
6814
6814
|
super(U, e, t, s), this.core = e;
|
|
6815
6815
|
}
|
|
6816
6816
|
}
|
|
6817
|
-
class
|
|
6817
|
+
class Lt extends q {
|
|
6818
6818
|
constructor(e, t, s) {
|
|
6819
6819
|
const i = e.createOutgoingRequestMessage(y.SUBSCRIBE, s);
|
|
6820
|
-
super(
|
|
6820
|
+
super(L, e.userAgentCore, i, t), this.dialog = e;
|
|
6821
6821
|
}
|
|
6822
6822
|
waitNotifyStop() {
|
|
6823
6823
|
}
|
|
@@ -6951,7 +6951,7 @@ class We extends ge {
|
|
|
6951
6951
|
if (this.subscriptionState !== R.Pending && this.subscriptionState !== R.Active)
|
|
6952
6952
|
throw new Error(`Invalid state ${this.subscriptionState}. May only re-subscribe while in state "pending" or "active".`);
|
|
6953
6953
|
this.logger.log(`SUBSCRIBE dialog ${this.id} sending SUBSCRIBE request`);
|
|
6954
|
-
const i = new
|
|
6954
|
+
const i = new Lt(this, e, t);
|
|
6955
6955
|
return this.N && (clearTimeout(this.N), this.N = void 0), !((s = t.extraHeaders) === null || s === void 0) && s.includes("Expires: 0") || (this.N = setTimeout(() => this.timerN(), M.TIMER_N)), i;
|
|
6956
6956
|
}
|
|
6957
6957
|
/**
|
|
@@ -7074,7 +7074,7 @@ class We extends ge {
|
|
|
7074
7074
|
this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."), this.subscriptionState !== R.Terminated && (this.stateTransition(R.Terminated), this.onTerminated());
|
|
7075
7075
|
}
|
|
7076
7076
|
}
|
|
7077
|
-
class
|
|
7077
|
+
class Bt extends q {
|
|
7078
7078
|
constructor(e, t, s) {
|
|
7079
7079
|
const i = t.getHeader("Event");
|
|
7080
7080
|
if (!i)
|
|
@@ -7082,7 +7082,7 @@ class Lt extends q {
|
|
|
7082
7082
|
const r = t.getHeader("Expires");
|
|
7083
7083
|
if (!r)
|
|
7084
7084
|
throw new Error("Expires undefined");
|
|
7085
|
-
super(
|
|
7085
|
+
super(L, e, t, s), this.delegate = s, this.subscriberId = t.callId + t.fromTag + i, this.subscriptionExpiresRequested = this.subscriptionExpires = Number(r), this.subscriptionEvent = i, this.subscriptionState = R.NotifyWait, this.waitNotifyStart();
|
|
7086
7086
|
}
|
|
7087
7087
|
/**
|
|
7088
7088
|
* Destructor.
|
|
@@ -7263,7 +7263,7 @@ class Gt {
|
|
|
7263
7263
|
* @param delegate - Request delegate.
|
|
7264
7264
|
*/
|
|
7265
7265
|
subscribe(e, t) {
|
|
7266
|
-
return new
|
|
7266
|
+
return new Bt(this, e, t);
|
|
7267
7267
|
}
|
|
7268
7268
|
/**
|
|
7269
7269
|
* Send a request.
|
|
@@ -7271,7 +7271,7 @@ class Gt {
|
|
|
7271
7271
|
* @param delegate - Request delegate.
|
|
7272
7272
|
*/
|
|
7273
7273
|
request(e, t) {
|
|
7274
|
-
return new q(
|
|
7274
|
+
return new q(L, this, e, t);
|
|
7275
7275
|
}
|
|
7276
7276
|
/**
|
|
7277
7277
|
* Outgoing request message factory function.
|
|
@@ -8594,7 +8594,7 @@ class G {
|
|
|
8594
8594
|
transportConstructor: ye,
|
|
8595
8595
|
transportOptions: {},
|
|
8596
8596
|
uri: new z("sip", "anonymous", "anonymous.invalid"),
|
|
8597
|
-
userAgentString: "SIP.js/" +
|
|
8597
|
+
userAgentString: "SIP.js/" + lt,
|
|
8598
8598
|
viaHost: ""
|
|
8599
8599
|
};
|
|
8600
8600
|
}
|
|
@@ -8926,7 +8926,7 @@ class G {
|
|
|
8926
8926
|
this.logger.warn("Failed to parse incoming message. Dropping.");
|
|
8927
8927
|
return;
|
|
8928
8928
|
}
|
|
8929
|
-
if (this.state === D.Stopped && t instanceof
|
|
8929
|
+
if (this.state === D.Stopped && t instanceof he) {
|
|
8930
8930
|
this.logger.warn(`Received ${t.method} request while stopped. Dropping.`);
|
|
8931
8931
|
return;
|
|
8932
8932
|
}
|
|
@@ -8937,7 +8937,7 @@ class G {
|
|
|
8937
8937
|
return this.logger.warn(`Missing mandatory header field : ${r}.`), !1;
|
|
8938
8938
|
return !0;
|
|
8939
8939
|
};
|
|
8940
|
-
if (t instanceof
|
|
8940
|
+
if (t instanceof he) {
|
|
8941
8941
|
if (!s()) {
|
|
8942
8942
|
this.logger.warn("Request missing mandatory header field. Dropping.");
|
|
8943
8943
|
return;
|
|
@@ -8971,7 +8971,7 @@ class G {
|
|
|
8971
8971
|
return;
|
|
8972
8972
|
}
|
|
8973
8973
|
}
|
|
8974
|
-
if (t instanceof
|
|
8974
|
+
if (t instanceof he) {
|
|
8975
8975
|
this.userAgentCore.receiveIncomingRequestFromTransport(t);
|
|
8976
8976
|
return;
|
|
8977
8977
|
}
|
|
@@ -10936,7 +10936,7 @@ const Xt = `
|
|
|
10936
10936
|
.logs { max-height: 140px; padding: 0 16px 16px; }
|
|
10937
10937
|
}
|
|
10938
10938
|
`, X = {
|
|
10939
|
-
idle: "
|
|
10939
|
+
idle: "网页电话已加载,正在准备待机能力。",
|
|
10940
10940
|
requesting: "正在向服务端申请网页通话会话。",
|
|
10941
10941
|
standbyRequesting: "正在向服务端申请 widget 待机会话。",
|
|
10942
10942
|
registering: "临时账号已拿到,正在连接并执行 REGISTER。",
|
|
@@ -10944,7 +10944,7 @@ const Xt = `
|
|
|
10944
10944
|
incoming: "收到新的来电,请选择接听或拒接。",
|
|
10945
10945
|
calling: "已发起呼叫,正在等待对端振铃或接听。",
|
|
10946
10946
|
connected: "通话已接通,媒体链路正在运行。",
|
|
10947
|
-
ended: "
|
|
10947
|
+
ended: "通话已结束,网页电话正在恢复待机。",
|
|
10948
10948
|
rejected: "本次来电已拒接,widget 仍保持待机。",
|
|
10949
10949
|
missed: "本次来电未接听,widget 仍保持待机。",
|
|
10950
10950
|
failed: "本次呼叫失败,请先看下方日志。"
|
|
@@ -10957,7 +10957,7 @@ function ts(a, e) {
|
|
|
10957
10957
|
${JSON.stringify(e, null, 2)}` : a;
|
|
10958
10958
|
}
|
|
10959
10959
|
function ss(a) {
|
|
10960
|
-
return a === "
|
|
10960
|
+
return a === "outbound" ? "outbound" : "terminal";
|
|
10961
10961
|
}
|
|
10962
10962
|
function is(a) {
|
|
10963
10963
|
return typeof a == "function";
|
|
@@ -10967,7 +10967,7 @@ function rs() {
|
|
|
10967
10967
|
}
|
|
10968
10968
|
class ns {
|
|
10969
10969
|
constructor({ mount: e, shadowRoot: t, options: s }) {
|
|
10970
|
-
this.mountNode = e, this.shadowRoot = t, this.options = s, this.mode = ss(s.mode), this.apiBaseUrl = s.apiBaseUrl || window.location.origin, this.client = null, this.issuedSession = null, this.bootstrap = null, this.turnIceServers = [], this.state = "idle", this.finalizing = !1, this.isMobileViewport = !1, this.pendingIncomingCall = null, this.visibilityHandler = null, this.sessionTouchTimer = null, this.transportDisconnectTimer = null, this.transportDisconnectContext = null, this.e2eBridgeEnabled = rs(), this.terminalFailureOverride = "", this.refs = {};
|
|
10970
|
+
this.mountNode = e, this.shadowRoot = t, this.options = s, this.mode = ss(s.mode), this.legacyOutboundOnly = this.mode === "outbound", this.apiBaseUrl = s.apiBaseUrl || window.location.origin, this.client = null, this.issuedSession = null, this.bootstrap = null, this.turnIceServers = [], this.state = "idle", this.finalizing = !1, this.isMobileViewport = !1, this.pendingIncomingCall = null, this.visibilityHandler = null, this.sessionTouchTimer = null, this.transportDisconnectTimer = null, this.transportDisconnectContext = null, this.e2eBridgeEnabled = rs(), this.terminalFailureOverride = "", this.refs = {};
|
|
10971
10971
|
}
|
|
10972
10972
|
async mount() {
|
|
10973
10973
|
this.isMobileViewport = typeof window < "u" && window.matchMedia("(max-width: 480px)").matches, this.shadowRoot.innerHTML = `
|
|
@@ -10980,9 +10980,9 @@ class ns {
|
|
|
10980
10980
|
<div class="status" data-role="status">${X.idle}</div>
|
|
10981
10981
|
<div class="hint" data-role="hint"></div>
|
|
10982
10982
|
</div>
|
|
10983
|
-
<div class="meta" data-role="meta"
|
|
10983
|
+
<div class="meta" data-role="meta">站点键:${this.options.siteKey || "自动读取默认值"};访客主动呼叫默认规则:${this.options.businessKey || "自动读取默认值"}</div>
|
|
10984
10984
|
<div class="actions">
|
|
10985
|
-
<button class="btn btn-primary" data-role="primary" type="button"
|
|
10985
|
+
<button class="btn btn-primary" data-role="primary" type="button">恢复网页电话待机</button>
|
|
10986
10986
|
<button class="btn btn-secondary" data-role="secondary" type="button" disabled>断开并清理</button>
|
|
10987
10987
|
</div>
|
|
10988
10988
|
<div class="logs" data-role="logs"></div>
|
|
@@ -11068,7 +11068,11 @@ class ns {
|
|
|
11068
11068
|
await this.answerIncomingCall();
|
|
11069
11069
|
return;
|
|
11070
11070
|
}
|
|
11071
|
-
if (this.
|
|
11071
|
+
if (this.legacyOutboundOnly) {
|
|
11072
|
+
await this.connectAndCall();
|
|
11073
|
+
return;
|
|
11074
|
+
}
|
|
11075
|
+
if (!this.client && !this.issuedSession) {
|
|
11072
11076
|
await this.startStandby();
|
|
11073
11077
|
return;
|
|
11074
11078
|
}
|
|
@@ -11088,7 +11092,10 @@ class ns {
|
|
|
11088
11092
|
async connectAndCall() {
|
|
11089
11093
|
if (!["requesting", "registering", "calling", "connected"].includes(this.state))
|
|
11090
11094
|
try {
|
|
11091
|
-
this.terminalFailureOverride = "", this.
|
|
11095
|
+
this.terminalFailureOverride = "", !this.legacyOutboundOnly && this.issuedSession?.session_mode === "widget_standby" && (this.appendLog("访客主动呼叫前,先释放当前待机会话并切换到呼叫链路。", {
|
|
11096
|
+
widget_anchor_number: this.issuedSession?.widget_anchor_number || null,
|
|
11097
|
+
resolved_business_key: this.issuedSession?.resolved_business_key || this.options.businessKey || this.bootstrap?.default_business_key || null
|
|
11098
|
+
}), await this.disconnectAndCleanup("switch-to-outbound-call")), this.setState("requesting"), await this.loadBootstrap(), this.turnIceServers = await this.fetchTurnIceServers();
|
|
11092
11099
|
const e = await this.fetchIssuedSession();
|
|
11093
11100
|
await this.ensureClient(e), this.setState("registering"), await this.client.ensureReady(), this.setState("calling"), await this.client.call(e.target), this.appendLog("已发起呼叫", {
|
|
11094
11101
|
target: e.target,
|
|
@@ -11096,26 +11103,31 @@ class ns {
|
|
|
11096
11103
|
});
|
|
11097
11104
|
} catch (e) {
|
|
11098
11105
|
const t = e?.message || String(e);
|
|
11099
|
-
this.terminalFailureOverride = t, this.setState("failed", t), this.appendLog("连接并呼叫失败", { message: t }), await this.releaseIssuedSession("failed", "connect-and-call-failed"), this.
|
|
11106
|
+
if (this.terminalFailureOverride = t, this.setState("failed", t), this.appendLog("连接并呼叫失败", { message: t }), await this.releaseIssuedSession("failed", "connect-and-call-failed"), !this.legacyOutboundOnly) {
|
|
11107
|
+
this.appendLog("呼叫失败后,网页电话将恢复待机。", { message: t }), await this.startStandby({ force: !0 });
|
|
11108
|
+
return;
|
|
11109
|
+
}
|
|
11110
|
+
this.setState("failed", t);
|
|
11100
11111
|
}
|
|
11101
11112
|
}
|
|
11102
|
-
async startStandby() {
|
|
11103
|
-
if (this.
|
|
11104
|
-
throw new Error("当前 widget
|
|
11105
|
-
|
|
11113
|
+
async startStandby(e = {}) {
|
|
11114
|
+
if (this.legacyOutboundOnly)
|
|
11115
|
+
throw new Error("当前 widget 仍处于 legacy outbound 兼容模式");
|
|
11116
|
+
const { force: t = !1 } = e;
|
|
11117
|
+
if (!(!t && ["standbyRequesting", "registering", "incoming", "connected"].includes(this.state)))
|
|
11106
11118
|
try {
|
|
11107
11119
|
this.terminalFailureOverride = "", this.setState("standbyRequesting"), await this.loadBootstrap(), this.turnIceServers = await this.fetchTurnIceServers();
|
|
11108
|
-
const
|
|
11109
|
-
await this.ensureClient(
|
|
11120
|
+
const s = await this.fetchStandbySession();
|
|
11121
|
+
await this.ensureClient(s), this.setState("registering", "待机会话已拿到,正在连接并执行 REGISTER。"), await this.client.ensureReady(), this.setState("standby"), this.appendLog("widget 已进入待机", {
|
|
11110
11122
|
session_id: this.issuedSession?.session_id || null,
|
|
11111
11123
|
route_business_key: this.issuedSession?.resolved_business_key || this.options.businessKey || this.bootstrap?.default_business_key || null,
|
|
11112
11124
|
standby_mode: this.issuedSession?.standby_mode || null,
|
|
11113
11125
|
widget_anchor_number: this.issuedSession?.widget_anchor_number || null,
|
|
11114
11126
|
browser_sip_username: this.issuedSession?.browser_sip_username || this.issuedSession?.sip_username || null
|
|
11115
11127
|
}), this.emitHostCallback("onStandbyReady", this.getSnapshot());
|
|
11116
|
-
} catch (
|
|
11117
|
-
const
|
|
11118
|
-
this.terminalFailureOverride =
|
|
11128
|
+
} catch (s) {
|
|
11129
|
+
const i = s?.message || String(s);
|
|
11130
|
+
this.terminalFailureOverride = i, this.setState("failed", i), this.appendLog("进入待机失败", { message: i }), await this.releaseIssuedSession("failed", "standby-start-failed"), this.setState("failed", i);
|
|
11119
11131
|
}
|
|
11120
11132
|
}
|
|
11121
11133
|
async ensureClient(e) {
|
|
@@ -11220,7 +11232,10 @@ class ns {
|
|
|
11220
11232
|
if (!this.finalizing) {
|
|
11221
11233
|
this.finalizing = !0;
|
|
11222
11234
|
try {
|
|
11223
|
-
this.stopSessionTouch(), this.stopTransportDisconnectGrace(), await this.releaseIssuedSession("released", e), this.client && (await this.client.destroy(), this.client = null)
|
|
11235
|
+
if (this.stopSessionTouch(), this.stopTransportDisconnectGrace(), await this.releaseIssuedSession("released", e), this.client && (await this.client.destroy(), this.client = null), !this.legacyOutboundOnly) {
|
|
11236
|
+
this.setState("idle", "上一通通话已结束,正在恢复网页电话待机。"), this.appendLog("通话已结束,网页电话正在恢复待机。", { reason: e }), await this.startStandby({ force: !0 });
|
|
11237
|
+
return;
|
|
11238
|
+
}
|
|
11224
11239
|
const t = this.terminalFailureOverride || (this.state === "failed" ? this.refs.status?.textContent?.trim() || X.failed : "");
|
|
11225
11240
|
t ? this.setState("failed", t) : this.setState("ended"), this.appendLog("通话已结束并完成清理", { reason: e });
|
|
11226
11241
|
} finally {
|
|
@@ -11260,7 +11275,7 @@ class ns {
|
|
|
11260
11275
|
}
|
|
11261
11276
|
async hangupCall() {
|
|
11262
11277
|
if (!this.client && this.e2eBridgeEnabled) {
|
|
11263
|
-
this.
|
|
11278
|
+
this.legacyOutboundOnly ? this.setState("ended") : this.setState("standby", "测试桥已模拟挂断,网页电话已恢复待机。"), this.pendingIncomingCall = null;
|
|
11264
11279
|
return;
|
|
11265
11280
|
}
|
|
11266
11281
|
this.client && await this.client.hangup();
|
|
@@ -11521,9 +11536,9 @@ class ns {
|
|
|
11521
11536
|
}
|
|
11522
11537
|
render() {
|
|
11523
11538
|
const e = ["requesting", "standbyRequesting", "registering", "calling"].includes(this.state), t = ["calling", "connected"].includes(this.state), s = !!(this.client || this.issuedSession);
|
|
11524
|
-
this.
|
|
11539
|
+
this.legacyOutboundOnly ? (this.refs.primary.disabled = e, this.refs.primary.textContent = t ? "通话进行中" : "连接并呼叫", this.refs.secondary.disabled = !t && !s, this.refs.secondary.textContent = t ? "挂断并清理" : "断开并清理") : (this.refs.primary.disabled = e || this.state === "connected", this.state === "incoming" ? this.refs.primary.textContent = "接听来电" : e ? this.refs.primary.textContent = this.state === "calling" ? "通话进行中" : "正在恢复网页电话" : !s || ["idle", "failed", "ended"].includes(this.state) ? this.refs.primary.textContent = "恢复网页电话待机" : this.refs.primary.textContent = "呼叫管理员", this.refs.secondary.disabled = !s, this.refs.secondary.textContent = this.state === "incoming" ? "拒接来电" : this.state === "connected" ? "挂断并恢复待机" : "断开电话");
|
|
11525
11540
|
const i = this.options.siteKey || this.bootstrap?.default_site_key || "等待服务端返回", r = this.issuedSession?.resolved_business_key || this.options.businessKey || this.bootstrap?.default_business_key || "等待服务端返回";
|
|
11526
|
-
this.
|
|
11541
|
+
this.legacyOutboundOnly ? this.refs.meta.textContent = `入站规则:${r};站点键:${i}` : this.refs.meta.textContent = `站点键:${i};网页电话会先进入可被叫待机;访客主动呼叫默认规则:${r}`, this.refs.hint.textContent = this.isMobileViewport ? Qt : "桌面网页可直接使用;若宿主站点启用了来源白名单或接入令牌,请按站点配置提供对应参数。";
|
|
11527
11542
|
}
|
|
11528
11543
|
async destroy() {
|
|
11529
11544
|
await this.disconnectAndCleanup("destroy-widget"), typeof document < "u" && this.visibilityHandler && (document.removeEventListener("visibilitychange", this.visibilityHandler), this.visibilityHandler = null), this.stopSessionTouch(), this.stopTransportDisconnectGrace(), this.pendingIncomingCall = null, this.e2eBridgeEnabled && typeof window < "u" && window.__embeddedCallWidgetE2E__ && delete window.__embeddedCallWidgetE2E__, this.shadowRoot.innerHTML = "";
|