@wildix/wilma-voice-client 0.0.40 → 0.0.41

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.
@@ -27,7 +27,7 @@ declare const DescribeVoiceProtocolCommand_base: {
27
27
  getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
28
  };
29
29
  /**
30
- * Describes the WebSocket connect parameters, events and commands of the voice protocol. Utility method; the generated shapes are the source of truth for building a WebSocket client or server by hand.
30
+ * Describes the WebSocket connect parameters, events and commands of the voice protocol, and the messages of the PBX media socket. Utility method; the generated shapes are the source of truth for building a WebSocket client or server by hand.
31
31
  * @example
32
32
  * Use a bare-bones client and the command you need to make an API call.
33
33
  * ```javascript
@@ -302,6 +302,141 @@ declare const DescribeVoiceProtocolCommand_base: {
302
302
  * // reason: "hangup" || "transfer" || "timeout" || "error" || "complete", // required
303
303
  * // },
304
304
  * // },
305
+ * // media: { // MediaProtocolFrames
306
+ * // pbx: { // MediaPbxFrames
307
+ * // start: { // MediaStartFrame
308
+ * // type: "start", // required
309
+ * // purpose: "agent" || "transcription", // required
310
+ * // callId: "STRING_VALUE", // required
311
+ * // flowIndex: Number("int"), // required
312
+ * // sessionId: "STRING_VALUE", // required
313
+ * // resume: true || false, // required
314
+ * // resumeAtMs: Number("int"), // required
315
+ * // audio: { // MediaAudioFormat
316
+ * // encoding: "pcm_s16le", // required
317
+ * // sampleRate: Number("int"), // required
318
+ * // channels: Number("int"), // required
319
+ * // },
320
+ * // agent: { // MediaStartAgent
321
+ * // id: "STRING_VALUE", // required
322
+ * // draft: true || false,
323
+ * // version: Number("int"),
324
+ * // },
325
+ * // languages: [ // MediaStartLanguageList
326
+ * // "STRING_VALUE",
327
+ * // ],
328
+ * // preferredLanguage: "STRING_VALUE",
329
+ * // autoDetect: true || false,
330
+ * // caller: { // MediaStartCaller
331
+ * // name: "STRING_VALUE",
332
+ * // number: "STRING_VALUE",
333
+ * // email: "STRING_VALUE",
334
+ * // company: "STRING_VALUE",
335
+ * // },
336
+ * // dialedNumber: "STRING_VALUE",
337
+ * // variables: "STRING_VALUE",
338
+ * // },
339
+ * // audio: new Uint8Array(),
340
+ * // vad: { // MediaVadFrame
341
+ * // type: "vad", // required
342
+ * // party: "caller" || "callee", // required
343
+ * // speaking: true || false, // required
344
+ * // energyDb: Number("double"), // required
345
+ * // atMs: Number("int"), // required
346
+ * // },
347
+ * // dtmf: { // MediaDtmfFrame
348
+ * // type: "dtmf", // required
349
+ * // id: "STRING_VALUE", // required
350
+ * // digits: "STRING_VALUE", // required
351
+ * // },
352
+ * // playback: { // MediaPlaybackFrame
353
+ * // type: "playback", // required
354
+ * // replyId: "STRING_VALUE", // required
355
+ * // streamId: "STRING_VALUE", // required
356
+ * // event: "started" || "finished" || "stopped", // required
357
+ * // atMs: Number("int"), // required
358
+ * // playedMs: Number("int"),
359
+ * // cause: "cloud" || "caller" || "drop",
360
+ * // },
361
+ * // finish: { // MediaFinishFrame
362
+ * // type: "finish", // required
363
+ * // reason: "caller-hangup" || "callee-hangup" || "agent-hangup" || "agent-transfer" || "timeout", // required
364
+ * // },
365
+ * // },
366
+ * // cloud: { // MediaCloudFrames
367
+ * // started: { // MediaStartedFrame
368
+ * // type: "started", // required
369
+ * // streamId: "STRING_VALUE", // required
370
+ * // agent: { // MediaStartedAgent
371
+ * // name: "STRING_VALUE", // required
372
+ * // },
373
+ * // groupId: "STRING_VALUE",
374
+ * // backgroundSound: "STRING_VALUE",
375
+ * // voiceDetection: { // MediaVoiceDetection
376
+ * // silenceMs: Number("int"), // required
377
+ * // silenceLevelDb: Number("int"), // required
378
+ * // speechLevelDb: Number("int"), // required
379
+ * // },
380
+ * // },
381
+ * // transcription: { // MediaTranscriptionFrame
382
+ * // type: "transcription", // required
383
+ * // party: "caller" || "callee", // required
384
+ * // id: "STRING_VALUE", // required
385
+ * // final: true || false, // required
386
+ * // text: "STRING_VALUE", // required
387
+ * // startMs: Number("int"), // required
388
+ * // endMs: Number("int"), // required
389
+ * // language: "STRING_VALUE", // required
390
+ * // confidence: Number("double"),
391
+ * // },
392
+ * // audioBegin: { // MediaAudioBeginFrame
393
+ * // type: "audio.begin", // required
394
+ * // replyId: "STRING_VALUE", // required
395
+ * // streamId: "STRING_VALUE", // required
396
+ * // sampleRate: Number("int"), // required
397
+ * // },
398
+ * // audio: new Uint8Array(),
399
+ * // audioEnd: { // MediaAudioEndFrame
400
+ * // type: "audio.end", // required
401
+ * // streamId: "STRING_VALUE", // required
402
+ * // },
403
+ * // stop: { // MediaStopFrame
404
+ * // type: "stop", // required
405
+ * // },
406
+ * // duck: { // MediaDuckFrame
407
+ * // type: "duck", // required
408
+ * // replyId: "STRING_VALUE", // required
409
+ * // volumeDb: Number("int"), // required
410
+ * // rampMs: Number("int"), // required
411
+ * // },
412
+ * // restore: { // MediaRestoreFrame
413
+ * // type: "restore", // required
414
+ * // replyId: "STRING_VALUE", // required
415
+ * // rampMs: Number("int"), // required
416
+ * // },
417
+ * // language: { // MediaLanguageFrame
418
+ * // type: "language", // required
419
+ * // language: "STRING_VALUE", // required
420
+ * // },
421
+ * // transfer: { // MediaTransferFrame
422
+ * // type: "transfer", // required
423
+ * // context: "STRING_VALUE", // required
424
+ * // extension: "STRING_VALUE", // required
425
+ * // },
426
+ * // hangup: { // MediaHangupFrame
427
+ * // type: "hangup", // required
428
+ * // },
429
+ * // error: { // MediaErrorFrame
430
+ * // type: "error", // required
431
+ * // code: "STRING_VALUE", // required
432
+ * // retryable: true || false, // required
433
+ * // message: "STRING_VALUE", // required
434
+ * // },
435
+ * // finished: { // MediaFinishedFrame
436
+ * // type: "finished", // required
437
+ * // },
438
+ * // },
439
+ * // },
305
440
  * // };
306
441
  *
307
442
  * ```
@@ -0,0 +1,90 @@
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
3
+ import type { GetVoiceDefaultsInput, GetVoiceDefaultsOutput } from "../models/models_0";
4
+ import type { ServiceInputTypes, ServiceOutputTypes, WilmaVoiceClientResolvedConfig } from "../WilmaVoiceClient";
5
+ /**
6
+ * @public
7
+ */
8
+ export type { __MetadataBearer };
9
+ export { $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link GetVoiceDefaultsCommand}.
14
+ */
15
+ export interface GetVoiceDefaultsCommandInput extends GetVoiceDefaultsInput {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link GetVoiceDefaultsCommand}.
21
+ */
22
+ export interface GetVoiceDefaultsCommandOutput extends GetVoiceDefaultsOutput, __MetadataBearer {
23
+ }
24
+ declare const GetVoiceDefaultsCommand_base: {
25
+ new (input: GetVoiceDefaultsCommandInput): import("@smithy/core/client").CommandImpl<GetVoiceDefaultsCommandInput, GetVoiceDefaultsCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (...[input]: [] | [GetVoiceDefaultsCommandInput]): import("@smithy/core/client").CommandImpl<GetVoiceDefaultsCommandInput, GetVoiceDefaultsCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * Returns the voice channel tuning that applies to a call when the agent sets no value. The values can change without an agent change.
31
+ * @example
32
+ * Use a bare-bones client and the command you need to make an API call.
33
+ * ```javascript
34
+ * import { WilmaVoiceClient, GetVoiceDefaultsCommand } from "@wildix/wilma-voice-client"; // ES Modules import
35
+ * // const { WilmaVoiceClient, GetVoiceDefaultsCommand } = require("@wildix/wilma-voice-client"); // CommonJS import
36
+ * // import type { WilmaVoiceClientConfig } from "@wildix/wilma-voice-client";
37
+ * const config = {}; // type is WilmaVoiceClientConfig
38
+ * const client = new WilmaVoiceClient(config);
39
+ * const input = {};
40
+ * const command = new GetVoiceDefaultsCommand(input);
41
+ * const response = await client.send(command);
42
+ * // { // GetVoiceDefaultsOutput
43
+ * // voiceDetection: { // VoiceDetectionDefaults
44
+ * // silenceMs: Number("int"), // required
45
+ * // silenceLevelDb: Number("int"), // required
46
+ * // speechLevelDb: Number("int"), // required
47
+ * // },
48
+ * // interruptions: { // VoiceInterruptionDefaults
49
+ * // minWords: Number("int"), // required
50
+ * // minConfidence: Number("double"), // required
51
+ * // duckAfterMs: Number("int"), // required
52
+ * // duckVolumeDb: Number("int"), // required
53
+ * // restoreAfterMs: Number("int"), // required
54
+ * // },
55
+ * // turnEnd: { // VoiceTurnEndDefaults
56
+ * // holdMs: Number("int"), // required
57
+ * // },
58
+ * // };
59
+ *
60
+ * ```
61
+ *
62
+ * @param GetVoiceDefaultsCommandInput - {@link GetVoiceDefaultsCommandInput}
63
+ * @returns {@link GetVoiceDefaultsCommandOutput}
64
+ * @see {@link GetVoiceDefaultsCommandInput} for command's `input` shape.
65
+ * @see {@link GetVoiceDefaultsCommandOutput} for command's `response` shape.
66
+ * @see {@link WilmaVoiceClientResolvedConfig | config} for WilmaVoiceClient's `config` shape.
67
+ *
68
+ * @throws {@link ValidationException} (client fault)
69
+ *
70
+ * @throws {@link ForbiddenException} (client fault)
71
+ *
72
+ * @throws {@link WilmaVoiceServiceException}
73
+ * <p>Base exception class for all service exceptions from WilmaVoice service.</p>
74
+ *
75
+ *
76
+ * @public
77
+ */
78
+ export declare class GetVoiceDefaultsCommand extends GetVoiceDefaultsCommand_base {
79
+ /** @internal type navigation helper, not in runtime. */
80
+ protected static __types: {
81
+ api: {
82
+ input: {};
83
+ output: GetVoiceDefaultsOutput;
84
+ };
85
+ sdk: {
86
+ input: GetVoiceDefaultsCommandInput;
87
+ output: GetVoiceDefaultsCommandOutput;
88
+ };
89
+ };
90
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./DescribeVoiceProtocolCommand";
2
+ export * from "./GetVoiceDefaultsCommand";
2
3
  export * from "./ListVoicesCommand";
3
4
  export * from "./SendHangupCommand";
4
5
  export * from "./SendPlayCommand";
@@ -8,11 +8,13 @@
8
8
  * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), PBX clients transcribe caller
9
9
  * speech themselves and send `transcription` / `reply` text, while web/app clients connect with
10
10
  * inputMode=AUDIO and push raw caller `audio` chunks that the service transcribes server-side;
11
- * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. Every WebSocket message
12
- * shape (connect params, events and commands) is declared as a structure and enumerated by
13
- * DescribeVoiceProtocol so the generated SDKs carry the types and (de)serializers; the WebSocket
14
- * transport itself is hand-coded. The HTTP Send* operations push the same commands into a live
15
- * session out-of-band.
11
+ * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. On the PBX media socket
12
+ * (`/v2/voice/media/ws`, subprotocol `wilma-media-v2`), the PBX sends raw caller audio and the
13
+ * service answers with audio and the text frames listed under DescribeVoiceProtocol `media`.
14
+ * Every WebSocket message shape (connect params, events and commands) is declared as a structure
15
+ * and enumerated by DescribeVoiceProtocol so the generated SDKs carry the types and
16
+ * (de)serializers; the WebSocket transport itself is hand-coded. The HTTP Send* operations push
17
+ * the same commands into a live session out-of-band.
16
18
  *
17
19
  * Session observability and history are recorded in wilma-traces; this service does not expose
18
20
  * bot configuration, traces or listing.
@@ -145,3 +145,305 @@ export declare const VoiceCommandType: {
145
145
  * @public
146
146
  */
147
147
  export type VoiceCommandType = (typeof VoiceCommandType)[keyof typeof VoiceCommandType];
148
+ /**
149
+ * @public
150
+ * @enum
151
+ */
152
+ export declare const MediaAudioBeginFrameType: {
153
+ readonly AUDIO_BEGIN: "audio.begin";
154
+ };
155
+ /**
156
+ * @public
157
+ */
158
+ export type MediaAudioBeginFrameType = (typeof MediaAudioBeginFrameType)[keyof typeof MediaAudioBeginFrameType];
159
+ /**
160
+ * @public
161
+ * @enum
162
+ */
163
+ export declare const MediaAudioEndFrameType: {
164
+ readonly AUDIO_END: "audio.end";
165
+ };
166
+ /**
167
+ * @public
168
+ */
169
+ export type MediaAudioEndFrameType = (typeof MediaAudioEndFrameType)[keyof typeof MediaAudioEndFrameType];
170
+ /**
171
+ * @public
172
+ * @enum
173
+ */
174
+ export declare const MediaDuckFrameType: {
175
+ readonly DUCK: "duck";
176
+ };
177
+ /**
178
+ * @public
179
+ */
180
+ export type MediaDuckFrameType = (typeof MediaDuckFrameType)[keyof typeof MediaDuckFrameType];
181
+ /**
182
+ * @public
183
+ * @enum
184
+ */
185
+ export declare const MediaErrorFrameType: {
186
+ readonly ERROR: "error";
187
+ };
188
+ /**
189
+ * @public
190
+ */
191
+ export type MediaErrorFrameType = (typeof MediaErrorFrameType)[keyof typeof MediaErrorFrameType];
192
+ /**
193
+ * @public
194
+ * @enum
195
+ */
196
+ export declare const MediaFinishedFrameType: {
197
+ readonly FINISHED: "finished";
198
+ };
199
+ /**
200
+ * @public
201
+ */
202
+ export type MediaFinishedFrameType = (typeof MediaFinishedFrameType)[keyof typeof MediaFinishedFrameType];
203
+ /**
204
+ * @public
205
+ * @enum
206
+ */
207
+ export declare const MediaHangupFrameType: {
208
+ readonly HANGUP: "hangup";
209
+ };
210
+ /**
211
+ * @public
212
+ */
213
+ export type MediaHangupFrameType = (typeof MediaHangupFrameType)[keyof typeof MediaHangupFrameType];
214
+ /**
215
+ * @public
216
+ * @enum
217
+ */
218
+ export declare const MediaLanguageFrameType: {
219
+ readonly LANGUAGE: "language";
220
+ };
221
+ /**
222
+ * @public
223
+ */
224
+ export type MediaLanguageFrameType = (typeof MediaLanguageFrameType)[keyof typeof MediaLanguageFrameType];
225
+ /**
226
+ * @public
227
+ * @enum
228
+ */
229
+ export declare const MediaRestoreFrameType: {
230
+ readonly RESTORE: "restore";
231
+ };
232
+ /**
233
+ * @public
234
+ */
235
+ export type MediaRestoreFrameType = (typeof MediaRestoreFrameType)[keyof typeof MediaRestoreFrameType];
236
+ /**
237
+ * @public
238
+ * @enum
239
+ */
240
+ export declare const MediaStartedFrameType: {
241
+ readonly STARTED: "started";
242
+ };
243
+ /**
244
+ * @public
245
+ */
246
+ export type MediaStartedFrameType = (typeof MediaStartedFrameType)[keyof typeof MediaStartedFrameType];
247
+ /**
248
+ * @public
249
+ * @enum
250
+ */
251
+ export declare const MediaStopFrameType: {
252
+ readonly STOP: "stop";
253
+ };
254
+ /**
255
+ * @public
256
+ */
257
+ export type MediaStopFrameType = (typeof MediaStopFrameType)[keyof typeof MediaStopFrameType];
258
+ /**
259
+ * @public
260
+ * @enum
261
+ */
262
+ export declare const MediaParty: {
263
+ readonly CALLEE: "callee";
264
+ readonly CALLER: "caller";
265
+ };
266
+ /**
267
+ * @public
268
+ */
269
+ export type MediaParty = (typeof MediaParty)[keyof typeof MediaParty];
270
+ /**
271
+ * @public
272
+ * @enum
273
+ */
274
+ export declare const MediaTranscriptionFrameType: {
275
+ readonly TRANSCRIPTION: "transcription";
276
+ };
277
+ /**
278
+ * @public
279
+ */
280
+ export type MediaTranscriptionFrameType = (typeof MediaTranscriptionFrameType)[keyof typeof MediaTranscriptionFrameType];
281
+ /**
282
+ * @public
283
+ * @enum
284
+ */
285
+ export declare const MediaTransferFrameType: {
286
+ readonly TRANSFER: "transfer";
287
+ };
288
+ /**
289
+ * @public
290
+ */
291
+ export type MediaTransferFrameType = (typeof MediaTransferFrameType)[keyof typeof MediaTransferFrameType];
292
+ /**
293
+ * @public
294
+ * @enum
295
+ */
296
+ export declare const MediaDtmfFrameType: {
297
+ readonly DTMF: "dtmf";
298
+ };
299
+ /**
300
+ * @public
301
+ */
302
+ export type MediaDtmfFrameType = (typeof MediaDtmfFrameType)[keyof typeof MediaDtmfFrameType];
303
+ /**
304
+ * @public
305
+ * @enum
306
+ */
307
+ export declare const MediaFinishReason: {
308
+ /**
309
+ * The PBX ran the agent's `hangup`.
310
+ */
311
+ readonly AGENT_HANGUP: "agent-hangup";
312
+ /**
313
+ * The PBX ran the agent's `transfer`, or tried to and the target does not exist.
314
+ */
315
+ readonly AGENT_TRANSFER: "agent-transfer";
316
+ /**
317
+ * The callee hung up.
318
+ */
319
+ readonly CALLEE_HANGUP: "callee-hangup";
320
+ /**
321
+ * The caller hung up.
322
+ */
323
+ readonly CALLER_HANGUP: "caller-hangup";
324
+ /**
325
+ * The PBX got no agent reply in time.
326
+ */
327
+ readonly TIMEOUT: "timeout";
328
+ };
329
+ /**
330
+ * @public
331
+ */
332
+ export type MediaFinishReason = (typeof MediaFinishReason)[keyof typeof MediaFinishReason];
333
+ /**
334
+ * @public
335
+ * @enum
336
+ */
337
+ export declare const MediaFinishFrameType: {
338
+ readonly FINISH: "finish";
339
+ };
340
+ /**
341
+ * @public
342
+ */
343
+ export type MediaFinishFrameType = (typeof MediaFinishFrameType)[keyof typeof MediaFinishFrameType];
344
+ /**
345
+ * @public
346
+ * @enum
347
+ */
348
+ export declare const MediaPlaybackStopCause: {
349
+ /**
350
+ * The caller hung up or the run ended.
351
+ */
352
+ readonly CALLER: "caller";
353
+ /**
354
+ * A `stop` frame from the cloud.
355
+ */
356
+ readonly CLOUD: "cloud";
357
+ /**
358
+ * The PBX dropped the stream, for example at its queue limit.
359
+ */
360
+ readonly DROP: "drop";
361
+ };
362
+ /**
363
+ * @public
364
+ */
365
+ export type MediaPlaybackStopCause = (typeof MediaPlaybackStopCause)[keyof typeof MediaPlaybackStopCause];
366
+ /**
367
+ * @public
368
+ * @enum
369
+ */
370
+ export declare const MediaPlaybackEvent: {
371
+ /**
372
+ * The stream played to its end.
373
+ */
374
+ readonly FINISHED: "finished";
375
+ /**
376
+ * The stream started to play.
377
+ */
378
+ readonly STARTED: "started";
379
+ /**
380
+ * The stream stopped before its end.
381
+ */
382
+ readonly STOPPED: "stopped";
383
+ };
384
+ /**
385
+ * @public
386
+ */
387
+ export type MediaPlaybackEvent = (typeof MediaPlaybackEvent)[keyof typeof MediaPlaybackEvent];
388
+ /**
389
+ * @public
390
+ * @enum
391
+ */
392
+ export declare const MediaPlaybackFrameType: {
393
+ readonly PLAYBACK: "playback";
394
+ };
395
+ /**
396
+ * @public
397
+ */
398
+ export type MediaPlaybackFrameType = (typeof MediaPlaybackFrameType)[keyof typeof MediaPlaybackFrameType];
399
+ /**
400
+ * @public
401
+ * @enum
402
+ */
403
+ export declare const MediaAudioEncoding: {
404
+ readonly PCM_S16LE: "pcm_s16le";
405
+ };
406
+ /**
407
+ * @public
408
+ */
409
+ export type MediaAudioEncoding = (typeof MediaAudioEncoding)[keyof typeof MediaAudioEncoding];
410
+ /**
411
+ * @public
412
+ * @enum
413
+ */
414
+ export declare const MediaRunPurpose: {
415
+ /**
416
+ * A voice agent answers the call.
417
+ */
418
+ readonly AGENT: "agent";
419
+ /**
420
+ * The cloud transcribes the call and sends no audio.
421
+ */
422
+ readonly TRANSCRIPTION: "transcription";
423
+ };
424
+ /**
425
+ * @public
426
+ */
427
+ export type MediaRunPurpose = (typeof MediaRunPurpose)[keyof typeof MediaRunPurpose];
428
+ /**
429
+ * @public
430
+ * @enum
431
+ */
432
+ export declare const MediaStartFrameType: {
433
+ readonly START: "start";
434
+ };
435
+ /**
436
+ * @public
437
+ */
438
+ export type MediaStartFrameType = (typeof MediaStartFrameType)[keyof typeof MediaStartFrameType];
439
+ /**
440
+ * @public
441
+ * @enum
442
+ */
443
+ export declare const MediaVadFrameType: {
444
+ readonly VAD: "vad";
445
+ };
446
+ /**
447
+ * @public
448
+ */
449
+ export type MediaVadFrameType = (typeof MediaVadFrameType)[keyof typeof MediaVadFrameType];