@routr/common 2.0.8-alpha.25 → 2.0.8-alpha.28

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.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToErrorResponse = exports.CodeToResponseTypeMap = void 0;
4
- const types_1 = require("../types");
5
4
  /*
6
5
  * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
7
6
  * http://github.com/fonoster
@@ -20,6 +19,7 @@ const types_1 = require("../types");
20
19
  * See the License for the specific language governing permissions and
21
20
  * limitations under the License.
22
21
  */
22
+ const types_1 = require("../types");
23
23
  exports.CodeToResponseTypeMap = {
24
24
  401: types_1.ResponseType.UNAUTHORIZED,
25
25
  403: types_1.ResponseType.FORBIDDEN,
@@ -5,3 +5,4 @@ export * from "./config";
5
5
  export * from "./mappers";
6
6
  export * from "./assertions";
7
7
  export * from "./validations";
8
+ export * from "./connect_error";
@@ -39,3 +39,4 @@ __exportStar(require("./config"), exports);
39
39
  __exportStar(require("./mappers"), exports);
40
40
  __exportStar(require("./assertions"), exports);
41
41
  __exportStar(require("./validations"), exports);
42
+ __exportStar(require("./connect_error"), exports);
@@ -86,5 +86,6 @@ message MessageRequest {
86
86
  }
87
87
 
88
88
  message MessageResponse {
89
- fonoster.routr.sipmessage.v2draft1.SIPMessage message = 1;
89
+ NetInterface sender = 1;
90
+ fonoster.routr.sipmessage.v2draft1.SIPMessage message = 2;
90
91
  }
@@ -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 {
package/dist/types.d.ts CHANGED
@@ -70,6 +70,7 @@ export interface ProcessorConfig {
70
70
  export interface MiddlewareConfig {
71
71
  ref: string;
72
72
  addr: string;
73
+ postProcessor: boolean;
73
74
  }
74
75
  export interface ServiceInfo {
75
76
  name: string;
@@ -140,64 +141,64 @@ export interface Route {
140
141
  headers?: HeaderModifier[];
141
142
  }
142
143
  export declare enum ResponseType {
143
- UNKNOWN = 0,
144
- TRYING = 1,
145
- RINGING = 2,
146
- CALL_IS_BEING_FORWARDED = 3,
147
- QUEUED = 4,
148
- SESSION_PROGRESS = 5,
149
- SUCCESS = 6,
150
- OK = 7,
151
- ACCEPTED = 8,
152
- REDIRECTION = 9,
153
- MULTIPLE_CHOICES = 10,
154
- MOVED_PERMANENTLY = 11,
155
- MOVED_TEMPORARILY = 12,
156
- USE_PROXY = 13,
157
- ALTERNATIVE_SERVICE = 14,
158
- CLIENT_ERROR = 15,
159
- BAD_REQUEST = 16,
160
- UNAUTHORIZED = 17,
161
- PAYMENT_REQUIRED = 18,
162
- FORBIDDEN = 19,
163
- NOT_FOUND = 20,
164
- METHOD_NOT_ALLOWED = 21,
165
- NOT_ACCEPTABLE = 22,
166
- PROXY_AUTHENTICATION_REQUIRED = 23,
167
- REQUEST_TIMEOUT = 24,
168
- GONE = 25,
169
- REQUEST_ENTITY_TOO_LARGE = 26,
170
- REQUEST_URI_TOO_LONG = 27,
171
- UNSUPPORTED_MEDIA_TYPE = 28,
172
- UNSUPPORTED_URI_SCHEME = 29,
173
- BAD_EXTENSION = 30,
174
- EXTENSION_REQUIRED = 31,
175
- INTERVAL_TOO_BRIEF = 32,
176
- TEMPORARILY_UNAVAILABLE = 33,
177
- CALL_OR_TRANSACTION_DOES_NOT_EXIST = 34,
178
- LOOP_DETECTED = 35,
179
- TOO_MANY_HOPS = 36,
180
- ADDRESS_INCOMPLETE = 37,
181
- AMBIGUOUS = 38,
182
- BUSY_HERE = 39,
183
- REQUEST_TERMINATED = 40,
184
- NOT_ACCEPTABLE_HERE = 41,
185
- BAD_EVENT = 42,
186
- REQUEST_PENDING = 43,
187
- UNDECIPHERABLE = 44,
188
- SERVER_ERROR = 45,
189
- SERVER_INTERNAL_ERROR = 46,
190
- NOT_IMPLEMENTED = 47,
191
- BAD_GATEWAY = 48,
192
- SERVICE_UNAVAILABLE = 49,
193
- SERVER_TIMEOUT = 50,
194
- VERSION_NOT_SUPPORTED = 51,
195
- MESSAGE_TOO_LARGE = 52,
196
- GLOBAL_ERROR = 53,
197
- BUSY_EVERYWHERE = 54,
198
- DECLINE = 55,
199
- DOES_NOT_EXIST_ANYWHERE = 56,
200
- SESSION_NOT_ACCEPTABLE = 57
144
+ UNKNOWN = "UNKNOWN",
145
+ TRYING = "TRYING",
146
+ RINGING = "RINGING",
147
+ CALL_IS_BEING_FORWARDED = "CALL_IS_BEING_FORWARDED",
148
+ QUEUED = "QUEUED",
149
+ SESSION_PROGRESS = "SESSION_PROGRESS",
150
+ SUCCESS = "SUCCESS",
151
+ OK = "OK",
152
+ ACCEPTED = "ACCEPTED",
153
+ REDIRECTION = "REDIRECTION",
154
+ MULTIPLE_CHOICES = "MULTIPLE_CHOICES",
155
+ MOVED_PERMANENTLY = "MOVED_PERMANENTLY",
156
+ MOVED_TEMPORARILY = "MOVED_TEMPORARILY",
157
+ USE_PROXY = "USE_PROXY",
158
+ ALTERNATIVE_SERVICE = "ALTERNATIVE_SERVICE",
159
+ CLIENT_ERROR = "CLIENT_ERROR",
160
+ BAD_REQUEST = "BAD_REQUEST",
161
+ UNAUTHORIZED = "UNAUTHORIZED",
162
+ PAYMENT_REQUIRED = "PAYMENT_REQUIRED",
163
+ FORBIDDEN = "FORBIDDEN",
164
+ NOT_FOUND = "NOT_FOUND",
165
+ METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED",
166
+ NOT_ACCEPTABLE = "NOT_ACCEPTABLE",
167
+ PROXY_AUTHENTICATION_REQUIRED = "PROXY_AUTHENTICATION_REQUIRED",
168
+ REQUEST_TIMEOUT = "REQUEST_TIMEOUT",
169
+ GONE = "GONE",
170
+ REQUEST_ENTITY_TOO_LARGE = "REQUEST_ENTITY_TOO_LARGE",
171
+ REQUEST_URI_TOO_LONG = "REQUEST_URI_TOO_LONG",
172
+ UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE",
173
+ UNSUPPORTED_URI_SCHEME = "UNSUPPORTED_URI_SCHEME",
174
+ BAD_EXTENSION = "BAD_EXTENSION",
175
+ EXTENSION_REQUIRED = "EXTENSION_REQUIRED",
176
+ INTERVAL_TOO_BRIEF = "INTERVAL_TOO_BRIEF",
177
+ TEMPORARILY_UNAVAILABLE = "TEMPORARILY_UNAVAILABLE",
178
+ CALL_OR_TRANSACTION_DOES_NOT_EXIST = "CALL_OR_TRANSACTION_DOES_NOT_EXIST",
179
+ LOOP_DETECTED = "LOOP_DETECTED",
180
+ TOO_MANY_HOPS = "TOO_MANY_HOPS",
181
+ ADDRESS_INCOMPLETE = "ADDRESS_INCOMPLETE",
182
+ AMBIGUOUS = "AMBIGUOUS",
183
+ BUSY_HERE = "BUSY_HERE",
184
+ REQUEST_TERMINATED = "REQUEST_TERMINATED",
185
+ NOT_ACCEPTABLE_HERE = "NOT_ACCEPTABLE_HERE",
186
+ BAD_EVENT = "BAD_EVENT",
187
+ REQUEST_PENDING = "REQUEST_PENDING",
188
+ UNDECIPHERABLE = "UNDECIPHERABLE",
189
+ SERVER_ERROR = "SERVER_ERROR",
190
+ SERVER_INTERNAL_ERROR = "SERVER_INTERNAL_ERROR",
191
+ NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
192
+ BAD_GATEWAY = "BAD_GATEWAY",
193
+ SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
194
+ SERVER_TIMEOUT = "SERVER_TIMEOUT",
195
+ VERSION_NOT_SUPPORTED = "VERSION_NOT_SUPPORTED",
196
+ MESSAGE_TOO_LARGE = "MESSAGE_TOO_LARGE",
197
+ GLOBAL_ERROR = "GLOBAL_ERROR",
198
+ BUSY_EVERYWHERE = "BUSY_EVERYWHERE",
199
+ DECLINE = "DECLINE",
200
+ DOES_NOT_EXIST_ANYWHERE = "DOES_NOT_EXIST_ANYWHERE",
201
+ SESSION_NOT_ACCEPTABLE = "SESSION_NOT_ACCEPTABLE"
201
202
  }
202
203
  export interface WWWAuthenticate {
203
204
  realm: string;
@@ -238,6 +239,11 @@ export interface Via {
238
239
  port: number;
239
240
  branch?: string;
240
241
  transport: Transport;
242
+ received?: string;
243
+ rPortFlag?: boolean;
244
+ rPort?: number;
245
+ ttl?: number;
246
+ mAddr?: string;
241
247
  }
242
248
  export interface SipURI {
243
249
  user?: string;
@@ -307,6 +313,7 @@ export interface SIPMessage {
307
313
  via: Via[];
308
314
  route: RouteHeader[];
309
315
  recordRoute: RecordRoute[];
316
+ body?: string;
310
317
  }
311
318
  export interface GrpcCallback {
312
319
  (error: Error | {
package/dist/types.js CHANGED
@@ -51,64 +51,64 @@ var HeaderModifierAction;
51
51
  })(HeaderModifierAction = exports.HeaderModifierAction || (exports.HeaderModifierAction = {}));
52
52
  var ResponseType;
53
53
  (function (ResponseType) {
54
- ResponseType[ResponseType["UNKNOWN"] = 0] = "UNKNOWN";
55
- ResponseType[ResponseType["TRYING"] = 1] = "TRYING";
56
- ResponseType[ResponseType["RINGING"] = 2] = "RINGING";
57
- ResponseType[ResponseType["CALL_IS_BEING_FORWARDED"] = 3] = "CALL_IS_BEING_FORWARDED";
58
- ResponseType[ResponseType["QUEUED"] = 4] = "QUEUED";
59
- ResponseType[ResponseType["SESSION_PROGRESS"] = 5] = "SESSION_PROGRESS";
60
- ResponseType[ResponseType["SUCCESS"] = 6] = "SUCCESS";
61
- ResponseType[ResponseType["OK"] = 7] = "OK";
62
- ResponseType[ResponseType["ACCEPTED"] = 8] = "ACCEPTED";
63
- ResponseType[ResponseType["REDIRECTION"] = 9] = "REDIRECTION";
64
- ResponseType[ResponseType["MULTIPLE_CHOICES"] = 10] = "MULTIPLE_CHOICES";
65
- ResponseType[ResponseType["MOVED_PERMANENTLY"] = 11] = "MOVED_PERMANENTLY";
66
- ResponseType[ResponseType["MOVED_TEMPORARILY"] = 12] = "MOVED_TEMPORARILY";
67
- ResponseType[ResponseType["USE_PROXY"] = 13] = "USE_PROXY";
68
- ResponseType[ResponseType["ALTERNATIVE_SERVICE"] = 14] = "ALTERNATIVE_SERVICE";
69
- ResponseType[ResponseType["CLIENT_ERROR"] = 15] = "CLIENT_ERROR";
70
- ResponseType[ResponseType["BAD_REQUEST"] = 16] = "BAD_REQUEST";
71
- ResponseType[ResponseType["UNAUTHORIZED"] = 17] = "UNAUTHORIZED";
72
- ResponseType[ResponseType["PAYMENT_REQUIRED"] = 18] = "PAYMENT_REQUIRED";
73
- ResponseType[ResponseType["FORBIDDEN"] = 19] = "FORBIDDEN";
74
- ResponseType[ResponseType["NOT_FOUND"] = 20] = "NOT_FOUND";
75
- ResponseType[ResponseType["METHOD_NOT_ALLOWED"] = 21] = "METHOD_NOT_ALLOWED";
76
- ResponseType[ResponseType["NOT_ACCEPTABLE"] = 22] = "NOT_ACCEPTABLE";
77
- ResponseType[ResponseType["PROXY_AUTHENTICATION_REQUIRED"] = 23] = "PROXY_AUTHENTICATION_REQUIRED";
78
- ResponseType[ResponseType["REQUEST_TIMEOUT"] = 24] = "REQUEST_TIMEOUT";
79
- ResponseType[ResponseType["GONE"] = 25] = "GONE";
80
- ResponseType[ResponseType["REQUEST_ENTITY_TOO_LARGE"] = 26] = "REQUEST_ENTITY_TOO_LARGE";
81
- ResponseType[ResponseType["REQUEST_URI_TOO_LONG"] = 27] = "REQUEST_URI_TOO_LONG";
82
- ResponseType[ResponseType["UNSUPPORTED_MEDIA_TYPE"] = 28] = "UNSUPPORTED_MEDIA_TYPE";
83
- ResponseType[ResponseType["UNSUPPORTED_URI_SCHEME"] = 29] = "UNSUPPORTED_URI_SCHEME";
84
- ResponseType[ResponseType["BAD_EXTENSION"] = 30] = "BAD_EXTENSION";
85
- ResponseType[ResponseType["EXTENSION_REQUIRED"] = 31] = "EXTENSION_REQUIRED";
86
- ResponseType[ResponseType["INTERVAL_TOO_BRIEF"] = 32] = "INTERVAL_TOO_BRIEF";
87
- ResponseType[ResponseType["TEMPORARILY_UNAVAILABLE"] = 33] = "TEMPORARILY_UNAVAILABLE";
88
- ResponseType[ResponseType["CALL_OR_TRANSACTION_DOES_NOT_EXIST"] = 34] = "CALL_OR_TRANSACTION_DOES_NOT_EXIST";
89
- ResponseType[ResponseType["LOOP_DETECTED"] = 35] = "LOOP_DETECTED";
90
- ResponseType[ResponseType["TOO_MANY_HOPS"] = 36] = "TOO_MANY_HOPS";
91
- ResponseType[ResponseType["ADDRESS_INCOMPLETE"] = 37] = "ADDRESS_INCOMPLETE";
92
- ResponseType[ResponseType["AMBIGUOUS"] = 38] = "AMBIGUOUS";
93
- ResponseType[ResponseType["BUSY_HERE"] = 39] = "BUSY_HERE";
94
- ResponseType[ResponseType["REQUEST_TERMINATED"] = 40] = "REQUEST_TERMINATED";
95
- ResponseType[ResponseType["NOT_ACCEPTABLE_HERE"] = 41] = "NOT_ACCEPTABLE_HERE";
96
- ResponseType[ResponseType["BAD_EVENT"] = 42] = "BAD_EVENT";
97
- ResponseType[ResponseType["REQUEST_PENDING"] = 43] = "REQUEST_PENDING";
98
- ResponseType[ResponseType["UNDECIPHERABLE"] = 44] = "UNDECIPHERABLE";
99
- ResponseType[ResponseType["SERVER_ERROR"] = 45] = "SERVER_ERROR";
100
- ResponseType[ResponseType["SERVER_INTERNAL_ERROR"] = 46] = "SERVER_INTERNAL_ERROR";
101
- ResponseType[ResponseType["NOT_IMPLEMENTED"] = 47] = "NOT_IMPLEMENTED";
102
- ResponseType[ResponseType["BAD_GATEWAY"] = 48] = "BAD_GATEWAY";
103
- ResponseType[ResponseType["SERVICE_UNAVAILABLE"] = 49] = "SERVICE_UNAVAILABLE";
104
- ResponseType[ResponseType["SERVER_TIMEOUT"] = 50] = "SERVER_TIMEOUT";
105
- ResponseType[ResponseType["VERSION_NOT_SUPPORTED"] = 51] = "VERSION_NOT_SUPPORTED";
106
- ResponseType[ResponseType["MESSAGE_TOO_LARGE"] = 52] = "MESSAGE_TOO_LARGE";
107
- ResponseType[ResponseType["GLOBAL_ERROR"] = 53] = "GLOBAL_ERROR";
108
- ResponseType[ResponseType["BUSY_EVERYWHERE"] = 54] = "BUSY_EVERYWHERE";
109
- ResponseType[ResponseType["DECLINE"] = 55] = "DECLINE";
110
- ResponseType[ResponseType["DOES_NOT_EXIST_ANYWHERE"] = 56] = "DOES_NOT_EXIST_ANYWHERE";
111
- ResponseType[ResponseType["SESSION_NOT_ACCEPTABLE"] = 57] = "SESSION_NOT_ACCEPTABLE";
54
+ ResponseType["UNKNOWN"] = "UNKNOWN";
55
+ ResponseType["TRYING"] = "TRYING";
56
+ ResponseType["RINGING"] = "RINGING";
57
+ ResponseType["CALL_IS_BEING_FORWARDED"] = "CALL_IS_BEING_FORWARDED";
58
+ ResponseType["QUEUED"] = "QUEUED";
59
+ ResponseType["SESSION_PROGRESS"] = "SESSION_PROGRESS";
60
+ ResponseType["SUCCESS"] = "SUCCESS";
61
+ ResponseType["OK"] = "OK";
62
+ ResponseType["ACCEPTED"] = "ACCEPTED";
63
+ ResponseType["REDIRECTION"] = "REDIRECTION";
64
+ ResponseType["MULTIPLE_CHOICES"] = "MULTIPLE_CHOICES";
65
+ ResponseType["MOVED_PERMANENTLY"] = "MOVED_PERMANENTLY";
66
+ ResponseType["MOVED_TEMPORARILY"] = "MOVED_TEMPORARILY";
67
+ ResponseType["USE_PROXY"] = "USE_PROXY";
68
+ ResponseType["ALTERNATIVE_SERVICE"] = "ALTERNATIVE_SERVICE";
69
+ ResponseType["CLIENT_ERROR"] = "CLIENT_ERROR";
70
+ ResponseType["BAD_REQUEST"] = "BAD_REQUEST";
71
+ ResponseType["UNAUTHORIZED"] = "UNAUTHORIZED";
72
+ ResponseType["PAYMENT_REQUIRED"] = "PAYMENT_REQUIRED";
73
+ ResponseType["FORBIDDEN"] = "FORBIDDEN";
74
+ ResponseType["NOT_FOUND"] = "NOT_FOUND";
75
+ ResponseType["METHOD_NOT_ALLOWED"] = "METHOD_NOT_ALLOWED";
76
+ ResponseType["NOT_ACCEPTABLE"] = "NOT_ACCEPTABLE";
77
+ ResponseType["PROXY_AUTHENTICATION_REQUIRED"] = "PROXY_AUTHENTICATION_REQUIRED";
78
+ ResponseType["REQUEST_TIMEOUT"] = "REQUEST_TIMEOUT";
79
+ ResponseType["GONE"] = "GONE";
80
+ ResponseType["REQUEST_ENTITY_TOO_LARGE"] = "REQUEST_ENTITY_TOO_LARGE";
81
+ ResponseType["REQUEST_URI_TOO_LONG"] = "REQUEST_URI_TOO_LONG";
82
+ ResponseType["UNSUPPORTED_MEDIA_TYPE"] = "UNSUPPORTED_MEDIA_TYPE";
83
+ ResponseType["UNSUPPORTED_URI_SCHEME"] = "UNSUPPORTED_URI_SCHEME";
84
+ ResponseType["BAD_EXTENSION"] = "BAD_EXTENSION";
85
+ ResponseType["EXTENSION_REQUIRED"] = "EXTENSION_REQUIRED";
86
+ ResponseType["INTERVAL_TOO_BRIEF"] = "INTERVAL_TOO_BRIEF";
87
+ ResponseType["TEMPORARILY_UNAVAILABLE"] = "TEMPORARILY_UNAVAILABLE";
88
+ ResponseType["CALL_OR_TRANSACTION_DOES_NOT_EXIST"] = "CALL_OR_TRANSACTION_DOES_NOT_EXIST";
89
+ ResponseType["LOOP_DETECTED"] = "LOOP_DETECTED";
90
+ ResponseType["TOO_MANY_HOPS"] = "TOO_MANY_HOPS";
91
+ ResponseType["ADDRESS_INCOMPLETE"] = "ADDRESS_INCOMPLETE";
92
+ ResponseType["AMBIGUOUS"] = "AMBIGUOUS";
93
+ ResponseType["BUSY_HERE"] = "BUSY_HERE";
94
+ ResponseType["REQUEST_TERMINATED"] = "REQUEST_TERMINATED";
95
+ ResponseType["NOT_ACCEPTABLE_HERE"] = "NOT_ACCEPTABLE_HERE";
96
+ ResponseType["BAD_EVENT"] = "BAD_EVENT";
97
+ ResponseType["REQUEST_PENDING"] = "REQUEST_PENDING";
98
+ ResponseType["UNDECIPHERABLE"] = "UNDECIPHERABLE";
99
+ ResponseType["SERVER_ERROR"] = "SERVER_ERROR";
100
+ ResponseType["SERVER_INTERNAL_ERROR"] = "SERVER_INTERNAL_ERROR";
101
+ ResponseType["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
102
+ ResponseType["BAD_GATEWAY"] = "BAD_GATEWAY";
103
+ ResponseType["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
104
+ ResponseType["SERVER_TIMEOUT"] = "SERVER_TIMEOUT";
105
+ ResponseType["VERSION_NOT_SUPPORTED"] = "VERSION_NOT_SUPPORTED";
106
+ ResponseType["MESSAGE_TOO_LARGE"] = "MESSAGE_TOO_LARGE";
107
+ ResponseType["GLOBAL_ERROR"] = "GLOBAL_ERROR";
108
+ ResponseType["BUSY_EVERYWHERE"] = "BUSY_EVERYWHERE";
109
+ ResponseType["DECLINE"] = "DECLINE";
110
+ ResponseType["DOES_NOT_EXIST_ANYWHERE"] = "DOES_NOT_EXIST_ANYWHERE";
111
+ ResponseType["SESSION_NOT_ACCEPTABLE"] = "SESSION_NOT_ACCEPTABLE";
112
112
  })(ResponseType = exports.ResponseType || (exports.ResponseType = {}));
113
113
  var MessageType;
114
114
  (function (MessageType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.0.8-alpha.25",
3
+ "version": "2.0.8-alpha.28",
4
4
  "description": "Common package",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -53,5 +53,5 @@
53
53
  "devDependencies": {
54
54
  "@types/js-yaml": "^4.0.5"
55
55
  },
56
- "gitHead": "4824bf6d45009486c1761f05acb530da8c48a997"
56
+ "gitHead": "d28aabb2fce0600aaae94aa37709e89ed7112c99"
57
57
  }