@fonoster/common 0.27.0 → 0.30.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/dist/assistants/index.d.ts +2 -6
- package/dist/assistants/index.js +2 -6
- package/dist/assistants/sessionAssistantSchema.d.ts +741 -0
- package/dist/assistants/sessionAssistantSchema.js +112 -0
- package/dist/assistants/testCasesSchema.d.ts +4 -4
- package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
- package/dist/calls/index.js +44 -0
- package/dist/cellsecrets/index.d.ts +91 -0
- package/dist/cellsecrets/index.js +299 -0
- package/dist/config/cli/check.d.ts +6 -0
- package/dist/config/cli/check.js +202 -0
- package/dist/config/cli/envFile.d.ts +23 -0
- package/dist/config/cli/envFile.js +81 -0
- package/dist/config/cli/exposure.d.ts +10 -0
- package/dist/config/cli/exposure.js +93 -0
- package/dist/config/cli/index.d.ts +2 -0
- package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
- package/dist/config/cli/info.d.ts +6 -0
- package/dist/config/cli/info.js +62 -0
- package/dist/config/cli/init.d.ts +9 -0
- package/dist/config/cli/init.js +152 -0
- package/dist/config/cli/main.d.ts +11 -0
- package/dist/config/cli/main.js +155 -0
- package/dist/config/cli/render.d.ts +44 -0
- package/dist/config/cli/render.js +129 -0
- package/dist/config/cli/secrets.d.ts +21 -0
- package/dist/config/cli/secrets.js +117 -0
- package/dist/{utils/findIntegrationsCredentials.d.ts → config/cli/types.d.ts} +6 -5
- package/dist/config/cli/types.js +7 -0
- package/dist/config/configHints.d.ts +39 -0
- package/dist/config/configHints.js +61 -0
- package/dist/{voice → config}/index.d.ts +12 -13
- package/dist/config/index.js +46 -0
- package/dist/config/integrationsSchema.d.ts +32 -0
- package/dist/config/integrationsSchema.js +56 -0
- package/dist/config/interpolateEnv.d.ts +34 -0
- package/dist/config/interpolateEnv.js +70 -0
- package/dist/config/loadServiceConfig.d.ts +33 -0
- package/dist/config/loadServiceConfig.js +121 -0
- package/dist/config/logsSchema.d.ts +76 -0
- package/dist/config/logsSchema.js +49 -0
- package/dist/config/natsConnection.d.ts +53 -0
- package/dist/config/natsConnection.js +58 -0
- package/dist/config/parseConfigFile.d.ts +7 -0
- package/dist/config/parseConfigFile.js +60 -0
- package/dist/config/resolveConfigFile.d.ts +17 -0
- package/dist/config/resolveConfigFile.js +54 -0
- package/dist/config/resolveSecretRefs.d.ts +35 -0
- package/dist/config/resolveSecretRefs.js +129 -0
- package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
- package/dist/config/strictDeep.js +58 -0
- package/dist/config/telemetrySchema.d.ts +39 -0
- package/dist/config/telemetrySchema.js +44 -0
- package/dist/config/toJsonSchema.d.ts +30 -0
- package/dist/config/toJsonSchema.js +161 -0
- package/dist/constants.d.ts +1 -4
- package/dist/constants.js +4 -5
- package/dist/envs.d.ts +2 -1
- package/dist/envs.js +13 -11
- package/dist/identity/createAuthInterceptor.d.ts +9 -2
- package/dist/identity/createAuthInterceptor.js +36 -30
- package/dist/identity/hasAccess.d.ts +9 -3
- package/dist/identity/hasAccess.js +32 -8
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +1 -0
- package/dist/identity/isValidToken.d.ts +12 -2
- package/dist/identity/isValidToken.js +25 -9
- package/dist/identity/roles.js +22 -6
- package/dist/identity/types.d.ts +6 -1
- package/dist/identity/types.js +1 -0
- package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
- package/dist/identity/verifyAccessToken.js +44 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +14 -2
- package/dist/net/assertPublicDestination.d.ts +52 -0
- package/dist/net/assertPublicDestination.js +342 -0
- package/dist/{voice/PlayDtmf.d.ts → net/index.d.ts} +1 -5
- package/dist/{voice → net}/index.js +1 -13
- package/dist/notifications/createSendEmail.js +3 -1
- package/dist/protos/applications.proto +124 -3
- package/dist/protos/authz.proto +23 -4
- package/dist/protos/capabilities.proto +94 -0
- package/dist/protos/identity.proto +26 -1
- package/dist/protos/providers.proto +135 -0
- package/dist/protos/webhooks.proto +140 -0
- package/dist/{voice/StopSay.d.ts → regions/hub/index.d.ts} +1 -6
- package/dist/regions/hub/index.js +35 -0
- package/dist/regions/hub/natsJwt.d.ts +63 -0
- package/dist/regions/hub/natsJwt.js +195 -0
- package/dist/registry/Registry.d.ts +79 -0
- package/dist/registry/Registry.js +418 -0
- package/dist/registry/cli.d.ts +20 -0
- package/dist/registry/cli.js +424 -0
- package/dist/{assistants/audioFiltersSchema.js → registry/features.d.ts} +13 -14
- package/dist/registry/features.js +36 -0
- package/dist/{assistants/LanguageModelProvider.d.ts → registry/index.d.ts} +6 -8
- package/dist/registry/index.js +40 -0
- package/dist/registry/prisma.d.ts +67 -0
- package/dist/registry/prisma.js +391 -0
- package/dist/registry/stores.d.ts +21 -0
- package/dist/{assistants/eventsHookSchema.js → registry/stores.js} +55 -18
- package/dist/registry/types.d.ts +98 -0
- package/dist/{voice/Say.d.ts → registry/types.js} +4 -10
- package/dist/registry/workspaceKeys.d.ts +41 -0
- package/dist/registry/workspaceKeys.js +64 -0
- package/dist/session/index.d.ts +19 -0
- package/dist/session/index.js +35 -0
- package/dist/session/schema.d.ts +1951 -0
- package/dist/session/schema.js +397 -0
- package/dist/sessions/index.d.ts +93 -0
- package/dist/sessions/index.js +194 -0
- package/dist/telemetry.d.ts +76 -0
- package/dist/telemetry.js +360 -0
- package/dist/types.d.ts +3 -5
- package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
- package/dist/utils/WriteBehind.js +64 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/{voice/Play.d.ts → utils/logUnhandledRejections.d.ts} +8 -12
- package/dist/utils/logUnhandledRejections.js +37 -0
- package/dist/validators/calls.d.ts +2 -2
- package/dist/validators/calls.js +5 -2
- package/dist/validators/identity.d.ts +37 -8
- package/dist/validators/identity.js +22 -3
- package/dist/validators/index.d.ts +1 -0
- package/dist/validators/index.js +1 -0
- package/dist/validators/sip.d.ts +40 -0
- package/dist/validators/sip.js +99 -0
- package/dist/validators/sipnet/credentials.d.ts +2 -2
- package/dist/validators/sipnet/domains.js +7 -7
- package/dist/validators/sipnet/trunks.d.ts +14 -14
- package/dist/validators/sipnet/trunks.js +4 -2
- package/dist/webhooks/Dispatcher.d.ts +87 -0
- package/dist/webhooks/Dispatcher.js +225 -0
- package/dist/webhooks/bus.d.ts +49 -0
- package/dist/webhooks/bus.js +170 -0
- package/dist/webhooks/events.d.ts +66 -0
- package/dist/webhooks/events.js +62 -0
- package/dist/webhooks/index.d.ts +23 -0
- package/dist/webhooks/index.js +39 -0
- package/dist/webhooks/prisma.d.ts +55 -0
- package/dist/webhooks/prisma.js +242 -0
- package/dist/webhooks/signing.d.ts +8 -0
- package/dist/webhooks/signing.js +53 -0
- package/package.json +25 -12
- package/schema/session.v1.json +791 -0
- package/dist/assistants/assistantSchema.d.ts +0 -739
- package/dist/assistants/assistantSchema.js +0 -37
- package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
- package/dist/assistants/conversationSettingsSchema.js +0 -133
- package/dist/assistants/eventsHookSchema.d.ts +0 -38
- package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
- package/dist/assistants/languageModelConfigSchema.js +0 -91
- package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
- package/dist/protos/voice.proto +0 -557
- package/dist/voice/Dial.js +0 -20
- package/dist/voice/Gather.d.ts +0 -37
- package/dist/voice/Gather.js +0 -9
- package/dist/voice/Mute.d.ts +0 -31
- package/dist/voice/Mute.js +0 -9
- package/dist/voice/Play.js +0 -2
- package/dist/voice/PlayDtmf.js +0 -2
- package/dist/voice/PlaybackControl.d.ts +0 -31
- package/dist/voice/PlaybackControl.js +0 -11
- package/dist/voice/Record.d.ts +0 -36
- package/dist/voice/Record.js +0 -7
- package/dist/voice/Say.js +0 -2
- package/dist/voice/StopSay.js +0 -2
- package/dist/voice/Stream.d.ts +0 -53
- package/dist/voice/Stream.js +0 -19
- package/dist/voice/StreamGather.d.ts +0 -34
- package/dist/voice/StreamGather.js +0 -9
- package/dist/voice/Verb.d.ts +0 -27
- package/dist/voice/Verb.js +0 -2
- package/dist/voice/voice.d.ts +0 -171
- package/dist/voice/voice.js +0 -65
package/dist/protos/voice.proto
DELETED
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
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.voice.v1beta2;
|
|
22
|
-
|
|
23
|
-
import "google/protobuf/struct.proto";
|
|
24
|
-
|
|
25
|
-
// The voice service definition
|
|
26
|
-
service Voice {
|
|
27
|
-
rpc CreateSession(stream VoiceInStream) returns (stream VoiceOutStream) {}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// CreateSessionRequest is the request message for the CreateSession method
|
|
31
|
-
message CreateSessionRequest {
|
|
32
|
-
// The account making the request on behalf of the caller
|
|
33
|
-
string access_key_id = 1;
|
|
34
|
-
|
|
35
|
-
// Reference to an application living in the platform
|
|
36
|
-
string app_ref = 2;
|
|
37
|
-
|
|
38
|
-
// gRPC endpoint for the voice service
|
|
39
|
-
string endpoint = 3;
|
|
40
|
-
|
|
41
|
-
// PSTN number or SIP URI associated with the session
|
|
42
|
-
string ingress_number = 4;
|
|
43
|
-
|
|
44
|
-
// The name of the caller
|
|
45
|
-
string caller_name = 5;
|
|
46
|
-
|
|
47
|
-
// The caller number for the phone calling from the
|
|
48
|
-
string caller_number = 6;
|
|
49
|
-
|
|
50
|
-
// The session ID generated by the Media Server
|
|
51
|
-
string media_session_ref = 7;
|
|
52
|
-
|
|
53
|
-
// The call reference identifier
|
|
54
|
-
string call_ref = 11;
|
|
55
|
-
|
|
56
|
-
// Use this token to validate the provenance of the request
|
|
57
|
-
// If the app_ref is provided, the token must include the app_ref as a claim
|
|
58
|
-
string session_token = 8;
|
|
59
|
-
|
|
60
|
-
// The direction of the call
|
|
61
|
-
enum CallDirection {
|
|
62
|
-
FROM_PSTN = 0;
|
|
63
|
-
TO_PSTN = 1;
|
|
64
|
-
INTRA_NETWORK = 2;
|
|
65
|
-
}
|
|
66
|
-
CallDirection call_direction = 9;
|
|
67
|
-
|
|
68
|
-
// Metadata associated with the session
|
|
69
|
-
map<string, string> metadata = 10;
|
|
70
|
-
|
|
71
|
-
// Answering Machine Detection result, computed on early call audio before
|
|
72
|
-
// this session is dispatched. Absent/UNSPECIFIED when the probe is disabled.
|
|
73
|
-
Amd amd = 12;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Answering Machine Detection verdict for the answered call
|
|
77
|
-
message Amd {
|
|
78
|
-
enum Status {
|
|
79
|
-
// The probe was disabled or did not run
|
|
80
|
-
AMD_STATUS_UNSPECIFIED = 0;
|
|
81
|
-
// A live person answered
|
|
82
|
-
HUMAN = 1;
|
|
83
|
-
// A generic answering machine answered
|
|
84
|
-
MACHINE = 2;
|
|
85
|
-
// A personal or carrier voicemail greeting answered
|
|
86
|
-
VOICEMAIL = 3;
|
|
87
|
-
// An auto-attendant / IVR menu answered
|
|
88
|
-
IVR = 4;
|
|
89
|
-
// The probe ran but was inconclusive (low confidence, silence, or timeout)
|
|
90
|
-
UNKNOWN = 5;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// The detected class of answerer
|
|
94
|
-
Status status = 1;
|
|
95
|
-
|
|
96
|
-
// Model confidence for the reported status, 0..1
|
|
97
|
-
float confidence = 2;
|
|
98
|
-
|
|
99
|
-
// Identifier of the detector that produced the verdict (e.g. "asterisk-amd@1")
|
|
100
|
-
string detector = 3;
|
|
101
|
-
|
|
102
|
-
// Wall-clock time spent producing the verdict, in milliseconds
|
|
103
|
-
int32 latency_ms = 4;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Common request for verbs
|
|
107
|
-
message VerbRequest {
|
|
108
|
-
string media_session_ref = 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Common response for verbs
|
|
112
|
-
message VerbResponse {
|
|
113
|
-
string media_session_ref = 1;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Request to play a sound
|
|
117
|
-
message PlayRequest {
|
|
118
|
-
// The session reference generated by the Media Server
|
|
119
|
-
string media_session_ref = 1;
|
|
120
|
-
|
|
121
|
-
// The URL of the sound to play
|
|
122
|
-
string url = 2;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Request to play a sound
|
|
126
|
-
message PlayResponse {
|
|
127
|
-
// The session reference generated by the Media Server
|
|
128
|
-
string media_session_ref = 1;
|
|
129
|
-
|
|
130
|
-
// The playback reference generated by the Media Server
|
|
131
|
-
string playback_ref = 2;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// The request message for the PlaybackControl method
|
|
135
|
-
message PlaybackControlRequest {
|
|
136
|
-
// The session reference generated by the Media Server
|
|
137
|
-
string media_session_ref = 1;
|
|
138
|
-
|
|
139
|
-
// The playback reference generated by the Media Server
|
|
140
|
-
string playback_ref = 2;
|
|
141
|
-
|
|
142
|
-
// The action to take
|
|
143
|
-
enum Action {
|
|
144
|
-
STOP = 0;
|
|
145
|
-
RESTART = 1;
|
|
146
|
-
PAUSE = 2;
|
|
147
|
-
UNPAUSE = 3;
|
|
148
|
-
FORWARD = 4;
|
|
149
|
-
}
|
|
150
|
-
Action action = 3;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// PlayDtmfRequest is the request message for the PlayDtmf method
|
|
154
|
-
message PlayDtmfRequest {
|
|
155
|
-
// The session reference generated by the Media Server
|
|
156
|
-
string media_session_ref = 1;
|
|
157
|
-
|
|
158
|
-
// The digits to play
|
|
159
|
-
string digits = 2;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Request to mute or unmute the call
|
|
163
|
-
message MuteRequest {
|
|
164
|
-
// The session reference generated by the Media Server
|
|
165
|
-
string media_session_ref = 1;
|
|
166
|
-
|
|
167
|
-
// The direction to mute
|
|
168
|
-
enum MuteDirection {
|
|
169
|
-
IN = 0;
|
|
170
|
-
OUT = 1;
|
|
171
|
-
BOTH = 2;
|
|
172
|
-
}
|
|
173
|
-
MuteDirection direction = 2;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Request to gather speech or DTMF
|
|
177
|
-
message GatherRequest {
|
|
178
|
-
// The session reference generated by the Media Server
|
|
179
|
-
string media_session_ref = 1;
|
|
180
|
-
|
|
181
|
-
// The source of the gather
|
|
182
|
-
enum GatherSource {
|
|
183
|
-
SPEECH = 0;
|
|
184
|
-
DTMF = 1;
|
|
185
|
-
SPEECH_AND_DTMF = 2;
|
|
186
|
-
}
|
|
187
|
-
GatherSource source = 2;
|
|
188
|
-
|
|
189
|
-
// Optional key to finish the gather
|
|
190
|
-
string finish_on_key = 3;
|
|
191
|
-
|
|
192
|
-
// Optional timeout in seconds
|
|
193
|
-
int32 timeout = 4;
|
|
194
|
-
|
|
195
|
-
// Optional number of digits to gather
|
|
196
|
-
int32 max_digits = 5;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Response to a gather request
|
|
200
|
-
message GatherResponse {
|
|
201
|
-
// The session reference generated by the Media Server
|
|
202
|
-
string media_session_ref = 1;
|
|
203
|
-
|
|
204
|
-
// The gathered speech or digits
|
|
205
|
-
oneof content {
|
|
206
|
-
string speech = 2;
|
|
207
|
-
string digits = 3;
|
|
208
|
-
}
|
|
209
|
-
int32 response_time = 4;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// RecordRequest is the request message to initiate a recording
|
|
213
|
-
message RecordRequest {
|
|
214
|
-
// The session reference generated by the Media Server
|
|
215
|
-
string media_session_ref = 1;
|
|
216
|
-
|
|
217
|
-
// The maximum duration of the recording in seconds
|
|
218
|
-
int32 max_duration = 2;
|
|
219
|
-
|
|
220
|
-
// The maximum silence before ending the recording in seconds
|
|
221
|
-
int32 max_silence = 3;
|
|
222
|
-
|
|
223
|
-
// Play a beep before recording
|
|
224
|
-
bool beep = 4;
|
|
225
|
-
|
|
226
|
-
// Finish recording on this key
|
|
227
|
-
string finish_on_key = 5;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Response to a record request
|
|
231
|
-
message RecordResponse {
|
|
232
|
-
// The session reference generated by the Media Server
|
|
233
|
-
string media_session_ref = 1;
|
|
234
|
-
|
|
235
|
-
// The name of the recording
|
|
236
|
-
string name = 2;
|
|
237
|
-
|
|
238
|
-
// The duration of the recording
|
|
239
|
-
int32 duration = 3;
|
|
240
|
-
|
|
241
|
-
// The format of the recording
|
|
242
|
-
enum RecordFormat {
|
|
243
|
-
WAV = 0;
|
|
244
|
-
}
|
|
245
|
-
RecordFormat format = 4;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Request to say a text
|
|
249
|
-
message SayRequest {
|
|
250
|
-
// The session reference generated by the Media Server
|
|
251
|
-
string media_session_ref = 1;
|
|
252
|
-
|
|
253
|
-
// The text to say
|
|
254
|
-
string text = 2;
|
|
255
|
-
|
|
256
|
-
// Assign a playback reference to the request
|
|
257
|
-
string playback_ref = 3 [deprecated = true];
|
|
258
|
-
|
|
259
|
-
// TTS options
|
|
260
|
-
google.protobuf.Struct options = 4;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
message StopSayRequest {
|
|
264
|
-
// The session reference generated by the Media Server
|
|
265
|
-
string media_session_ref = 1;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Dial request message
|
|
269
|
-
message DialRequest {
|
|
270
|
-
// The session reference generated by the Media Server
|
|
271
|
-
string media_session_ref = 1;
|
|
272
|
-
|
|
273
|
-
// The number to dial
|
|
274
|
-
string destination = 2;
|
|
275
|
-
|
|
276
|
-
// The caller ID to use (reserved for future use)
|
|
277
|
-
string caller_id = 3;
|
|
278
|
-
|
|
279
|
-
// The timeout in seconds
|
|
280
|
-
int32 timeout = 4;
|
|
281
|
-
|
|
282
|
-
// Record direction
|
|
283
|
-
enum RecordDirection {
|
|
284
|
-
IN = 0;
|
|
285
|
-
OUT = 1;
|
|
286
|
-
BOTH = 2;
|
|
287
|
-
}
|
|
288
|
-
RecordDirection record_direction = 5;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// Dial status message
|
|
292
|
-
message DialStatus {
|
|
293
|
-
// The session reference generated by the Media Server
|
|
294
|
-
string media_session_ref = 1;
|
|
295
|
-
|
|
296
|
-
// The status of the dial
|
|
297
|
-
enum Status {
|
|
298
|
-
TRYING = 0;
|
|
299
|
-
CANCEL = 1;
|
|
300
|
-
ANSWER = 2;
|
|
301
|
-
BUSY = 3;
|
|
302
|
-
PROGRESS = 4;
|
|
303
|
-
NOANSWER = 5;
|
|
304
|
-
// Maps from Asterisk's CHANUNAVAIL and CONGESTION
|
|
305
|
-
FAILED = 6;
|
|
306
|
-
}
|
|
307
|
-
Status status = 2;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// Request to start an audio stream
|
|
311
|
-
message StartStreamRequest {
|
|
312
|
-
// The session reference generated by the Media Server
|
|
313
|
-
string media_session_ref = 1;
|
|
314
|
-
|
|
315
|
-
// The direction of the stream
|
|
316
|
-
enum StreamDirection {
|
|
317
|
-
IN = 0;
|
|
318
|
-
OUT = 1;
|
|
319
|
-
BOTH = 2;
|
|
320
|
-
}
|
|
321
|
-
StreamDirection direction = 2;
|
|
322
|
-
|
|
323
|
-
// Output format
|
|
324
|
-
enum StreamAudioFormat {
|
|
325
|
-
WAV = 0;
|
|
326
|
-
}
|
|
327
|
-
StreamAudioFormat format = 3;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Response to a start stream request
|
|
331
|
-
message StartStreamResponse {
|
|
332
|
-
// The session reference generated by the Media Server
|
|
333
|
-
string media_session_ref = 1;
|
|
334
|
-
|
|
335
|
-
// The stream reference generated by the Media Server
|
|
336
|
-
string stream_ref = 2;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Request to stop an audio stream
|
|
340
|
-
message StopStreamRequest {
|
|
341
|
-
// The session reference generated by the Media Server
|
|
342
|
-
string media_session_ref = 1;
|
|
343
|
-
|
|
344
|
-
// The stream reference generated by the Media Server
|
|
345
|
-
string stream_ref = 2;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
// Message for the bidirectional streams
|
|
349
|
-
message StreamPayload {
|
|
350
|
-
// The session reference generated by the Media Server
|
|
351
|
-
string media_session_ref = 1;
|
|
352
|
-
|
|
353
|
-
// The stream reference generated by the Media Server
|
|
354
|
-
string stream_ref = 2;
|
|
355
|
-
|
|
356
|
-
// The message type
|
|
357
|
-
enum StreamMessageType {
|
|
358
|
-
AUDIO_IN = 0;
|
|
359
|
-
AUDIO_OUT = 1;
|
|
360
|
-
ERROR = 2;
|
|
361
|
-
}
|
|
362
|
-
StreamMessageType type = 3;
|
|
363
|
-
|
|
364
|
-
// The audio data
|
|
365
|
-
bytes data = 4;
|
|
366
|
-
|
|
367
|
-
// (Q. should we use the same error codes as gRPC?)
|
|
368
|
-
// Error code if any
|
|
369
|
-
string code = 5;
|
|
370
|
-
|
|
371
|
-
// Error message if any
|
|
372
|
-
string message = 6;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
// Request for Stream Gather
|
|
376
|
-
message StartStreamGatherRequest {
|
|
377
|
-
// The session reference generated by the Media Server
|
|
378
|
-
string media_session_ref = 1;
|
|
379
|
-
|
|
380
|
-
// The source of the gather
|
|
381
|
-
enum StreamGatherSource {
|
|
382
|
-
SPEECH = 0;
|
|
383
|
-
DTMF = 1;
|
|
384
|
-
SPEECH_AND_DTMF = 2;
|
|
385
|
-
}
|
|
386
|
-
StreamGatherSource source = 2;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// Request to stop a Stream Gather
|
|
390
|
-
message StopStreamGatherRequest {
|
|
391
|
-
// The session reference generated by the Media Server
|
|
392
|
-
string media_session_ref = 1;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// Response to Stream Gather request
|
|
396
|
-
message StreamGatherPayload {
|
|
397
|
-
// The session reference generated by the Media Server
|
|
398
|
-
string media_session_ref = 1;
|
|
399
|
-
|
|
400
|
-
// The gathered speech or a single digit
|
|
401
|
-
oneof content {
|
|
402
|
-
string speech = 2;
|
|
403
|
-
string digit = 3;
|
|
404
|
-
}
|
|
405
|
-
int32 response_time = 4;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// An audio filter the application wants applied to the caller's audio
|
|
409
|
-
message AudioFilter {
|
|
410
|
-
// Name of a filter registered in the Media Server (e.g. "aiCoustics")
|
|
411
|
-
string name = 1;
|
|
412
|
-
|
|
413
|
-
// Filter-specific options. Carries tuning values only; credentials are read
|
|
414
|
-
// from the Media Server's environment and never travel on this stream.
|
|
415
|
-
google.protobuf.Struct options = 2;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// Request to set the audio filters for the session. Sending it again replaces
|
|
419
|
-
// the previous filters; an empty list removes them.
|
|
420
|
-
message SetAudioFiltersRequest {
|
|
421
|
-
// The session reference generated by the Media Server
|
|
422
|
-
string media_session_ref = 1;
|
|
423
|
-
|
|
424
|
-
// Filters to run, in order
|
|
425
|
-
repeated AudioFilter filters = 2;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
// Result of setting the session's audio filters. `error` is set when the
|
|
429
|
-
// filters could not be applied; the call continues with unfiltered audio.
|
|
430
|
-
message SetAudioFiltersResponse {
|
|
431
|
-
// The session reference generated by the Media Server
|
|
432
|
-
string media_session_ref = 1;
|
|
433
|
-
|
|
434
|
-
// Empty when the filters were applied
|
|
435
|
-
string error = 2;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// VoiceInStream is the input stream for the voice service
|
|
439
|
-
message VoiceInStream {
|
|
440
|
-
oneof content {
|
|
441
|
-
// Initial request to create a new session
|
|
442
|
-
CreateSessionRequest request = 1;
|
|
443
|
-
|
|
444
|
-
// Command to accept the call
|
|
445
|
-
VerbResponse answer_response = 2;
|
|
446
|
-
|
|
447
|
-
// Response to a play request
|
|
448
|
-
PlayResponse play_response = 3;
|
|
449
|
-
|
|
450
|
-
// Response to a hangup request
|
|
451
|
-
VerbResponse hangup_response = 4;
|
|
452
|
-
|
|
453
|
-
// Response to a mute request
|
|
454
|
-
VerbResponse mute_response = 5;
|
|
455
|
-
|
|
456
|
-
// Response to a unmute request
|
|
457
|
-
VerbResponse unmute_response = 6;
|
|
458
|
-
|
|
459
|
-
// Response to a play dtmf request
|
|
460
|
-
VerbResponse play_dtmf_response = 7;
|
|
461
|
-
|
|
462
|
-
// Response to a gather request
|
|
463
|
-
GatherResponse gather_response = 8;
|
|
464
|
-
|
|
465
|
-
// Response to a playback control request
|
|
466
|
-
VerbResponse playback_control_response = 9;
|
|
467
|
-
|
|
468
|
-
// Response to a say request (It shares the same response as play)
|
|
469
|
-
PlayResponse say_response = 10;
|
|
470
|
-
|
|
471
|
-
// Response to stopping the an active say speech
|
|
472
|
-
VerbResponse stop_say_response = 18;
|
|
473
|
-
|
|
474
|
-
// Response to a record request
|
|
475
|
-
RecordResponse record_response = 11;
|
|
476
|
-
|
|
477
|
-
// Status of a dial request progress
|
|
478
|
-
DialStatus dial_status = 12;
|
|
479
|
-
|
|
480
|
-
// Response to a start stream request
|
|
481
|
-
StartStreamResponse start_stream_response = 13;
|
|
482
|
-
|
|
483
|
-
// Message for the bidirectional streams
|
|
484
|
-
StreamPayload stream_payload = 14;
|
|
485
|
-
|
|
486
|
-
// Response to start a stream gather
|
|
487
|
-
VerbResponse start_stream_gather_response = 15;
|
|
488
|
-
|
|
489
|
-
// Response to stop a stream gather
|
|
490
|
-
VerbResponse stop_stream_gather_response = 16;
|
|
491
|
-
|
|
492
|
-
// Message with payload for the stream gather
|
|
493
|
-
StreamGatherPayload stream_gather_payload = 17;
|
|
494
|
-
|
|
495
|
-
// Response to setting the session's audio filters
|
|
496
|
-
SetAudioFiltersResponse set_audio_filters_response = 19;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// VoiceOutStream is the output stream for the voice service
|
|
501
|
-
message VoiceOutStream {
|
|
502
|
-
oneof content {
|
|
503
|
-
// Request to accept the call
|
|
504
|
-
VerbRequest answer_request = 1;
|
|
505
|
-
|
|
506
|
-
// Request to play a sound
|
|
507
|
-
PlayRequest play_request = 2;
|
|
508
|
-
|
|
509
|
-
// Request to hangup the call
|
|
510
|
-
VerbRequest hangup_request = 3;
|
|
511
|
-
|
|
512
|
-
// Request to mute the call
|
|
513
|
-
MuteRequest mute_request = 4;
|
|
514
|
-
|
|
515
|
-
// Request to unmute the call
|
|
516
|
-
MuteRequest unmute_request = 5;
|
|
517
|
-
|
|
518
|
-
// Request to play dtmf
|
|
519
|
-
PlayDtmfRequest play_dtmf_request = 6;
|
|
520
|
-
|
|
521
|
-
// Request to gather speech or DTMF
|
|
522
|
-
GatherRequest gather_request = 7;
|
|
523
|
-
|
|
524
|
-
// Request to control a playback
|
|
525
|
-
PlaybackControlRequest playback_control_request = 9;
|
|
526
|
-
|
|
527
|
-
// Request to say a text
|
|
528
|
-
SayRequest say_request = 10;
|
|
529
|
-
|
|
530
|
-
// Request to stop any active Say speech
|
|
531
|
-
StopSayRequest stop_say_request = 19;
|
|
532
|
-
|
|
533
|
-
// Request to record
|
|
534
|
-
RecordRequest record_request = 11;
|
|
535
|
-
|
|
536
|
-
// Request to dial a number
|
|
537
|
-
DialRequest dial_request = 12;
|
|
538
|
-
|
|
539
|
-
// Request to start an audio stream
|
|
540
|
-
StartStreamRequest start_stream_request = 14;
|
|
541
|
-
|
|
542
|
-
// Request to stop an audio stream
|
|
543
|
-
StopStreamRequest stop_stream_request = 15;
|
|
544
|
-
|
|
545
|
-
// Message for the bidirectional streams
|
|
546
|
-
StreamPayload stream_payload = 16;
|
|
547
|
-
|
|
548
|
-
// Request to start a stream gather
|
|
549
|
-
StartStreamGatherRequest start_stream_gather_request = 17;
|
|
550
|
-
|
|
551
|
-
// Request to stop a stream gather
|
|
552
|
-
StopStreamGatherRequest stop_stream_gather_request = 18;
|
|
553
|
-
|
|
554
|
-
// Request to set the audio filters for the session
|
|
555
|
-
SetAudioFiltersRequest set_audio_filters_request = 20;
|
|
556
|
-
}
|
|
557
|
-
}
|
package/dist/voice/Dial.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DialStatus = exports.DialRecordDirection = void 0;
|
|
4
|
-
var DialRecordDirection;
|
|
5
|
-
(function (DialRecordDirection) {
|
|
6
|
-
DialRecordDirection["IN"] = "IN";
|
|
7
|
-
DialRecordDirection["OUT"] = "OUT";
|
|
8
|
-
DialRecordDirection["BOTH"] = "BOTH";
|
|
9
|
-
})(DialRecordDirection || (exports.DialRecordDirection = DialRecordDirection = {}));
|
|
10
|
-
var DialStatus;
|
|
11
|
-
(function (DialStatus) {
|
|
12
|
-
DialStatus["TRYING"] = "TRYING";
|
|
13
|
-
DialStatus["CANCEL"] = "CANCEL";
|
|
14
|
-
DialStatus["ANSWER"] = "ANSWER";
|
|
15
|
-
DialStatus["BUSY"] = "BUSY";
|
|
16
|
-
DialStatus["PROGRESS"] = "PROGRESS";
|
|
17
|
-
DialStatus["NOANSWER"] = "NOANSWER";
|
|
18
|
-
// Maps from Asterisk's CHANUNAVAIL and CONGESTION
|
|
19
|
-
DialStatus["FAILED"] = "FAILED";
|
|
20
|
-
})(DialStatus || (exports.DialStatus = DialStatus = {}));
|
package/dist/voice/Gather.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
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
|
-
import { VerbRequest, VerbResponse } from "./Verb";
|
|
20
|
-
declare enum GatherSource {
|
|
21
|
-
SPEECH = "speech",
|
|
22
|
-
DTMF = "dtmf",
|
|
23
|
-
SPEECH_AND_DTMF = "speech,dtmf"
|
|
24
|
-
}
|
|
25
|
-
type GatherOptions = {
|
|
26
|
-
finishOnKey?: string;
|
|
27
|
-
maxDigits?: number;
|
|
28
|
-
timeout?: number;
|
|
29
|
-
source?: GatherSource;
|
|
30
|
-
};
|
|
31
|
-
type GatherRequest = VerbRequest & GatherOptions;
|
|
32
|
-
type GatherResponse = VerbResponse & {
|
|
33
|
-
speech?: string;
|
|
34
|
-
digits?: string;
|
|
35
|
-
responseTime: number;
|
|
36
|
-
};
|
|
37
|
-
export { GatherOptions, GatherRequest, GatherResponse, GatherSource };
|
package/dist/voice/Gather.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GatherSource = void 0;
|
|
4
|
-
var GatherSource;
|
|
5
|
-
(function (GatherSource) {
|
|
6
|
-
GatherSource["SPEECH"] = "speech";
|
|
7
|
-
GatherSource["DTMF"] = "dtmf";
|
|
8
|
-
GatherSource["SPEECH_AND_DTMF"] = "speech,dtmf";
|
|
9
|
-
})(GatherSource || (exports.GatherSource = GatherSource = {}));
|
package/dist/voice/Mute.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
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
|
-
import { VerbRequest } from "./Verb";
|
|
20
|
-
type MuteOptions = {
|
|
21
|
-
direction?: MuteDirection;
|
|
22
|
-
};
|
|
23
|
-
declare enum MuteDirection {
|
|
24
|
-
IN = "IN",
|
|
25
|
-
OUT = "OUT",
|
|
26
|
-
BOTH = "BOTH"
|
|
27
|
-
}
|
|
28
|
-
type MuteRequest = VerbRequest & {
|
|
29
|
-
direction: MuteDirection;
|
|
30
|
-
};
|
|
31
|
-
export { MuteDirection, MuteOptions, MuteRequest };
|
package/dist/voice/Mute.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MuteDirection = void 0;
|
|
4
|
-
var MuteDirection;
|
|
5
|
-
(function (MuteDirection) {
|
|
6
|
-
MuteDirection["IN"] = "IN";
|
|
7
|
-
MuteDirection["OUT"] = "OUT";
|
|
8
|
-
MuteDirection["BOTH"] = "BOTH";
|
|
9
|
-
})(MuteDirection || (exports.MuteDirection = MuteDirection = {}));
|
package/dist/voice/Play.js
DELETED
package/dist/voice/PlayDtmf.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
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
|
-
import { VerbRequest } from "./Verb";
|
|
20
|
-
declare enum PlaybackControlAction {
|
|
21
|
-
STOP = "STOP",
|
|
22
|
-
RESTART = "RESTART",
|
|
23
|
-
PAUSE = "PAUSE",
|
|
24
|
-
UNPAUSE = "UNPAUSE",
|
|
25
|
-
FORWARD = "FORWARD"
|
|
26
|
-
}
|
|
27
|
-
type PlaybackControlRequest = VerbRequest & {
|
|
28
|
-
playbackRef: string;
|
|
29
|
-
action: PlaybackControlAction;
|
|
30
|
-
};
|
|
31
|
-
export { PlaybackControlAction, PlaybackControlRequest };
|