@routr/common 2.0.8-alpha.4 → 2.0.8-alpha.40
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/dist/assertions.js +2 -2
- package/dist/auth.d.ts +43 -4
- package/dist/auth.js +63 -1
- package/dist/connect/api/client.d.ts +3 -0
- package/dist/connect/api/client.js +158 -0
- package/dist/connect/api/index.d.ts +2 -0
- package/dist/connect/api/index.js +36 -0
- package/dist/connect/api/types.d.ts +51 -0
- package/dist/connect/api/types.js +2 -0
- package/dist/connect/assertions.d.ts +37 -0
- package/dist/connect/assertions.js +112 -0
- package/dist/connect/client.d.ts +8 -0
- package/dist/connect/client.js +94 -0
- package/dist/connect/config.d.ts +113 -0
- package/dist/connect/config.js +2 -0
- package/dist/connect/connect_error.d.ts +21 -0
- package/dist/connect/connect_error.js +44 -0
- package/dist/connect/index.d.ts +7 -2
- package/dist/connect/index.js +8 -3
- package/dist/connect/mappers/acl.d.ts +3 -0
- package/dist/connect/mappers/acl.js +19 -0
- package/dist/connect/mappers/agent.d.ts +3 -0
- package/dist/connect/mappers/agent.js +42 -0
- package/dist/connect/mappers/assertions.d.ts +3 -0
- package/dist/connect/mappers/assertions.js +43 -0
- package/dist/connect/mappers/credentials.d.ts +3 -0
- package/dist/connect/mappers/credentials.js +18 -0
- package/dist/connect/mappers/domain.d.ts +3 -0
- package/dist/connect/mappers/domain.js +19 -0
- package/dist/connect/mappers/index.d.ts +7 -0
- package/dist/connect/mappers/index.js +41 -0
- package/dist/connect/mappers/number.d.ts +3 -0
- package/dist/connect/mappers/number.js +26 -0
- package/dist/connect/mappers/peer.d.ts +3 -0
- package/dist/connect/mappers/peer.js +26 -0
- package/dist/connect/mappers/trunk.d.ts +3 -0
- package/dist/connect/mappers/trunk.js +34 -0
- package/dist/connect/protos/acl.proto +112 -0
- package/dist/connect/protos/agents.proto +153 -0
- package/dist/connect/protos/credentials.proto +114 -0
- package/dist/connect/protos/domains.proto +146 -0
- package/dist/connect/protos/numbers.proto +166 -0
- package/dist/connect/protos/peers.proto +174 -0
- package/dist/connect/protos/trunks.proto +178 -0
- package/dist/connect/schemas/acl.d.ts +66 -0
- package/dist/connect/schemas/acl.js +85 -0
- package/dist/connect/schemas/agent.d.ts +61 -0
- package/dist/connect/schemas/agent.js +80 -0
- package/dist/connect/schemas/crendentials.d.ts +59 -0
- package/dist/connect/schemas/crendentials.js +78 -0
- package/dist/connect/schemas/domain.d.ts +72 -0
- package/dist/connect/schemas/domain.js +91 -0
- package/dist/connect/schemas/index.d.ts +1 -0
- package/dist/connect/schemas/index.js +35 -0
- package/dist/connect/schemas/number.d.ts +81 -0
- package/dist/connect/schemas/number.js +100 -0
- package/dist/connect/schemas/peer.d.ts +84 -0
- package/dist/connect/schemas/peer.js +103 -0
- package/dist/connect/schemas/trunk.d.ts +125 -0
- package/dist/connect/schemas/trunk.js +157 -0
- package/dist/connect/schemas/validators.d.ts +2 -0
- package/dist/connect/schemas/validators.js +43 -0
- package/dist/connect/types.d.ts +91 -23
- package/dist/connect/types.js +17 -37
- package/dist/connect/validations.d.ts +43 -0
- package/dist/connect/validations.js +272 -0
- package/dist/envs.d.ts +2 -0
- package/dist/envs.js +23 -0
- package/dist/errors.d.ts +35 -1
- package/dist/errors.js +52 -6
- package/dist/healthcheck.d.ts +1 -0
- package/dist/healthcheck.js +24 -0
- package/dist/helper.d.ts +17 -4
- package/dist/helper.js +82 -8
- package/dist/index.d.ts +8 -4
- package/dist/index.js +9 -8
- package/dist/ip_utils.js +1 -1
- package/dist/protos/common.proto +1 -3
- package/dist/protos/location.proto +23 -8
- package/dist/protos/processor.proto +3 -2
- package/dist/protos/requester.proto +1 -1
- package/dist/protos/sipmessage.proto +8 -1
- package/dist/protos/verifier.proto +39 -0
- package/dist/requester/grpc_client.js +1 -1
- package/dist/requester/index.js +1 -1
- package/dist/service.d.ts +2 -2
- package/dist/service.js +26 -4
- package/dist/tracer.js +1 -1
- package/dist/types.d.ts +120 -88
- package/dist/types.js +79 -69
- package/dist/verifier/grpc_client.d.ts +1 -0
- package/dist/{connect → verifier}/grpc_client.js +4 -4
- package/dist/verifier/index.d.ts +2 -0
- package/dist/verifier/index.js +36 -0
- package/dist/verifier/types.d.ts +10 -0
- package/dist/verifier/types.js +2 -0
- package/dist/verifier/verifier.d.ts +3 -0
- package/dist/verifier/verifier.js +64 -0
- package/package.json +17 -7
- package/dist/connect/data_api.d.ts +0 -11
- package/dist/connect/data_api.js +0 -91
- package/dist/connect/grpc_client.d.ts +0 -1
- package/dist/protos/resources.proto +0 -108
package/dist/ip_utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLocalnetIp = exports.isLocalnet = exports.addressCount = exports.hasIp = exports.formatNet = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/routr
|
|
7
7
|
*
|
|
8
8
|
* This file is part of Routr
|
package/dist/protos/common.proto
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
3
3
|
* http://github.com/fonoster/routr
|
|
4
4
|
*
|
|
5
5
|
* This file is part of Routr
|
|
@@ -33,5 +33,3 @@ enum Transport {
|
|
|
33
33
|
WS = 4;
|
|
34
34
|
WSS = 5;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
message Empty {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
3
3
|
* http://github.com/fonoster/routr
|
|
4
4
|
*
|
|
5
5
|
* This file is part of Routr
|
|
@@ -25,16 +25,17 @@ option java_package = "io.routr.location";
|
|
|
25
25
|
option java_outer_classname = "LocationProto";
|
|
26
26
|
option objc_class_prefix = "LC";
|
|
27
27
|
|
|
28
|
+
import "google/protobuf/empty.proto";
|
|
28
29
|
import "common.proto";
|
|
29
30
|
import "processor.proto";
|
|
30
31
|
|
|
31
32
|
service Location {
|
|
32
|
-
rpc AddRoute (AddRouteRequest) returns (
|
|
33
|
+
rpc AddRoute (AddRouteRequest) returns (.google.protobuf.Empty) {}
|
|
33
34
|
rpc FindRoutes (FindRoutesRequest) returns (FindRoutesResponse) {}
|
|
34
|
-
rpc RemoveRoutes (RemoveRoutesRequest) returns (
|
|
35
|
+
rpc RemoveRoutes (RemoveRoutesRequest) returns (.google.protobuf.Empty) {}
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
// A binding
|
|
38
|
+
// A binding created by an actual endpoint (Softphone, PBX, Conference System, etc.)
|
|
38
39
|
message Route {
|
|
39
40
|
string user = 1;
|
|
40
41
|
string host = 2;
|
|
@@ -44,11 +45,13 @@ message Route {
|
|
|
44
45
|
int32 expires = 6;
|
|
45
46
|
int32 session_count = 7;
|
|
46
47
|
string edge_port_ref = 8;
|
|
47
|
-
fonoster.routr.processor.v2draft1.NetInterface
|
|
48
|
+
repeated fonoster.routr.processor.v2draft1.NetInterface listening_points = 9;
|
|
49
|
+
repeated string localnets = 10;
|
|
50
|
+
repeated string external_addrs = 11;
|
|
48
51
|
// During route creation, an endpoint can request to add labels than can later be
|
|
49
52
|
// used as selectors. For example, a Softphone can add a label `priority=1` to indicate
|
|
50
53
|
// that it is the prefered endpoint for the given AOR.
|
|
51
|
-
map<string, string> labels =
|
|
54
|
+
map<string, string> labels = 12;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
message AddRouteRequest {
|
|
@@ -58,8 +61,20 @@ message AddRouteRequest {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
message FindRoutesRequest {
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
message Backend {
|
|
65
|
+
enum Algoritm {
|
|
66
|
+
ROUND_ROBIN = 0;
|
|
67
|
+
LEAST_SESSIONS = 1;
|
|
68
|
+
}
|
|
69
|
+
string ref = 1;
|
|
70
|
+
bool with_session_affinity = 2;
|
|
71
|
+
Algoritm algorithm = 3;
|
|
72
|
+
}
|
|
73
|
+
string call_id = 1;
|
|
74
|
+
string aor = 2;
|
|
75
|
+
string session_affinity_ref = 3;
|
|
76
|
+
Backend backend = 4;
|
|
77
|
+
map<string, string> labels = 5;
|
|
63
78
|
}
|
|
64
79
|
|
|
65
80
|
message FindRoutesResponse {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
3
3
|
* http://github.com/fonoster/routr
|
|
4
4
|
*
|
|
5
5
|
* This file is part of Routr
|
|
@@ -86,5 +86,6 @@ message MessageRequest {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
message MessageResponse {
|
|
89
|
-
|
|
89
|
+
NetInterface sender = 1;
|
|
90
|
+
fonoster.routr.sipmessage.v2draft1.SIPMessage message = 2;
|
|
90
91
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
3
3
|
* http://github.com/fonoster/routr
|
|
4
4
|
*
|
|
5
5
|
* This file is part of Routr
|
|
@@ -130,6 +130,11 @@ message Via {
|
|
|
130
130
|
int32 port = 2;
|
|
131
131
|
string branch = 3;
|
|
132
132
|
string transport = 4;
|
|
133
|
+
bool r_port_flag = 5;
|
|
134
|
+
int32 r_port = 6;
|
|
135
|
+
string received = 7;
|
|
136
|
+
string m_addr = 8;
|
|
137
|
+
int32 ttl = 9;
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
message SipURI {
|
|
@@ -207,4 +212,6 @@ message SIPMessage {
|
|
|
207
212
|
repeated Via via = 13;
|
|
208
213
|
repeated Route route = 14;
|
|
209
214
|
repeated RecordRoute record_route = 15;
|
|
215
|
+
string reason_phrase = 16;
|
|
216
|
+
string body = 17;
|
|
210
217
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/routr
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Routr
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
syntax = "proto3";
|
|
20
|
+
|
|
21
|
+
package fonoster.verifier;
|
|
22
|
+
|
|
23
|
+
// JWT Verifier service
|
|
24
|
+
service Verifier {
|
|
25
|
+
// Verifies a JWT token
|
|
26
|
+
rpc Verify (VerifyRequest) returns (VerifyResponse) {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// The request message containing the JWT token
|
|
30
|
+
message VerifyRequest {
|
|
31
|
+
// The JWT token
|
|
32
|
+
string token = 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// The response message containing the JWT payload
|
|
36
|
+
message VerifyResponse {
|
|
37
|
+
// The JWT payload
|
|
38
|
+
map<string, string> payload = 2;
|
|
39
|
+
}
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.REQUESTER_PROTO = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
28
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
29
29
|
* http://github.com/fonoster/routr
|
|
30
30
|
*
|
|
31
31
|
* This file is part of Routr
|
package/dist/requester/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*
|
|
18
|
-
* Copyright (C)
|
|
18
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster
|
|
20
20
|
*
|
|
21
21
|
* This file is part of Routr.
|
package/dist/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectProto, ServiceInfo } from "./types";
|
|
2
|
-
import {
|
|
2
|
+
import { ServiceDefinitionNotFoundError } from "./errors";
|
|
3
3
|
export declare const PROCESSOR_OBJECT_PROTO: unknown;
|
|
4
4
|
export declare const LOCATION_OBJECT_PROTO: unknown;
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ export declare const LOCATION_OBJECT_PROTO: unknown;
|
|
|
8
8
|
* @param {ObjectProt} objectProto - The object proto to load.
|
|
9
9
|
* @return {A} The proto definition.
|
|
10
10
|
*/
|
|
11
|
-
export declare function getObjectProto<A>(objectProto: ObjectProto): A |
|
|
11
|
+
export declare function getObjectProto<A>(objectProto: ObjectProto): A | ServiceDefinitionNotFoundError;
|
|
12
12
|
/**
|
|
13
13
|
* Creates a new service using the given service definition.
|
|
14
14
|
*
|
package/dist/service.js
CHANGED
|
@@ -24,10 +24,31 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.getObjectProto = exports.LOCATION_OBJECT_PROTO = exports.PROCESSOR_OBJECT_PROTO = void 0;
|
|
27
|
-
|
|
27
|
+
/*
|
|
28
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
29
|
+
* http://github.com/fonoster/routr
|
|
30
|
+
*
|
|
31
|
+
* This file is part of Routr
|
|
32
|
+
*
|
|
33
|
+
* Licensed under the MIT License (the "License")
|
|
34
|
+
* you may not use this file except in compliance with
|
|
35
|
+
* the License. You may obtain a copy of the License at
|
|
36
|
+
*
|
|
37
|
+
* https://opensource.org/licenses/MIT
|
|
38
|
+
*
|
|
39
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
40
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
41
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
42
|
+
* See the License for the specific language governing permissions and
|
|
43
|
+
* limitations under the License.
|
|
44
|
+
*/
|
|
28
45
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
29
46
|
const protoLoader = __importStar(require("@grpc/proto-loader"));
|
|
47
|
+
const errors_1 = require("./errors");
|
|
30
48
|
const logger_1 = require("@fonoster/logger");
|
|
49
|
+
const grpc_health_check_1 = require("@fonoster/grpc-health-check");
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
51
|
+
const interceptor = require("grpc-interceptors");
|
|
31
52
|
const logger = (0, logger_1.getLogger)({ service: "common", filePath: __filename });
|
|
32
53
|
const loadOptions = {
|
|
33
54
|
keepCase: false,
|
|
@@ -62,7 +83,7 @@ function getObjectProto(objectProto) {
|
|
|
62
83
|
const objProto = (_b = (_a = grpc.loadPackageDefinition(definitions)) === null || _a === void 0 ? void 0 : _a.fonoster) === null || _b === void 0 ? void 0 : _b.routr[objectProto.name];
|
|
63
84
|
return (objProto === null || objProto === void 0 ? void 0 : objProto[objectProto.version])
|
|
64
85
|
? objProto[objectProto.version]
|
|
65
|
-
: new errors_1.
|
|
86
|
+
: new errors_1.ServiceDefinitionNotFoundError(objectProto.name, objectProto.version);
|
|
66
87
|
}
|
|
67
88
|
exports.getObjectProto = getObjectProto;
|
|
68
89
|
/**
|
|
@@ -76,11 +97,12 @@ function createService(serviceInfo) {
|
|
|
76
97
|
name: serviceInfo.name,
|
|
77
98
|
bindAddr: serviceInfo.bindAddr
|
|
78
99
|
});
|
|
79
|
-
|
|
100
|
+
withHealthChecks.start();
|
|
80
101
|
};
|
|
81
102
|
const credentials = grpc.ServerCredentials.createInsecure();
|
|
82
103
|
const server = new grpc.Server();
|
|
83
104
|
server.addService(serviceInfo.service, serviceInfo.handlers);
|
|
84
|
-
|
|
105
|
+
const withHealthChecks = interceptor.serverProxy((0, grpc_health_check_1.useHealth)(server));
|
|
106
|
+
withHealthChecks.bindAsync(serviceInfo.bindAddr, credentials, cb);
|
|
85
107
|
}
|
|
86
108
|
exports.default = createService;
|
package/dist/tracer.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.init = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import * as grpc from "@grpc/grpc-js";
|
|
1
2
|
import { ServiceDefinition } from "@grpc/proto-loader";
|
|
3
|
+
import { JsonArray, JsonValue, Struct } from "pb-util/build";
|
|
4
|
+
export type JsonData = Record<string, string | number | boolean | JsonValue | JsonArray | Struct>;
|
|
5
|
+
export declare const ANONYMOUS = "anonymous";
|
|
2
6
|
export declare enum Method {
|
|
3
7
|
UNKNOWN = "UNKNOWN",
|
|
4
8
|
REGISTER = "REGISTER",
|
|
@@ -13,23 +17,34 @@ export declare enum Method {
|
|
|
13
17
|
OPTIONS = "OPTIONS"
|
|
14
18
|
}
|
|
15
19
|
export declare enum Transport {
|
|
16
|
-
TCP = "
|
|
17
|
-
UDP = "
|
|
18
|
-
TLS = "
|
|
19
|
-
SCTP = "
|
|
20
|
-
WS = "
|
|
21
|
-
WSS = "
|
|
20
|
+
TCP = "TCP",
|
|
21
|
+
UDP = "UDP",
|
|
22
|
+
TLS = "TLS",
|
|
23
|
+
SCTP = "SCTP",
|
|
24
|
+
WS = "WS",
|
|
25
|
+
WSS = "WSS"
|
|
26
|
+
}
|
|
27
|
+
export declare enum LoadBalancingAlgorithm {
|
|
28
|
+
UNSPECIFIED = "UNSPECIFIED",
|
|
29
|
+
ROUND_ROBIN = "ROUND_ROBIN",
|
|
30
|
+
LEAST_SESSIONS = "LEAST_SESSIONS"
|
|
22
31
|
}
|
|
23
32
|
export declare enum ExtraHeader {
|
|
24
33
|
REQUEST_URI = "X-Request-Uri",
|
|
25
34
|
GATEWAY_AUTH = "X-Gateway-Auth",
|
|
26
35
|
EDGEPORT_REF = "X-Edgeport-Ref",
|
|
27
|
-
SESSION_COUNT = "X-Session-Count"
|
|
36
|
+
SESSION_COUNT = "X-Session-Count",
|
|
37
|
+
DOD_NUMBER = "X-DOD-Number",
|
|
38
|
+
DOD_PRIVACY = "X-DOD-Privacy",
|
|
39
|
+
CONNECT_TOKEN = "X-Connect-Token"
|
|
28
40
|
}
|
|
29
41
|
export declare enum Privacy {
|
|
30
|
-
NONE = "
|
|
31
|
-
PRIVATE = "
|
|
42
|
+
NONE = "NONE",
|
|
43
|
+
PRIVATE = "ID"
|
|
32
44
|
}
|
|
45
|
+
export type AuthorizationAlgorithm = "MD5";
|
|
46
|
+
export type AuthorizationScheme = "Digest";
|
|
47
|
+
export type Qop = "auth" | "auth-int" | "";
|
|
33
48
|
export interface NetInterface {
|
|
34
49
|
host: string;
|
|
35
50
|
port: number;
|
|
@@ -57,6 +72,7 @@ export interface ProcessorConfig {
|
|
|
57
72
|
export interface MiddlewareConfig {
|
|
58
73
|
ref: string;
|
|
59
74
|
addr: string;
|
|
75
|
+
postProcessor: boolean;
|
|
60
76
|
}
|
|
61
77
|
export interface ServiceInfo {
|
|
62
78
|
name: string;
|
|
@@ -72,32 +88,32 @@ export interface ObjectProto {
|
|
|
72
88
|
export interface AuthChallengeRequest {
|
|
73
89
|
realm: string;
|
|
74
90
|
domain: string;
|
|
75
|
-
scheme: string;
|
|
76
|
-
nonce: string;
|
|
77
|
-
algorithm: string;
|
|
78
|
-
qop: string;
|
|
79
91
|
opaque: string;
|
|
80
92
|
stale: boolean;
|
|
93
|
+
nonce: string;
|
|
94
|
+
scheme: AuthorizationScheme;
|
|
95
|
+
algorithm: AuthorizationAlgorithm;
|
|
96
|
+
qop: Qop;
|
|
81
97
|
}
|
|
82
98
|
export interface AuthChallengeResponse {
|
|
83
99
|
realm: string;
|
|
84
100
|
domain: string;
|
|
85
|
-
scheme: string;
|
|
86
101
|
cNonce: string;
|
|
102
|
+
nonce: string;
|
|
87
103
|
nonceCount: number;
|
|
88
104
|
response: string;
|
|
89
105
|
username: string;
|
|
90
|
-
nonce: string;
|
|
91
|
-
algorithm: string;
|
|
92
|
-
qop: string;
|
|
93
106
|
opaque: string;
|
|
94
107
|
stale: boolean;
|
|
95
108
|
uri: string;
|
|
96
|
-
method:
|
|
109
|
+
method: Method;
|
|
110
|
+
scheme: AuthorizationScheme;
|
|
111
|
+
algorithm: AuthorizationAlgorithm;
|
|
112
|
+
qop: Qop;
|
|
97
113
|
}
|
|
98
114
|
export declare enum HeaderModifierAction {
|
|
99
|
-
ADD =
|
|
100
|
-
REMOVE =
|
|
115
|
+
ADD = 0,
|
|
116
|
+
REMOVE = 1
|
|
101
117
|
}
|
|
102
118
|
export interface HeaderModifier {
|
|
103
119
|
name: string;
|
|
@@ -110,72 +126,81 @@ export interface Route {
|
|
|
110
126
|
port: number;
|
|
111
127
|
transport: Transport;
|
|
112
128
|
registeredOn?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Number of active sessions. This is used to determine if a route is
|
|
131
|
+
* overloaded and for load balancing.
|
|
132
|
+
*
|
|
133
|
+
* This value is reported by the endpoint during the REGISTER request,
|
|
134
|
+
* using the X-Session-Count header.
|
|
135
|
+
*/
|
|
113
136
|
sessionCount?: number;
|
|
114
137
|
expires?: number;
|
|
115
138
|
edgePortRef: string;
|
|
116
|
-
|
|
139
|
+
listeningPoints: NetInterface[];
|
|
140
|
+
localnets: string[];
|
|
141
|
+
externalAddrs: string[];
|
|
117
142
|
labels?: Map<string, string>;
|
|
118
143
|
headers?: HeaderModifier[];
|
|
119
144
|
}
|
|
120
145
|
export declare enum ResponseType {
|
|
121
|
-
UNKNOWN =
|
|
122
|
-
TRYING =
|
|
123
|
-
RINGING =
|
|
124
|
-
CALL_IS_BEING_FORWARDED =
|
|
125
|
-
QUEUED =
|
|
126
|
-
SESSION_PROGRESS =
|
|
127
|
-
SUCCESS =
|
|
128
|
-
OK =
|
|
129
|
-
ACCEPTED =
|
|
130
|
-
REDIRECTION =
|
|
131
|
-
MULTIPLE_CHOICES =
|
|
132
|
-
MOVED_PERMANENTLY =
|
|
133
|
-
MOVED_TEMPORARILY =
|
|
134
|
-
USE_PROXY =
|
|
135
|
-
ALTERNATIVE_SERVICE =
|
|
136
|
-
CLIENT_ERROR =
|
|
137
|
-
BAD_REQUEST =
|
|
138
|
-
UNAUTHORIZED =
|
|
139
|
-
PAYMENT_REQUIRED =
|
|
140
|
-
FORBIDDEN =
|
|
141
|
-
NOT_FOUND =
|
|
142
|
-
METHOD_NOT_ALLOWED =
|
|
143
|
-
NOT_ACCEPTABLE =
|
|
144
|
-
PROXY_AUTHENTICATION_REQUIRED =
|
|
145
|
-
REQUEST_TIMEOUT =
|
|
146
|
-
GONE =
|
|
147
|
-
REQUEST_ENTITY_TOO_LARGE =
|
|
148
|
-
REQUEST_URI_TOO_LONG =
|
|
149
|
-
UNSUPPORTED_MEDIA_TYPE =
|
|
150
|
-
UNSUPPORTED_URI_SCHEME =
|
|
151
|
-
BAD_EXTENSION =
|
|
152
|
-
EXTENSION_REQUIRED =
|
|
153
|
-
INTERVAL_TOO_BRIEF =
|
|
154
|
-
TEMPORARILY_UNAVAILABLE =
|
|
155
|
-
CALL_OR_TRANSACTION_DOES_NOT_EXIST =
|
|
156
|
-
LOOP_DETECTED =
|
|
157
|
-
TOO_MANY_HOPS =
|
|
158
|
-
ADDRESS_INCOMPLETE =
|
|
159
|
-
AMBIGUOUS =
|
|
160
|
-
BUSY_HERE =
|
|
161
|
-
REQUEST_TERMINATED =
|
|
162
|
-
NOT_ACCEPTABLE_HERE =
|
|
163
|
-
BAD_EVENT =
|
|
164
|
-
REQUEST_PENDING =
|
|
165
|
-
UNDECIPHERABLE =
|
|
166
|
-
SERVER_ERROR =
|
|
167
|
-
SERVER_INTERNAL_ERROR =
|
|
168
|
-
NOT_IMPLEMENTED =
|
|
169
|
-
BAD_GATEWAY =
|
|
170
|
-
SERVICE_UNAVAILABLE =
|
|
171
|
-
SERVER_TIMEOUT =
|
|
172
|
-
VERSION_NOT_SUPPORTED =
|
|
173
|
-
MESSAGE_TOO_LARGE =
|
|
174
|
-
GLOBAL_ERROR =
|
|
175
|
-
BUSY_EVERYWHERE =
|
|
176
|
-
DECLINE =
|
|
177
|
-
DOES_NOT_EXIST_ANYWHERE =
|
|
178
|
-
SESSION_NOT_ACCEPTABLE =
|
|
146
|
+
UNKNOWN = "UNKNOWN",
|
|
147
|
+
TRYING = "TRYING",
|
|
148
|
+
RINGING = "RINGING",
|
|
149
|
+
CALL_IS_BEING_FORWARDED = "CALL_IS_BEING_FORWARDED",
|
|
150
|
+
QUEUED = "QUEUED",
|
|
151
|
+
SESSION_PROGRESS = "SESSION_PROGRESS",
|
|
152
|
+
SUCCESS = "SUCCESS",
|
|
153
|
+
OK = "OK",
|
|
154
|
+
ACCEPTED = "ACCEPTED",
|
|
155
|
+
REDIRECTION = "REDIRECTION",
|
|
156
|
+
MULTIPLE_CHOICES = "MULTIPLE_CHOICES",
|
|
157
|
+
MOVED_PERMANENTLY = "MOVED_PERMANENTLY",
|
|
158
|
+
MOVED_TEMPORARILY = "MOVED_TEMPORARILY",
|
|
159
|
+
USE_PROXY = "USE_PROXY",
|
|
160
|
+
ALTERNATIVE_SERVICE = "ALTERNATIVE_SERVICE",
|
|
161
|
+
CLIENT_ERROR = "CLIENT_ERROR",
|
|
162
|
+
BAD_REQUEST = "BAD_REQUEST",
|
|
163
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
164
|
+
PAYMENT_REQUIRED = "PAYMENT_REQUIRED",
|
|
165
|
+
FORBIDDEN = "FORBIDDEN",
|
|
166
|
+
NOT_FOUND = "NOT_FOUND",
|
|
167
|
+
METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED",
|
|
168
|
+
NOT_ACCEPTABLE = "NOT_ACCEPTABLE",
|
|
169
|
+
PROXY_AUTHENTICATION_REQUIRED = "PROXY_AUTHENTICATION_REQUIRED",
|
|
170
|
+
REQUEST_TIMEOUT = "REQUEST_TIMEOUT",
|
|
171
|
+
GONE = "GONE",
|
|
172
|
+
REQUEST_ENTITY_TOO_LARGE = "REQUEST_ENTITY_TOO_LARGE",
|
|
173
|
+
REQUEST_URI_TOO_LONG = "REQUEST_URI_TOO_LONG",
|
|
174
|
+
UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE",
|
|
175
|
+
UNSUPPORTED_URI_SCHEME = "UNSUPPORTED_URI_SCHEME",
|
|
176
|
+
BAD_EXTENSION = "BAD_EXTENSION",
|
|
177
|
+
EXTENSION_REQUIRED = "EXTENSION_REQUIRED",
|
|
178
|
+
INTERVAL_TOO_BRIEF = "INTERVAL_TOO_BRIEF",
|
|
179
|
+
TEMPORARILY_UNAVAILABLE = "TEMPORARILY_UNAVAILABLE",
|
|
180
|
+
CALL_OR_TRANSACTION_DOES_NOT_EXIST = "CALL_OR_TRANSACTION_DOES_NOT_EXIST",
|
|
181
|
+
LOOP_DETECTED = "LOOP_DETECTED",
|
|
182
|
+
TOO_MANY_HOPS = "TOO_MANY_HOPS",
|
|
183
|
+
ADDRESS_INCOMPLETE = "ADDRESS_INCOMPLETE",
|
|
184
|
+
AMBIGUOUS = "AMBIGUOUS",
|
|
185
|
+
BUSY_HERE = "BUSY_HERE",
|
|
186
|
+
REQUEST_TERMINATED = "REQUEST_TERMINATED",
|
|
187
|
+
NOT_ACCEPTABLE_HERE = "NOT_ACCEPTABLE_HERE",
|
|
188
|
+
BAD_EVENT = "BAD_EVENT",
|
|
189
|
+
REQUEST_PENDING = "REQUEST_PENDING",
|
|
190
|
+
UNDECIPHERABLE = "UNDECIPHERABLE",
|
|
191
|
+
SERVER_ERROR = "SERVER_ERROR",
|
|
192
|
+
SERVER_INTERNAL_ERROR = "SERVER_INTERNAL_ERROR",
|
|
193
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
194
|
+
BAD_GATEWAY = "BAD_GATEWAY",
|
|
195
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
196
|
+
SERVER_TIMEOUT = "SERVER_TIMEOUT",
|
|
197
|
+
VERSION_NOT_SUPPORTED = "VERSION_NOT_SUPPORTED",
|
|
198
|
+
MESSAGE_TOO_LARGE = "MESSAGE_TOO_LARGE",
|
|
199
|
+
GLOBAL_ERROR = "GLOBAL_ERROR",
|
|
200
|
+
BUSY_EVERYWHERE = "BUSY_EVERYWHERE",
|
|
201
|
+
DECLINE = "DECLINE",
|
|
202
|
+
DOES_NOT_EXIST_ANYWHERE = "DOES_NOT_EXIST_ANYWHERE",
|
|
203
|
+
SESSION_NOT_ACCEPTABLE = "SESSION_NOT_ACCEPTABLE"
|
|
179
204
|
}
|
|
180
205
|
export interface WWWAuthenticate {
|
|
181
206
|
realm: string;
|
|
@@ -189,17 +214,17 @@ export interface WWWAuthenticate {
|
|
|
189
214
|
}
|
|
190
215
|
export interface Authorization {
|
|
191
216
|
realm: string;
|
|
192
|
-
scheme:
|
|
217
|
+
scheme: AuthorizationScheme;
|
|
193
218
|
nonce: string;
|
|
194
219
|
cNonce: string;
|
|
195
220
|
nonceCount: number;
|
|
196
221
|
response: string;
|
|
197
222
|
username: string;
|
|
198
223
|
uri: string;
|
|
199
|
-
algorithm:
|
|
200
|
-
qop:
|
|
224
|
+
algorithm: AuthorizationAlgorithm;
|
|
225
|
+
qop: Qop;
|
|
201
226
|
opaque: string;
|
|
202
|
-
method?:
|
|
227
|
+
method?: Method;
|
|
203
228
|
}
|
|
204
229
|
export interface CallID {
|
|
205
230
|
callId: string;
|
|
@@ -216,12 +241,17 @@ export interface Via {
|
|
|
216
241
|
port: number;
|
|
217
242
|
branch?: string;
|
|
218
243
|
transport: Transport;
|
|
244
|
+
received?: string;
|
|
245
|
+
rPortFlag?: boolean;
|
|
246
|
+
rPort?: number;
|
|
247
|
+
ttl?: number;
|
|
248
|
+
mAddr?: string;
|
|
219
249
|
}
|
|
220
250
|
export interface SipURI {
|
|
221
251
|
user?: string;
|
|
222
252
|
host: string;
|
|
223
253
|
port?: number;
|
|
224
|
-
transportParam:
|
|
254
|
+
transportParam: Transport;
|
|
225
255
|
mAddrParam?: string;
|
|
226
256
|
userParam?: string;
|
|
227
257
|
ttlParam?: number;
|
|
@@ -281,10 +311,11 @@ export interface SIPMessage {
|
|
|
281
311
|
wwwAuthenticate?: WWWAuthenticate;
|
|
282
312
|
maxForwards: MaxForwards;
|
|
283
313
|
authorization?: Authorization;
|
|
284
|
-
extensions
|
|
285
|
-
via
|
|
286
|
-
route
|
|
287
|
-
recordRoute
|
|
314
|
+
extensions: Extension[];
|
|
315
|
+
via: Via[];
|
|
316
|
+
route: RouteHeader[];
|
|
317
|
+
recordRoute: RecordRoute[];
|
|
318
|
+
body?: string;
|
|
288
319
|
}
|
|
289
320
|
export interface GrpcCallback {
|
|
290
321
|
(error: Error | {
|
|
@@ -293,4 +324,5 @@ export interface GrpcCallback {
|
|
|
293
324
|
}
|
|
294
325
|
export interface GrpcCall {
|
|
295
326
|
request: Record<string, any>;
|
|
327
|
+
metadata?: grpc.Metadata;
|
|
296
328
|
}
|