@wildix/wilma-voice-client 0.0.52 → 0.0.53
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-cjs/models/enums.js +14 -14
- package/dist-cjs/schemas/schemas_0.js +73 -48
- package/dist-es/models/enums.js +13 -13
- package/dist-es/schemas/schemas_0.js +71 -46
- package/dist-types/commands/DescribeVoiceProtocolCommand.d.ts +254 -241
- package/dist-types/models/enums.d.ts +21 -21
- package/dist-types/models/models_0.d.ts +287 -216
- package/dist-types/schemas/schemas_0.d.ts +12 -6
- package/package.json +1 -1
|
@@ -111,7 +111,7 @@ export interface VoiceCompleteEvent {
|
|
|
111
111
|
* End the session and hang up the call.
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
|
-
export interface
|
|
114
|
+
export interface VoiceHangupCommand {
|
|
115
115
|
/**
|
|
116
116
|
* Why the session ended.
|
|
117
117
|
* @public
|
|
@@ -124,10 +124,10 @@ export interface VoiceHangupCommandData {
|
|
|
124
124
|
type: VoiceCommandType;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Liveness check of the service by the client: `\{"type": "healthcheck"\}`, with no envelope. The service sends no answer.
|
|
128
128
|
* @public
|
|
129
129
|
*/
|
|
130
|
-
export interface
|
|
130
|
+
export interface VoiceHealthcheckCommand {
|
|
131
131
|
type: string;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
@@ -340,7 +340,7 @@ export interface VoiceErrorEvent {
|
|
|
340
340
|
* A chunk of synthesized audio of a reply. `data` is base64 of PCM audio at the sample rate of the `say` command. An empty `data` marks the end of the stream.
|
|
341
341
|
* @public
|
|
342
342
|
*/
|
|
343
|
-
export interface
|
|
343
|
+
export interface VoicePlayCommand {
|
|
344
344
|
replyId: string;
|
|
345
345
|
streamId: string;
|
|
346
346
|
data: string;
|
|
@@ -366,7 +366,7 @@ export interface VoiceSayCommandAudioOptions {
|
|
|
366
366
|
* Play a reply to the caller. When `audio` is present, the service sends the audio of the reply in `play` commands. When `audio` is absent, the client shows `text` or synthesizes it itself.
|
|
367
367
|
* @public
|
|
368
368
|
*/
|
|
369
|
-
export interface
|
|
369
|
+
export interface VoiceSayCommand {
|
|
370
370
|
/**
|
|
371
371
|
* Text of the reply.
|
|
372
372
|
* @public
|
|
@@ -484,7 +484,7 @@ export interface VoiceSessionStartedEvent {
|
|
|
484
484
|
* Stop the audio of the agent.
|
|
485
485
|
* @public
|
|
486
486
|
*/
|
|
487
|
-
export interface
|
|
487
|
+
export interface VoiceStopCommand {
|
|
488
488
|
/**
|
|
489
489
|
* Value of `type` in the `command` of a command frame.
|
|
490
490
|
* @public
|
|
@@ -495,7 +495,7 @@ export interface VoiceStopCommandData {
|
|
|
495
495
|
* Transfer the call to a PBX destination and end the session. Only a PBX client does the transfer.
|
|
496
496
|
* @public
|
|
497
497
|
*/
|
|
498
|
-
export interface
|
|
498
|
+
export interface VoiceTransferCommand {
|
|
499
499
|
/**
|
|
500
500
|
* Dialplan context of the destination.
|
|
501
501
|
* @public
|
|
@@ -907,36 +907,6 @@ export declare namespace VoiceCallEvent {
|
|
|
907
907
|
_: (name: string, value: any) => T;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
/**
|
|
911
|
-
* Opens an agent audio stream. Binary audio messages of the stream follow until `audio.end`. Streams do not interleave.
|
|
912
|
-
* @public
|
|
913
|
-
*/
|
|
914
|
-
export interface VoiceCallAudioBeginFrame {
|
|
915
|
-
/**
|
|
916
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
917
|
-
* @public
|
|
918
|
-
*/
|
|
919
|
-
type: VoiceCallServerFrameType;
|
|
920
|
-
replyId: string;
|
|
921
|
-
streamId: string;
|
|
922
|
-
/**
|
|
923
|
-
* Sample rate of the stream's `pcm_s16le` mono audio in Hz: 8000, 12000, 16000, 24000, 32000, 44100 or 48000.
|
|
924
|
-
* @public
|
|
925
|
-
*/
|
|
926
|
-
sampleRate: number;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Closes an agent audio stream.
|
|
930
|
-
* @public
|
|
931
|
-
*/
|
|
932
|
-
export interface VoiceCallAudioEndFrame {
|
|
933
|
-
/**
|
|
934
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
935
|
-
* @public
|
|
936
|
-
*/
|
|
937
|
-
type: VoiceCallServerFrameType;
|
|
938
|
-
streamId: string;
|
|
939
|
-
}
|
|
940
910
|
/**
|
|
941
911
|
* DTMF input that the PBX collected. The cloud takes `digits` as the caller's reply.
|
|
942
912
|
* @public
|
|
@@ -950,28 +920,6 @@ export interface VoiceCallDtmfFrame {
|
|
|
950
920
|
id: string;
|
|
951
921
|
digits: string;
|
|
952
922
|
}
|
|
953
|
-
/**
|
|
954
|
-
* Change the volume of a playing reply. `volumeDb` 0 returns it to full volume.
|
|
955
|
-
* @public
|
|
956
|
-
*/
|
|
957
|
-
export interface VoiceCallDuckFrame {
|
|
958
|
-
/**
|
|
959
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
960
|
-
* @public
|
|
961
|
-
*/
|
|
962
|
-
type: VoiceCallServerFrameType;
|
|
963
|
-
replyId: string;
|
|
964
|
-
/**
|
|
965
|
-
* Target gain in dB.
|
|
966
|
-
* @public
|
|
967
|
-
*/
|
|
968
|
-
volumeDb: number;
|
|
969
|
-
/**
|
|
970
|
-
* Ramp duration in ms.
|
|
971
|
-
* @public
|
|
972
|
-
*/
|
|
973
|
-
rampMs: number;
|
|
974
|
-
}
|
|
975
923
|
/**
|
|
976
924
|
* The run ended on the PBX. The PBX sends no audio after it and waits up to 3 s for `ended`.
|
|
977
925
|
* @public
|
|
@@ -988,62 +936,6 @@ export interface VoiceCallEndFrame {
|
|
|
988
936
|
*/
|
|
989
937
|
reason: VoiceCallClientEndReason;
|
|
990
938
|
}
|
|
991
|
-
/**
|
|
992
|
-
* Answer to `end`: the cloud processed all audio. The socket closes with close code 1000 after it.
|
|
993
|
-
* @public
|
|
994
|
-
*/
|
|
995
|
-
export interface VoiceCallEndedFrame {
|
|
996
|
-
/**
|
|
997
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
998
|
-
* @public
|
|
999
|
-
*/
|
|
1000
|
-
type: VoiceCallServerFrameType;
|
|
1001
|
-
}
|
|
1002
|
-
/**
|
|
1003
|
-
* An error on the run. When `retryable` is false, the socket closes after it.
|
|
1004
|
-
* @public
|
|
1005
|
-
*/
|
|
1006
|
-
export interface VoiceCallErrorFrame {
|
|
1007
|
-
/**
|
|
1008
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
1009
|
-
* @public
|
|
1010
|
-
*/
|
|
1011
|
-
type: VoiceCallServerFrameType;
|
|
1012
|
-
/**
|
|
1013
|
-
* Stable error code, for example `START_TIMEOUT`, `PROTOCOL_ERROR` or `STT_FAILED`.
|
|
1014
|
-
* @public
|
|
1015
|
-
*/
|
|
1016
|
-
code: string;
|
|
1017
|
-
retryable: boolean;
|
|
1018
|
-
message: string;
|
|
1019
|
-
}
|
|
1020
|
-
/**
|
|
1021
|
-
* Hang up the call after the queued agent audio plays. Terminal: the PBX answers with `end`.
|
|
1022
|
-
* @public
|
|
1023
|
-
*/
|
|
1024
|
-
export interface VoiceCallHangupFrame {
|
|
1025
|
-
/**
|
|
1026
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
1027
|
-
* @public
|
|
1028
|
-
*/
|
|
1029
|
-
type: VoiceCallServerFrameType;
|
|
1030
|
-
}
|
|
1031
|
-
/**
|
|
1032
|
-
* The call continues in another language.
|
|
1033
|
-
* @public
|
|
1034
|
-
*/
|
|
1035
|
-
export interface VoiceCallLanguageFrame {
|
|
1036
|
-
/**
|
|
1037
|
-
* Value of `type` in a text frame from the server (the cloud).
|
|
1038
|
-
* @public
|
|
1039
|
-
*/
|
|
1040
|
-
type: VoiceCallServerFrameType;
|
|
1041
|
-
/**
|
|
1042
|
-
* Language that the call continues in.
|
|
1043
|
-
* @public
|
|
1044
|
-
*/
|
|
1045
|
-
language: string;
|
|
1046
|
-
}
|
|
1047
939
|
/**
|
|
1048
940
|
* An agent audio stream changed state on the PBX.
|
|
1049
941
|
* @public
|
|
@@ -1170,30 +1062,211 @@ export interface VoiceCallStartFrame {
|
|
|
1170
1062
|
variables?: string | undefined;
|
|
1171
1063
|
}
|
|
1172
1064
|
/**
|
|
1173
|
-
*
|
|
1065
|
+
* Voice activity of the caller as the PBX detects it. Sent when the state changes, and every 100 ms while agent audio plays.
|
|
1174
1066
|
* @public
|
|
1175
1067
|
*/
|
|
1176
|
-
export interface
|
|
1068
|
+
export interface VoiceCallVadFrame {
|
|
1069
|
+
/**
|
|
1070
|
+
* Value of `type` in a text frame from the client (the PBX).
|
|
1071
|
+
* @public
|
|
1072
|
+
*/
|
|
1073
|
+
type: VoiceCallClientFrameType;
|
|
1074
|
+
/**
|
|
1075
|
+
* True while the caller speaks.
|
|
1076
|
+
* @public
|
|
1077
|
+
*/
|
|
1078
|
+
speaking: boolean;
|
|
1079
|
+
/**
|
|
1080
|
+
* Energy of the audio frame that produced the report, in dBFS.
|
|
1081
|
+
* @public
|
|
1082
|
+
*/
|
|
1083
|
+
energyDb: number;
|
|
1084
|
+
/**
|
|
1085
|
+
* Run-clock time or duration in ms of PBX audio since the run started. It continues across reconnects.
|
|
1086
|
+
* @public
|
|
1087
|
+
*/
|
|
1088
|
+
atMs: number;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* One example of each text message that the client (the PBX) sends on the call socket.
|
|
1092
|
+
* @public
|
|
1093
|
+
*/
|
|
1094
|
+
export interface VoiceCallClientFrames {
|
|
1095
|
+
/**
|
|
1096
|
+
* First text frame of a socket, sent within 10 s of the upgrade. Opens a run, or attaches a reconnect to it.
|
|
1097
|
+
* @public
|
|
1098
|
+
*/
|
|
1099
|
+
start?: VoiceCallStartFrame | undefined;
|
|
1100
|
+
/**
|
|
1101
|
+
* Voice activity of the caller as the PBX detects it. Sent when the state changes, and every 100 ms while agent audio plays.
|
|
1102
|
+
* @public
|
|
1103
|
+
*/
|
|
1104
|
+
vad?: VoiceCallVadFrame | undefined;
|
|
1105
|
+
/**
|
|
1106
|
+
* DTMF input that the PBX collected. The cloud takes `digits` as the caller's reply.
|
|
1107
|
+
* @public
|
|
1108
|
+
*/
|
|
1109
|
+
dtmf?: VoiceCallDtmfFrame | undefined;
|
|
1110
|
+
/**
|
|
1111
|
+
* An agent audio stream changed state on the PBX.
|
|
1112
|
+
* @public
|
|
1113
|
+
*/
|
|
1114
|
+
playback?: VoiceCallPlaybackFrame | undefined;
|
|
1115
|
+
/**
|
|
1116
|
+
* The run ended on the PBX. The PBX sends no audio after it and waits up to 3 s for `ended`.
|
|
1117
|
+
* @public
|
|
1118
|
+
*/
|
|
1119
|
+
end?: VoiceCallEndFrame | undefined;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Opens an agent audio stream. Binary audio messages of the stream follow until `audio.end`. Streams do not interleave.
|
|
1123
|
+
* @public
|
|
1124
|
+
*/
|
|
1125
|
+
export interface VoiceCallAudioBeginFrame {
|
|
1177
1126
|
/**
|
|
1178
1127
|
* Value of `type` in a text frame from the server (the cloud).
|
|
1179
1128
|
* @public
|
|
1180
1129
|
*/
|
|
1181
1130
|
type: VoiceCallServerFrameType;
|
|
1131
|
+
replyId: string;
|
|
1132
|
+
streamId: string;
|
|
1182
1133
|
/**
|
|
1183
|
-
*
|
|
1134
|
+
* Sample rate of the stream's `pcm_s16le` mono audio in Hz: 8000, 12000, 16000, 24000, 32000, 44100 or 48000.
|
|
1184
1135
|
* @public
|
|
1185
1136
|
*/
|
|
1186
|
-
|
|
1137
|
+
sampleRate: number;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Closes an agent audio stream.
|
|
1141
|
+
* @public
|
|
1142
|
+
*/
|
|
1143
|
+
export interface VoiceCallAudioEndFrame {
|
|
1144
|
+
/**
|
|
1145
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1146
|
+
* @public
|
|
1147
|
+
*/
|
|
1148
|
+
type: VoiceCallServerFrameType;
|
|
1149
|
+
streamId: string;
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Change the volume of a playing reply. `volumeDb` 0 returns it to full volume.
|
|
1153
|
+
* @public
|
|
1154
|
+
*/
|
|
1155
|
+
export interface VoiceCallDuckFrame {
|
|
1156
|
+
/**
|
|
1157
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1158
|
+
* @public
|
|
1159
|
+
*/
|
|
1160
|
+
type: VoiceCallServerFrameType;
|
|
1161
|
+
replyId: string;
|
|
1162
|
+
/**
|
|
1163
|
+
* Target gain in dB.
|
|
1164
|
+
* @public
|
|
1165
|
+
*/
|
|
1166
|
+
volumeDb: number;
|
|
1167
|
+
/**
|
|
1168
|
+
* Ramp duration in ms.
|
|
1169
|
+
* @public
|
|
1170
|
+
*/
|
|
1171
|
+
rampMs: number;
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Answer to `end`: the cloud processed all audio. The socket closes with close code 1000 after it.
|
|
1175
|
+
* @public
|
|
1176
|
+
*/
|
|
1177
|
+
export interface VoiceCallEndedFrame {
|
|
1178
|
+
/**
|
|
1179
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1180
|
+
* @public
|
|
1181
|
+
*/
|
|
1182
|
+
type: VoiceCallServerFrameType;
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* An error on the run. When `retryable` is false, the socket closes after it.
|
|
1186
|
+
* @public
|
|
1187
|
+
*/
|
|
1188
|
+
export interface VoiceCallErrorFrame {
|
|
1189
|
+
/**
|
|
1190
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1191
|
+
* @public
|
|
1192
|
+
*/
|
|
1193
|
+
type: VoiceCallServerFrameType;
|
|
1194
|
+
/**
|
|
1195
|
+
* Stable error code, for example `START_TIMEOUT`, `PROTOCOL_ERROR` or `STT_FAILED`.
|
|
1196
|
+
* @public
|
|
1197
|
+
*/
|
|
1198
|
+
code: string;
|
|
1199
|
+
retryable: boolean;
|
|
1200
|
+
message: string;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Hang up the call after the queued agent audio plays. Terminal: the PBX answers with `end`.
|
|
1204
|
+
* @public
|
|
1205
|
+
*/
|
|
1206
|
+
export interface VoiceCallHangupFrame {
|
|
1207
|
+
/**
|
|
1208
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1209
|
+
* @public
|
|
1210
|
+
*/
|
|
1211
|
+
type: VoiceCallServerFrameType;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* The call continues in another language.
|
|
1215
|
+
* @public
|
|
1216
|
+
*/
|
|
1217
|
+
export interface VoiceCallLanguageFrame {
|
|
1218
|
+
/**
|
|
1219
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1220
|
+
* @public
|
|
1221
|
+
*/
|
|
1222
|
+
type: VoiceCallServerFrameType;
|
|
1223
|
+
/**
|
|
1224
|
+
* Language that the call continues in.
|
|
1225
|
+
* @public
|
|
1226
|
+
*/
|
|
1227
|
+
language: string;
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* The agent that answers the run.
|
|
1231
|
+
* @public
|
|
1232
|
+
*/
|
|
1233
|
+
export interface VoiceCallStartedAgent {
|
|
1234
|
+
/**
|
|
1235
|
+
* Agent id, as in `start.agent.id`.
|
|
1236
|
+
* @public
|
|
1237
|
+
*/
|
|
1238
|
+
id: string;
|
|
1187
1239
|
/**
|
|
1188
1240
|
* Display name of the agent.
|
|
1189
1241
|
* @public
|
|
1190
1242
|
*/
|
|
1191
|
-
|
|
1243
|
+
name: string;
|
|
1192
1244
|
/**
|
|
1193
1245
|
* Group of the agent. Absent when the agent has none.
|
|
1194
1246
|
* @public
|
|
1195
1247
|
*/
|
|
1196
1248
|
groupId?: string | undefined;
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Answer to `start`: the session of the run is ready on this connection. Sent once per connection, also after a reconnect. Example: `\{"type":"started","connectionId":"0f6d…","agent":\{"id":"a_qqyHI7xWBH","name":"Support"\}\}`.
|
|
1252
|
+
* @public
|
|
1253
|
+
*/
|
|
1254
|
+
export interface VoiceCallStartedFrame {
|
|
1255
|
+
/**
|
|
1256
|
+
* Value of `type` in a text frame from the server (the cloud).
|
|
1257
|
+
* @public
|
|
1258
|
+
*/
|
|
1259
|
+
type: VoiceCallServerFrameType;
|
|
1260
|
+
/**
|
|
1261
|
+
* Id of this connection. Each connection of the run has its own.
|
|
1262
|
+
* @public
|
|
1263
|
+
*/
|
|
1264
|
+
connectionId: string;
|
|
1265
|
+
/**
|
|
1266
|
+
* The agent that answers the run.
|
|
1267
|
+
* @public
|
|
1268
|
+
*/
|
|
1269
|
+
agent: VoiceCallStartedAgent;
|
|
1197
1270
|
/**
|
|
1198
1271
|
* Music-on-hold class that the PBX plays after each caller turn until agent audio starts. Absent: none.
|
|
1199
1272
|
* @public
|
|
@@ -1280,116 +1353,122 @@ export interface VoiceCallTransferFrame {
|
|
|
1280
1353
|
type: VoiceCallServerFrameType;
|
|
1281
1354
|
}
|
|
1282
1355
|
/**
|
|
1283
|
-
*
|
|
1356
|
+
* One example of each text message that the server (the cloud) sends on the call socket.
|
|
1284
1357
|
* @public
|
|
1285
1358
|
*/
|
|
1286
|
-
export interface
|
|
1359
|
+
export interface VoiceCallServerFrames {
|
|
1287
1360
|
/**
|
|
1288
|
-
*
|
|
1361
|
+
* Answer to `start`: the session of the run is ready on this connection. Sent once per connection, also after a reconnect. Example: `\{"type":"started","connectionId":"0f6d…","agent":\{"id":"a_qqyHI7xWBH","name":"Support"\}\}`.
|
|
1289
1362
|
* @public
|
|
1290
1363
|
*/
|
|
1291
|
-
|
|
1364
|
+
started?: VoiceCallStartedFrame | undefined;
|
|
1292
1365
|
/**
|
|
1293
|
-
*
|
|
1366
|
+
* Words of one party. Partials and the final of one utterance share `id`. For the agent, the words that played.
|
|
1294
1367
|
* @public
|
|
1295
1368
|
*/
|
|
1296
|
-
|
|
1369
|
+
transcription?: VoiceCallTranscriptionFrame | undefined;
|
|
1297
1370
|
/**
|
|
1298
|
-
*
|
|
1371
|
+
* Opens an agent audio stream. Binary audio messages of the stream follow until `audio.end`. Streams do not interleave.
|
|
1299
1372
|
* @public
|
|
1300
1373
|
*/
|
|
1301
|
-
|
|
1374
|
+
audioBegin?: VoiceCallAudioBeginFrame | undefined;
|
|
1302
1375
|
/**
|
|
1303
|
-
*
|
|
1376
|
+
* Closes an agent audio stream.
|
|
1304
1377
|
* @public
|
|
1305
1378
|
*/
|
|
1306
|
-
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* One example of each text message of the call socket.
|
|
1310
|
-
* @public
|
|
1311
|
-
*/
|
|
1312
|
-
export interface VoiceCallProtocolFrames {
|
|
1379
|
+
audioEnd?: VoiceCallAudioEndFrame | undefined;
|
|
1313
1380
|
/**
|
|
1314
|
-
*
|
|
1381
|
+
* Stop every agent audio stream of the run: the one that plays and the ones that wait.
|
|
1315
1382
|
* @public
|
|
1316
1383
|
*/
|
|
1317
|
-
|
|
1384
|
+
stop?: VoiceCallStopFrame | undefined;
|
|
1318
1385
|
/**
|
|
1319
|
-
*
|
|
1386
|
+
* Change the volume of a playing reply. `volumeDb` 0 returns it to full volume.
|
|
1320
1387
|
* @public
|
|
1321
1388
|
*/
|
|
1322
|
-
|
|
1389
|
+
duck?: VoiceCallDuckFrame | undefined;
|
|
1323
1390
|
/**
|
|
1324
|
-
*
|
|
1391
|
+
* The call continues in another language.
|
|
1325
1392
|
* @public
|
|
1326
1393
|
*/
|
|
1327
|
-
|
|
1394
|
+
language?: VoiceCallLanguageFrame | undefined;
|
|
1328
1395
|
/**
|
|
1329
|
-
*
|
|
1396
|
+
* Transfer the call after the queued agent audio plays. Terminal: the PBX answers with `end`.
|
|
1330
1397
|
* @public
|
|
1331
1398
|
*/
|
|
1332
|
-
|
|
1399
|
+
transfer?: VoiceCallTransferFrame | undefined;
|
|
1333
1400
|
/**
|
|
1334
|
-
*
|
|
1401
|
+
* Hang up the call after the queued agent audio plays. Terminal: the PBX answers with `end`.
|
|
1335
1402
|
* @public
|
|
1336
1403
|
*/
|
|
1337
|
-
|
|
1404
|
+
hangup?: VoiceCallHangupFrame | undefined;
|
|
1338
1405
|
/**
|
|
1339
|
-
*
|
|
1406
|
+
* An error on the run. When `retryable` is false, the socket closes after it.
|
|
1340
1407
|
* @public
|
|
1341
1408
|
*/
|
|
1342
|
-
|
|
1409
|
+
error?: VoiceCallErrorFrame | undefined;
|
|
1343
1410
|
/**
|
|
1344
|
-
*
|
|
1411
|
+
* Answer to `end`: the cloud processed all audio. The socket closes with close code 1000 after it.
|
|
1345
1412
|
* @public
|
|
1346
1413
|
*/
|
|
1347
|
-
|
|
1414
|
+
ended?: VoiceCallEndedFrame | undefined;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* The text messages of the call socket `/v2/voice/calls/ws`. The socket has no connect parameters: the first text frame is `start`.
|
|
1418
|
+
* @public
|
|
1419
|
+
*/
|
|
1420
|
+
export interface VoiceCallProtocolFrames {
|
|
1348
1421
|
/**
|
|
1349
|
-
*
|
|
1422
|
+
* One example of each text message that the client (the PBX) sends on the call socket.
|
|
1350
1423
|
* @public
|
|
1351
1424
|
*/
|
|
1352
|
-
|
|
1425
|
+
client?: VoiceCallClientFrames | undefined;
|
|
1353
1426
|
/**
|
|
1354
|
-
*
|
|
1427
|
+
* One example of each text message that the server (the cloud) sends on the call socket.
|
|
1355
1428
|
* @public
|
|
1356
1429
|
*/
|
|
1357
|
-
|
|
1430
|
+
server?: VoiceCallServerFrames | undefined;
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* One example of each message that the client sends on the text socket. An event goes in `\{"type": "event", "event": \{...\}\}`; `healthcheck` has no envelope.
|
|
1434
|
+
* @public
|
|
1435
|
+
*/
|
|
1436
|
+
export interface VoiceTextClientFrames {
|
|
1358
1437
|
/**
|
|
1359
|
-
*
|
|
1438
|
+
* Liveness check of the service by the client: `\{"type": "healthcheck"\}`, with no envelope. The service sends no answer.
|
|
1360
1439
|
* @public
|
|
1361
1440
|
*/
|
|
1362
|
-
|
|
1441
|
+
healthcheck?: VoiceHealthcheckCommand | undefined;
|
|
1363
1442
|
/**
|
|
1364
|
-
*
|
|
1443
|
+
* A transcription chunk of caller speech. A client that does its own speech-to-text sends it. When the service does the speech-to-text, the service sends it to the client.
|
|
1365
1444
|
* @public
|
|
1366
1445
|
*/
|
|
1367
|
-
|
|
1446
|
+
transcription?: VoiceTranscriptionEvent | undefined;
|
|
1368
1447
|
/**
|
|
1369
|
-
*
|
|
1448
|
+
* A transcription chunk of the agent speech, as the caller hears it. It does not start a turn.
|
|
1370
1449
|
* @public
|
|
1371
1450
|
*/
|
|
1372
|
-
|
|
1451
|
+
agentTranscription?: VoiceAgentTranscriptionEvent | undefined;
|
|
1373
1452
|
/**
|
|
1374
|
-
*
|
|
1453
|
+
* A final caller utterance. It starts an agent turn.
|
|
1375
1454
|
* @public
|
|
1376
1455
|
*/
|
|
1377
|
-
|
|
1456
|
+
reply?: VoiceReplyEvent | undefined;
|
|
1378
1457
|
/**
|
|
1379
|
-
*
|
|
1458
|
+
* Progress of the playback of a reply on the client.
|
|
1380
1459
|
* @public
|
|
1381
1460
|
*/
|
|
1382
|
-
|
|
1461
|
+
playback?: VoicePlaybackEvent | undefined;
|
|
1383
1462
|
/**
|
|
1384
|
-
*
|
|
1463
|
+
* The caller spoke over a reply while the client played it.
|
|
1385
1464
|
* @public
|
|
1386
1465
|
*/
|
|
1387
|
-
|
|
1466
|
+
interruption?: VoiceInterruptionEvent | undefined;
|
|
1388
1467
|
/**
|
|
1389
|
-
*
|
|
1468
|
+
* The call or the conversation is complete, for example because the caller hung up. The service ends the session. The service also accepts `type` `ended` with the same meaning.
|
|
1390
1469
|
* @public
|
|
1391
1470
|
*/
|
|
1392
|
-
|
|
1471
|
+
complete?: VoiceCompleteEvent | undefined;
|
|
1393
1472
|
}
|
|
1394
1473
|
/**
|
|
1395
1474
|
* Parameters supplied on the WebSocket connect (upgrade) request, as query-string parameters.
|
|
@@ -1482,99 +1561,91 @@ export interface VoiceConnectParams {
|
|
|
1482
1561
|
company?: string | undefined;
|
|
1483
1562
|
}
|
|
1484
1563
|
/**
|
|
1564
|
+
* One example of each message that the server sends on the text socket. An event goes in `\{"type": "event", "event": \{...\}\}`, a command in `\{"type": "command", "command": \{...\}\}`.
|
|
1485
1565
|
* @public
|
|
1486
1566
|
*/
|
|
1487
|
-
export interface
|
|
1488
|
-
/**
|
|
1489
|
-
* Parameters supplied on the WebSocket connect (upgrade) request, as query-string parameters.
|
|
1490
|
-
* @public
|
|
1491
|
-
*/
|
|
1492
|
-
connectParams?: VoiceConnectParams | undefined;
|
|
1493
|
-
/**
|
|
1494
|
-
* Keepalive frame from the client: `\{"type": "healthcheck"\}`. The service sends no answer.
|
|
1495
|
-
* @public
|
|
1496
|
-
*/
|
|
1497
|
-
healthcheckWebsocketFrame?: VoiceHealthcheckWebsocketFrame | undefined;
|
|
1498
|
-
/**
|
|
1499
|
-
* A transcription chunk of caller speech. A client that does its own speech-to-text sends it. When the service does the speech-to-text, the service sends it to the client.
|
|
1500
|
-
* @public
|
|
1501
|
-
*/
|
|
1502
|
-
transcriptionEvent?: VoiceTranscriptionEvent | undefined;
|
|
1567
|
+
export interface VoiceTextServerFrames {
|
|
1503
1568
|
/**
|
|
1504
|
-
*
|
|
1569
|
+
* The session is ready. Sent once after the handshake, on the PBX voice socket only when the client sends protocol version 1 or more.
|
|
1505
1570
|
* @public
|
|
1506
1571
|
*/
|
|
1507
|
-
|
|
1572
|
+
started?: VoiceSessionStartedEvent | undefined;
|
|
1508
1573
|
/**
|
|
1509
|
-
*
|
|
1574
|
+
* The session ended. This is the last event of the session.
|
|
1510
1575
|
* @public
|
|
1511
1576
|
*/
|
|
1512
|
-
|
|
1577
|
+
ended?: VoiceSessionEndedEvent | undefined;
|
|
1513
1578
|
/**
|
|
1514
|
-
*
|
|
1579
|
+
* An error on the connection. The session continues, unless a `ended` event follows.
|
|
1515
1580
|
* @public
|
|
1516
1581
|
*/
|
|
1517
|
-
|
|
1582
|
+
error?: VoiceErrorEvent | undefined;
|
|
1518
1583
|
/**
|
|
1519
|
-
*
|
|
1584
|
+
* Play a reply to the caller. When `audio` is present, the service sends the audio of the reply in `play` commands. When `audio` is absent, the client shows `text` or synthesizes it itself.
|
|
1520
1585
|
* @public
|
|
1521
1586
|
*/
|
|
1522
|
-
|
|
1587
|
+
say?: VoiceSayCommand | undefined;
|
|
1523
1588
|
/**
|
|
1524
|
-
*
|
|
1589
|
+
* A chunk of synthesized audio of a reply. `data` is base64 of PCM audio at the sample rate of the `say` command. An empty `data` marks the end of the stream.
|
|
1525
1590
|
* @public
|
|
1526
1591
|
*/
|
|
1527
|
-
|
|
1592
|
+
play?: VoicePlayCommand | undefined;
|
|
1528
1593
|
/**
|
|
1529
|
-
*
|
|
1594
|
+
* Stop the audio of the agent.
|
|
1530
1595
|
* @public
|
|
1531
1596
|
*/
|
|
1532
|
-
|
|
1597
|
+
stop?: VoiceStopCommand | undefined;
|
|
1533
1598
|
/**
|
|
1534
|
-
*
|
|
1599
|
+
* End the session and hang up the call.
|
|
1535
1600
|
* @public
|
|
1536
1601
|
*/
|
|
1537
|
-
|
|
1602
|
+
hangup?: VoiceHangupCommand | undefined;
|
|
1538
1603
|
/**
|
|
1539
|
-
*
|
|
1604
|
+
* Transfer the call to a PBX destination and end the session. Only a PBX client does the transfer.
|
|
1540
1605
|
* @public
|
|
1541
1606
|
*/
|
|
1542
|
-
|
|
1607
|
+
transfer?: VoiceTransferCommand | undefined;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* The connect parameters and the messages of the text socket `/v2/voice/ws`.
|
|
1611
|
+
* @public
|
|
1612
|
+
*/
|
|
1613
|
+
export interface VoiceTextProtocolFrames {
|
|
1543
1614
|
/**
|
|
1544
|
-
*
|
|
1615
|
+
* Query parameters of the upgrade request.
|
|
1545
1616
|
* @public
|
|
1546
1617
|
*/
|
|
1547
|
-
|
|
1618
|
+
connectParams?: VoiceConnectParams | undefined;
|
|
1548
1619
|
/**
|
|
1549
|
-
*
|
|
1620
|
+
* Messages that the client sends.
|
|
1550
1621
|
* @public
|
|
1551
1622
|
*/
|
|
1552
|
-
|
|
1623
|
+
client?: VoiceTextClientFrames | undefined;
|
|
1553
1624
|
/**
|
|
1554
|
-
*
|
|
1625
|
+
* Messages that the server sends.
|
|
1555
1626
|
* @public
|
|
1556
1627
|
*/
|
|
1557
|
-
|
|
1628
|
+
server?: VoiceTextServerFrames | undefined;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* @public
|
|
1632
|
+
*/
|
|
1633
|
+
export interface DescribeVoiceProtocolOutput {
|
|
1558
1634
|
/**
|
|
1559
|
-
*
|
|
1635
|
+
* Text socket `/v2/voice/ws`.
|
|
1560
1636
|
* @public
|
|
1561
1637
|
*/
|
|
1562
|
-
|
|
1638
|
+
textSocket?: VoiceTextProtocolFrames | undefined;
|
|
1563
1639
|
/**
|
|
1564
|
-
*
|
|
1640
|
+
* Call socket `/v2/voice/calls/ws`.
|
|
1565
1641
|
* @public
|
|
1566
1642
|
*/
|
|
1567
|
-
|
|
1643
|
+
callSocket?: VoiceCallProtocolFrames | undefined;
|
|
1568
1644
|
/**
|
|
1569
|
-
* One event of the StreamCallEvents SSE stream (`event:` is the member name, `data:` its JSON).
|
|
1645
|
+
* One event of the StreamCallEvents SSE stream (`event:` is the member name, `data:` its JSON). The stream body itself is an opaque byte stream.
|
|
1570
1646
|
* @public
|
|
1571
1647
|
*/
|
|
1572
1648
|
callEvent?: VoiceCallEvent | undefined;
|
|
1573
|
-
/**
|
|
1574
|
-
* Text messages of the call socket `/v2/voice/calls/ws`: one example of each.
|
|
1575
|
-
* @public
|
|
1576
|
-
*/
|
|
1577
|
-
callSocket?: VoiceCallProtocolFrames | undefined;
|
|
1578
1649
|
}
|
|
1579
1650
|
/**
|
|
1580
1651
|
* @public
|