@signalwire/js 3.28.0 → 3.28.1

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.
Files changed (104) hide show
  1. package/dist/core/src/BaseSession.d.ts +1 -1
  2. package/dist/core/src/RPCMessages/VertoMessages.d.ts +7 -0
  3. package/dist/core/src/RPCMessages/VertoMessages.d.ts.map +1 -1
  4. package/dist/core/src/index.d.ts +2 -2
  5. package/dist/core/src/index.d.ts.map +1 -1
  6. package/dist/core/src/redux/features/component/componentSlice.d.ts +96 -0
  7. package/dist/core/src/redux/features/component/componentSlice.d.ts.map +1 -1
  8. package/dist/core/src/redux/rootReducer.d.ts +16 -0
  9. package/dist/core/src/redux/rootReducer.d.ts.map +1 -1
  10. package/dist/core/src/types/common.d.ts +16 -10
  11. package/dist/core/src/types/common.d.ts.map +1 -1
  12. package/dist/core/src/types/fabric.d.ts +0 -27
  13. package/dist/core/src/types/fabric.d.ts.map +1 -1
  14. package/dist/core/src/types/index.d.ts +67 -1
  15. package/dist/core/src/types/index.d.ts.map +1 -1
  16. package/dist/core/src/types/videoPlayback.d.ts +1 -7
  17. package/dist/core/src/types/videoPlayback.d.ts.map +1 -1
  18. package/dist/core/src/types/videoRecording.d.ts +1 -7
  19. package/dist/core/src/types/videoRecording.d.ts.map +1 -1
  20. package/dist/core/src/types/voice.d.ts +13 -2
  21. package/dist/core/src/types/voice.d.ts.map +1 -1
  22. package/dist/core/src/types/voiceCall.d.ts +96 -964
  23. package/dist/core/src/types/voiceCall.d.ts.map +1 -1
  24. package/dist/core/src/types/voiceCollect.d.ts +166 -0
  25. package/dist/core/src/types/voiceCollect.d.ts.map +1 -0
  26. package/dist/core/src/types/voiceConnect.d.ts +77 -0
  27. package/dist/core/src/types/voiceConnect.d.ts.map +1 -0
  28. package/dist/core/src/types/voiceDetect.d.ts +127 -0
  29. package/dist/core/src/types/voiceDetect.d.ts.map +1 -0
  30. package/dist/core/src/types/voicePlayback.d.ts +141 -0
  31. package/dist/core/src/types/voicePlayback.d.ts.map +1 -0
  32. package/dist/core/src/types/voicePrompt.d.ts +105 -0
  33. package/dist/core/src/types/voicePrompt.d.ts.map +1 -0
  34. package/dist/core/src/types/voiceRecording.d.ts +107 -0
  35. package/dist/core/src/types/voiceRecording.d.ts.map +1 -0
  36. package/dist/core/src/types/voiceSendDigits.d.ts +21 -0
  37. package/dist/core/src/types/voiceSendDigits.d.ts.map +1 -0
  38. package/dist/core/src/types/voiceTap.d.ts +116 -0
  39. package/dist/core/src/types/voiceTap.d.ts.map +1 -0
  40. package/dist/core/src/utils/constants.d.ts.map +1 -1
  41. package/dist/core/src/utils/eventUtils.d.ts +0 -2
  42. package/dist/core/src/utils/eventUtils.d.ts.map +1 -1
  43. package/dist/core/src/utils/interfaces.d.ts +19 -2
  44. package/dist/core/src/utils/interfaces.d.ts.map +1 -1
  45. package/dist/index.esm.js +636 -223
  46. package/dist/index.esm.js.map +4 -4
  47. package/dist/index.js +655 -233
  48. package/dist/index.js.map +4 -4
  49. package/dist/index.umd.js +26 -2
  50. package/dist/index.umd.js.map +1 -1
  51. package/dist/js/src/fabric/Conversation.d.ts +2 -2
  52. package/dist/js/src/fabric/Conversation.d.ts.map +1 -1
  53. package/dist/js/src/fabric/FabricRoomSession.d.ts +5 -4
  54. package/dist/js/src/fabric/FabricRoomSession.d.ts.map +1 -1
  55. package/dist/js/src/fabric/SignalWire.d.ts.map +1 -1
  56. package/dist/js/src/fabric/WSClient.d.ts +2 -2
  57. package/dist/js/src/fabric/WSClient.d.ts.map +1 -1
  58. package/dist/js/src/fabric/createWSClient.d.ts +1 -1
  59. package/dist/js/src/fabric/createWSClient.d.ts.map +1 -1
  60. package/dist/js/src/fabric/interfaces/capabilities.d.ts +28 -0
  61. package/dist/js/src/fabric/interfaces/capabilities.d.ts.map +1 -0
  62. package/dist/js/src/fabric/interfaces/conversation.d.ts +4 -4
  63. package/dist/js/src/fabric/interfaces/conversation.d.ts.map +1 -1
  64. package/dist/js/src/fabric/interfaces/index.d.ts +1 -0
  65. package/dist/js/src/fabric/interfaces/index.d.ts.map +1 -1
  66. package/dist/js/src/fabric/interfaces/wsClient.d.ts +2 -2
  67. package/dist/js/src/fabric/interfaces/wsClient.d.ts.map +1 -1
  68. package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts +28 -0
  69. package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts.map +1 -0
  70. package/dist/js/src/fabric/workers/callJoinWorker.d.ts.map +1 -1
  71. package/dist/js/src/fabric/workers/wsClientWorker.d.ts.map +1 -1
  72. package/dist/js/src/index.d.ts +2 -2
  73. package/dist/js/src/index.d.ts.map +1 -1
  74. package/dist/js/src/utils/interfaces/fabric.d.ts +6 -3
  75. package/dist/js/src/utils/interfaces/fabric.d.ts.map +1 -1
  76. package/dist/js/src/utils/paginatedResult.d.ts +4 -4
  77. package/dist/js/tsconfig.build.tsbuildinfo +1 -1
  78. package/dist/webrtc/src/BaseConnection.d.ts +78 -19
  79. package/dist/webrtc/src/BaseConnection.d.ts.map +1 -1
  80. package/dist/webrtc/src/RTCPeer.d.ts +11 -0
  81. package/dist/webrtc/src/RTCPeer.d.ts.map +1 -1
  82. package/dist/webrtc/src/utils/helpers.d.ts.map +1 -1
  83. package/dist/webrtc/src/utils/interfaces.d.ts +6 -0
  84. package/dist/webrtc/src/utils/interfaces.d.ts.map +1 -1
  85. package/dist/webrtc/src/utils/sdpHelpers.d.ts +27 -2
  86. package/dist/webrtc/src/utils/sdpHelpers.d.ts.map +1 -1
  87. package/package.json +3 -3
  88. package/src/fabric/Conversation.ts +9 -7
  89. package/src/fabric/FabricRoomSession.ts +32 -32
  90. package/src/fabric/SignalWire.test.ts +2 -0
  91. package/src/fabric/SignalWire.ts +2 -0
  92. package/src/fabric/WSClient.ts +6 -10
  93. package/src/fabric/interfaces/capabilities.ts +30 -0
  94. package/src/fabric/interfaces/conversation.ts +5 -4
  95. package/src/fabric/interfaces/index.ts +2 -1
  96. package/src/fabric/interfaces/wsClient.ts +2 -2
  97. package/src/fabric/utils/capabilitiesHelpers.test.ts +201 -0
  98. package/src/fabric/utils/capabilitiesHelpers.ts +190 -0
  99. package/src/fabric/workers/callJoinWorker.ts +7 -6
  100. package/src/fabric/workers/wsClientWorker.ts +35 -12
  101. package/src/index.ts +1 -1
  102. package/src/utils/interfaces/fabric.ts +10 -3
  103. package/dist/core/src/utils/eventUtils.test.d.ts +0 -2
  104. package/dist/core/src/utils/eventUtils.test.d.ts.map +0 -1
@@ -1,64 +1,109 @@
1
- import type { SwEvent } from '.';
1
+ import type { SwEvent, VoiceCallPlayAudioMethodParams, VoiceCallPlaybackContract, VoiceCallPlaybackEvent, VoiceCallPlaybackEventNames, VoicePlaylist, VoiceCallPlayMethod, VoiceCallPlayRingtoneMethodParams, VoiceCallPlaySilenceMethodParams, VoiceCallPlayTTSMethodParams, VoiceCallRecordingEventNames, VoiceCallRecordMethodParams, VoiceCallRecordingContract, VoiceCallRecordingEvent, VoiceCallRecordMethod, VoiceCallDetectMethod, VoiceCallPlaybackEventParams, VoiceCallRecordingEventParams, VoiceCallDetectEventParams, VoiceCallDetectEventNames, VoiceCallDetectMethodParams, VoiceCallDetectContract, VoiceCallDetectMachineParams, VoiceCallDetectFaxParams, VoiceCallDetectDigitParams, VoiceCallDetectEvent, VoiceCallTapEventNames, VoiceCallTapMethodParams, VoiceCallTapContract, VoiceCallTapAudioMethodParams, VoiceCallTapEvent, VoiceCallTapMethod, VoiceCallCollectEventNames, VoiceCallCollectMethodParams, VoiceCallCollectContract, VoiceCallCollectEvent, VoiceCallTapEventParams, VoiceCallCollectEventParams, VoiceCallCollectMethod, VoiceCallPromptEventNames, VoiceCallPromptMethodParams, VoiceCallPromptAudioMethodParams, VoiceCallPromptContract, VoiceCallPromptRingtoneMethodParams, VoiceCallPromptTTSMethodParams, VoiceCallPromptEvent, VoiceCallPromptEventParams, VoiceCallPromptMethod, VoiceCallSendDigitsEvent, VoiceCallSendDigitsEventParams, VoiceCallSendDigitsMethod, ToInternalVoiceEvent, VoiceCallConnectEventNames, VoiceCallConnectMethodParams, VoiceCallConnectPhoneMethodParams, VoiceCallConnectSipMethodParams, VoiceCallConnectEvent, VoiceCallConnectEventParams, VoiceCallConnectMethod, CallingCallConnectState, NestedArray } from '.';
2
2
  import { MapToPubSubShape } from '..';
3
- import { PRODUCT_PREFIX_VOICE_CALL } from '../utils/constants';
4
3
  import type { CamelToSnakeCase, OnlyFunctionProperties, OnlyStateProperties } from './utils';
5
- type ToInternalVoiceEvent<T extends string> = `${VoiceNamespace}.${T}`;
6
- export type VoiceNamespace = typeof PRODUCT_PREFIX_VOICE_CALL;
7
- export type RingtoneName = 'at' | 'au' | 'bg' | 'br' | 'be' | 'ch' | 'cl' | 'cn' | 'cz' | 'de' | 'dk' | 'ee' | 'es' | 'fi' | 'fr' | 'gr' | 'hu' | 'il' | 'in' | 'it' | 'lt' | 'jp' | 'mx' | 'my' | 'nl' | 'no' | 'nz' | 'ph' | 'pl' | 'pt' | 'ru' | 'se' | 'sg' | 'th' | 'uk' | 'us' | 'tw' | 've' | 'za';
8
- /**
9
- * Private event types
10
- */
11
4
  export type CallDial = 'call.dial';
12
5
  export type CallState = 'call.state';
13
6
  export type CallReceive = 'call.receive';
14
- export type CallPlay = 'call.play';
15
- export type CallRecord = 'call.record';
16
- export type CallCollect = 'call.collect';
17
- export type CallTap = 'call.tap';
18
- export type CallConnect = 'call.connect';
19
- export type CallSendDigits = 'call.send_digits';
20
- export type CallDetect = 'call.detect';
21
- /**
22
- * Public event types
23
- */
24
7
  export type CallCreated = 'call.created';
25
8
  export type CallEnded = 'call.ended';
26
9
  export type CallReceived = 'call.received';
27
- export type CallPlaybackStarted = 'playback.started';
28
- export type CallPlaybackUpdated = 'playback.updated';
29
- export type CallPlaybackEnded = 'playback.ended';
30
- export type CallPlaybackFailed = 'playback.failed';
31
- export type CallRecordingStarted = 'recording.started';
32
- export type CallRecordingUpdated = 'recording.updated';
33
- export type CallRecordingEnded = 'recording.ended';
34
- export type CallRecordingFailed = 'recording.failed';
35
- export type CallPromptStarted = 'prompt.started';
36
- export type CallPromptStartOfInput = 'prompt.startOfInput';
37
- export type CallPromptUpdated = 'prompt.updated';
38
- export type CallPromptEnded = 'prompt.ended';
39
- export type CallPromptFailed = 'prompt.failed';
40
- export type CallCollectStarted = 'collect.started';
41
- export type CallCollectStartOfInput = 'collect.startOfInput';
42
- export type CallCollectUpdated = 'collect.updated';
43
- export type CallCollectEnded = 'collect.ended';
44
- export type CallCollectFailed = 'collect.failed';
45
- export type CallTapStarted = 'tap.started';
46
- export type CallTapEnded = 'tap.ended';
47
- export type CallConnectConnecting = 'connect.connecting';
48
- export type CallConnectConnected = 'connect.connected';
49
- export type CallConnectDisconnected = 'connect.disconnected';
50
- export type CallConnectFailed = 'connect.failed';
51
- export type CallDetectStarted = 'detect.started';
52
- export type CallDetectUpdated = 'detect.updated';
53
- export type CallDetectEnded = 'detect.ended';
10
+ export type VoiceCallEventNames = CallCreated | CallEnded | VoiceCallPlaybackEventNames | VoiceCallRecordingEventNames | VoiceCallDetectEventNames | VoiceCallTapEventNames | VoiceCallCollectEventNames | VoiceCallPromptEventNames | VoiceCallConnectEventNames;
11
+ type CallDeviceParamsShared = {
12
+ timeout?: number;
13
+ max_duration?: number;
14
+ call_state_url?: string;
15
+ call_state_events?: string[];
16
+ };
17
+ export interface CallingCallPhoneDevice {
18
+ type: 'phone';
19
+ params: {
20
+ from_number: string;
21
+ to_number: string;
22
+ } & CallDeviceParamsShared;
23
+ }
24
+ export interface CallingCallSIPDevice {
25
+ type: 'sip';
26
+ params: {
27
+ from: string;
28
+ from_name?: string;
29
+ to: string;
30
+ headers?: SipHeader[];
31
+ codecs?: SipCodec[];
32
+ webrtc_media?: boolean;
33
+ } & CallDeviceParamsShared;
34
+ }
35
+ export type CallingCallDevice = CallingCallPhoneDevice | CallingCallSIPDevice;
36
+ export type CallingCallDirection = 'inbound' | 'outbound';
37
+ export type CallingCallState = 'created' | 'ringing' | 'answered' | 'ending' | 'ended';
38
+ export interface CallingCall {
39
+ call_id: string;
40
+ call_state: CallingCallState;
41
+ context?: string;
42
+ tag?: string;
43
+ direction: CallingCallDirection;
44
+ device: CallingCallDevice;
45
+ node_id: string;
46
+ segment_id?: string;
47
+ }
48
+ interface CallingCallDial extends CallingCall {
49
+ dial_winner: 'true' | 'false';
50
+ }
54
51
  /**
55
- * List of public event names
52
+ * 'calling.call.dial'
56
53
  */
57
- export type VoiceCallEventNames = CallCreated | CallEnded | CallPlaybackStarted | CallPlaybackUpdated | CallPlaybackEnded | CallPlaybackFailed | CallRecordingStarted | CallRecordingUpdated | CallRecordingEnded | CallRecordingFailed | CallPromptStarted | CallPromptUpdated | CallPromptEnded | CallPromptFailed | CallTapStarted | CallTapEnded | CallConnectConnecting | CallConnectConnected | CallConnectDisconnected | CallConnectFailed | CallDetectStarted | CallDetectUpdated | CallDetectEnded | CallCollectStarted | CallCollectUpdated | CallCollectEnded | CallCollectFailed;
54
+ export type CallingCallDialDialingEventParams = {
55
+ node_id: string;
56
+ tag: string;
57
+ dial_state: 'dialing';
58
+ };
59
+ export type CallingCallDialAnsweredEventParams = {
60
+ node_id: string;
61
+ tag: string;
62
+ dial_state: 'answered';
63
+ call: CallingCallDial;
64
+ };
65
+ export type CallingCallDialFailedEventParams = {
66
+ node_id: string;
67
+ tag: string;
68
+ dial_state: 'failed';
69
+ reason: string;
70
+ source: CallingCallDirection;
71
+ };
72
+ export type CallingCallDialEventParams = CallingCallDialDialingEventParams | CallingCallDialAnsweredEventParams | CallingCallDialFailedEventParams;
73
+ export interface CallingCallDialEvent extends SwEvent {
74
+ event_type: ToInternalVoiceEvent<CallDial>;
75
+ params: CallingCallDialEventParams;
76
+ }
58
77
  /**
59
- * List of internal events
60
- * @internal
78
+ * 'calling.call.state'
61
79
  */
80
+ export interface CallingCallStateEventParams extends CallingCall {
81
+ peer?: {
82
+ call_id: string;
83
+ node_id: string;
84
+ };
85
+ }
86
+ export interface CallingCallStateEvent extends SwEvent {
87
+ event_type: ToInternalVoiceEvent<CallState>;
88
+ params: CallingCallStateEventParams;
89
+ }
90
+ /**
91
+ * 'calling.call.receive'
92
+ */
93
+ export interface CallingCallReceiveEventParams extends CallingCall {
94
+ }
95
+ export interface CallingCallReceiveEvent extends SwEvent {
96
+ event_type: ToInternalVoiceEvent<CallReceive>;
97
+ params: CallingCallReceiveEventParams;
98
+ }
99
+ /**
100
+ * 'calling.call.received'
101
+ */
102
+ export interface VoiceCallReceivedEvent extends SwEvent {
103
+ event_type: ToInternalVoiceEvent<CallReceived>;
104
+ params: CallingCallReceiveEventParams;
105
+ }
106
+ export type VoiceCallMethod = 'calling.dial' | 'calling.end' | 'calling.pass' | 'calling.answer' | VoiceCallPlayMethod | VoiceCallRecordMethod | VoiceCallDetectMethod | VoiceCallTapMethod | VoiceCallCollectMethod | VoiceCallPromptMethod | VoiceCallSendDigitsMethod | VoiceCallConnectMethod;
62
107
  export type SipCodec = 'PCMU' | 'PCMA' | 'OPUS' | 'G729' | 'G722' | 'VP8' | 'H264';
63
108
  export interface SipHeader {
64
109
  name: string;
@@ -84,176 +129,11 @@ export interface VoiceCallSipParams extends VoiceCallParams {
84
129
  webrtcMedia?: boolean;
85
130
  sessionTimeout?: number;
86
131
  }
87
- export interface NestedArray<T> extends Array<T | NestedArray<T>> {
88
- }
89
132
  export type VoiceCallDeviceParams = VoiceCallPhoneParams | VoiceCallSipParams;
90
133
  export interface VoiceCallDialMethodParams {
91
134
  region?: string;
92
135
  devices: NestedArray<VoiceCallDeviceParams>;
93
136
  }
94
- export interface VoiceCallPlayAudioParams {
95
- type: 'audio';
96
- url: string;
97
- }
98
- export interface VoiceCallPlayTTSParams {
99
- type: 'tts';
100
- text: string;
101
- language?: string;
102
- gender?: 'male' | 'female';
103
- voice?: string;
104
- }
105
- export interface VoiceCallPlaySilenceParams {
106
- type: 'silence';
107
- duration: number;
108
- }
109
- export interface VoiceCallPlayRingtoneParams {
110
- type: 'ringtone';
111
- name: RingtoneName;
112
- duration?: number;
113
- }
114
- export type VoiceCallPlayParams = VoiceCallPlayAudioParams | VoiceCallPlayTTSParams | VoiceCallPlaySilenceParams | VoiceCallPlayRingtoneParams;
115
- export interface VoiceCallPlayMethodParams {
116
- media: NestedArray<VoiceCallPlayParams>;
117
- volume?: number;
118
- }
119
- export interface VoiceCallPlayAudioMethodParams extends OmitType<VoiceCallPlayAudioParams> {
120
- volume?: number;
121
- }
122
- export interface VoicePlaylistAudioParams extends OmitType<VoiceCallPlayAudioParams> {
123
- }
124
- export interface VoiceCallPlaySilenceMethodParams extends OmitType<VoiceCallPlaySilenceParams> {
125
- }
126
- export interface VoicePlaylistSilenceParams extends OmitType<VoiceCallPlaySilenceParams> {
127
- }
128
- export interface VoiceCallPlayRingtoneMethodParams extends OmitType<VoiceCallPlayRingtoneParams> {
129
- volume?: number;
130
- }
131
- export interface VoicePlaylistRingtoneParams extends OmitType<VoiceCallPlayRingtoneParams> {
132
- }
133
- export interface VoiceCallPlayTTSMethodParams extends OmitType<VoiceCallPlayTTSParams> {
134
- volume?: number;
135
- }
136
- export interface VoicePlaylistTTSParams extends OmitType<VoiceCallPlayTTSParams> {
137
- }
138
- export interface VoiceCallRecordMethodParams {
139
- audio: {
140
- beep?: boolean;
141
- format?: 'mp3' | 'wav';
142
- stereo?: boolean;
143
- direction?: 'listen' | 'speak' | 'both';
144
- initialTimeout?: number;
145
- endSilenceTimeout?: number;
146
- terminators?: string;
147
- inputSensitivity?: number;
148
- };
149
- }
150
- export type CollectDigitsConfig = {
151
- /** Max number of digits to collect. */
152
- max: number;
153
- /** Timeout in seconds between each digit. */
154
- digitTimeout?: number;
155
- /** DTMF digits that will end the collection. Default not set. */
156
- terminators?: string;
157
- };
158
- export type CollectSpeechConfig = {
159
- /** How much silence to wait for end of speech. Default to 1 second. */
160
- endSilenceTimeout?: number;
161
- /** Maximum time to collect speech. Default to 60 seconds. */
162
- speechTimeout?: number;
163
- /** Language to detect. Default to `en-US`. */
164
- language?: string;
165
- /** Array of expected phrases to detect. */
166
- hints?: string[];
167
- /** Model use for enhance speech recognition */
168
- model?: 'default' | 'enhanced' | 'enhanced.phone_call' | 'enhanced.video';
169
- };
170
- export type SpeechOrDigits = {
171
- digits: CollectDigitsConfig;
172
- speech?: never;
173
- } | {
174
- digits?: never;
175
- speech: CollectSpeechConfig;
176
- };
177
- export type VoiceCallPromptMethodParams = SpeechOrDigits & {
178
- playlist: VoicePlaylist;
179
- initialTimeout?: number;
180
- };
181
- export type VoiceCallPromptAudioMethodParams = SpeechOrDigits & OmitType<VoiceCallPlayAudioParams> & {
182
- volume?: number;
183
- initialTimeout?: number;
184
- };
185
- export type VoiceCallPromptRingtoneMethodParams = SpeechOrDigits & OmitType<VoiceCallPlayRingtoneParams> & {
186
- volume?: number;
187
- initialTimeout?: number;
188
- };
189
- export type VoiceCallPromptTTSMethodParams = SpeechOrDigits & OmitType<VoiceCallPlayTTSParams> & {
190
- volume?: number;
191
- initialTimeout?: number;
192
- };
193
- type TapCodec = 'OPUS' | 'PCMA' | 'PCMU';
194
- export interface TapDeviceWS {
195
- type: 'ws';
196
- uri: string;
197
- codec?: TapCodec;
198
- rate?: number;
199
- }
200
- export interface TapDeviceRTP {
201
- type: 'rtp';
202
- addr: string;
203
- port: string;
204
- codec?: TapCodec;
205
- ptime?: number;
206
- }
207
- export type TapDevice = TapDeviceWS | TapDeviceRTP;
208
- export type TapDirection = 'listen' | 'speak' | 'both';
209
- export interface VoiceCallTapMethodParams {
210
- device: TapDevice;
211
- audio: {
212
- direction: TapDirection;
213
- };
214
- }
215
- export interface VoiceCallTapAudioMethodParams {
216
- device: TapDevice;
217
- direction: TapDirection;
218
- }
219
- export type VoiceCallCollectMethodParams = SpeechOrDigits & {
220
- initialTimeout?: number;
221
- partialResults?: boolean;
222
- continuous?: boolean;
223
- sendStartOfInput?: boolean;
224
- startInputTimers?: boolean;
225
- };
226
- export interface VoiceCallConnectAdditionalParams {
227
- ringback?: VoicePlaylist;
228
- maxPricePerMinute?: number;
229
- }
230
- export type VoiceCallConnectMethodParams = VoiceDeviceBuilder | ({
231
- devices: VoiceDeviceBuilder;
232
- } & VoiceCallConnectAdditionalParams);
233
- export type VoiceCallConnectPhoneMethodParams = OmitType<VoiceCallPhoneParams> & VoiceCallConnectAdditionalParams;
234
- export type VoiceCallConnectSipMethodParams = OmitType<VoiceCallSipParams> & VoiceCallConnectAdditionalParams;
235
- interface VoiceCallDetectBaseParams {
236
- timeout?: number;
237
- waitForBeep?: boolean;
238
- }
239
- export interface VoiceCallDetectMachineParams extends VoiceCallDetectBaseParams {
240
- type: 'machine';
241
- initialTimeout?: number;
242
- endSilenceTimeout?: number;
243
- machineReadyTimeout?: number;
244
- machineVoiceThreshold?: number;
245
- machineWordsThreshold?: number;
246
- detectInterruptions?: boolean;
247
- }
248
- export interface VoiceCallDetectFaxParams extends VoiceCallDetectBaseParams {
249
- type: 'fax';
250
- tone?: 'CED' | 'CNG';
251
- }
252
- export interface VoiceCallDetectDigitParams extends VoiceCallDetectBaseParams {
253
- type: 'digit';
254
- digits?: string;
255
- }
256
- export type VoiceCallDetectMethodParams = VoiceCallDetectMachineParams | VoiceCallDetectFaxParams | VoiceCallDetectDigitParams;
257
137
  export type VoiceCallDisconnectReason = 'hangup' | 'cancel' | 'busy' | 'noAnswer' | 'decline' | 'error';
258
138
  export interface VoiceCallDialRegionParams {
259
139
  region?: VoiceRegion;
@@ -270,199 +150,7 @@ export interface VoiceDeviceBuilder {
270
150
  devices: VoiceCallDialMethodParams['devices'];
271
151
  add(params: VoiceCallDeviceParams | VoiceCallDeviceParams[]): this;
272
152
  }
273
- export interface CreateVoicePlaylistParams {
274
- /** Default volume for the audio in the playlist. */
275
- volume?: number;
276
- }
277
- export interface VoicePlaylist extends CreateVoicePlaylistParams {
278
- media: VoiceCallPlayMethodParams['media'];
279
- add(params: VoiceCallPlayParams): this;
280
- }
281
- /**
282
- * Public Contract for a VoiceCall
283
- */
284
- export interface VoiceCallPlaybackContract {
285
- /** Unique id for this playback */
286
- readonly id: string;
287
- /** @ignore */
288
- readonly callId: string;
289
- /** @ignore */
290
- readonly controlId: string;
291
- /** @ignore */
292
- readonly volume: number;
293
- /** @ignore */
294
- readonly state: CallingCallPlayState;
295
- pause(): Promise<this>;
296
- resume(): Promise<this>;
297
- stop(): Promise<this>;
298
- setVolume(volume: number): Promise<this>;
299
- /**
300
- * @deprecated use {@link ended} instead.
301
- */
302
- waitForEnded(): Promise<this>;
303
- ended(): Promise<this>;
304
- }
305
- /**
306
- * VoiceCallPlayback properties
307
- */
308
- export type VoiceCallPlaybackEntity = OnlyStateProperties<VoiceCallPlaybackContract>;
309
- /**
310
- * VoiceCallPlayback methods
311
- */
312
- export type VoiceCallPlaybackMethods = OnlyFunctionProperties<VoiceCallPlaybackContract>;
313
- /**
314
- * Public Contract for a VoiceCallRecording
315
- */
316
- export interface VoiceCallRecordingContract {
317
- /** Unique id for this recording */
318
- readonly id: string;
319
- /** @ignore */
320
- readonly callId: string;
321
- /** @ignore */
322
- readonly controlId: string;
323
- /** @ignore */
324
- readonly state: CallingCallRecordState | undefined;
325
- /** @ignore */
326
- readonly url: string | undefined;
327
- /** @ignore */
328
- readonly size: number | undefined;
329
- /** @ignore */
330
- readonly duration: number | undefined;
331
- /** @ignore */
332
- readonly record: CallingCallRecordEventParams['record'] | undefined;
333
- pause(params?: CallingCallRecordPauseMethodParams): Promise<this>;
334
- resume(): Promise<this>;
335
- stop(): Promise<this>;
336
- ended(): Promise<this>;
337
- }
338
- /**
339
- * VoiceCallRecording properties
340
- */
341
- export type VoiceCallRecordingEntity = OnlyStateProperties<VoiceCallRecordingContract>;
342
- /**
343
- * VoiceCallRecording methods
344
- */
345
- export type VoiceCallRecordingMethods = OnlyFunctionProperties<VoiceCallRecordingContract>;
346
- /**
347
- * Public Contract for a VoiceCallDetect
348
- */
349
- export interface VoiceCallDetectContract {
350
- /** Unique id for this detection */
351
- readonly id: string;
352
- /** @ignore */
353
- readonly callId: string;
354
- /** @ignore */
355
- readonly controlId: string;
356
- /** @ignore The type of this detecting session. */
357
- readonly type?: CallingCallDetectType;
358
- /** @ignore The result value of the detection. */
359
- readonly result: DetectorResult;
360
- stop(): Promise<this>;
361
- /**
362
- * @deprecated use {@link ended} instead.
363
- */
364
- waitForResult(): Promise<this>;
365
- ended(): Promise<this>;
366
- }
367
- /**
368
- * VoiceCallDetect properties
369
- */
370
- export type VoiceCallDetectEntity = OnlyStateProperties<VoiceCallDetectContract>;
371
- /**
372
- * VoiceCallDetect methods
373
- */
374
- export type VoiceCallDetectMethods = OnlyFunctionProperties<VoiceCallDetectContract>;
375
- /**
376
- * Public Contract for a VoiceCallPrompt
377
- */
378
- export interface VoiceCallPromptContract {
379
- /** Unique id for this recording */
380
- readonly id: string;
381
- /** @ignore */
382
- readonly callId: string;
383
- /** @ignore */
384
- readonly controlId: string;
385
- readonly type?: CallingCallCollectResult['type'];
386
- /** Alias for type in case of errors */
387
- readonly reason: string | undefined;
388
- readonly digits: string | undefined;
389
- readonly speech: string | undefined;
390
- readonly terminator: string | undefined;
391
- readonly text: string | undefined;
392
- readonly confidence: number | undefined;
393
- stop(): Promise<this>;
394
- setVolume(volume: number): Promise<this>;
395
- /**
396
- * @deprecated use {@link ended} instead.
397
- */
398
- waitForResult(): Promise<VoiceCallPromptContract>;
399
- ended(): Promise<this>;
400
- }
401
- /**
402
- * VoiceCallPrompt properties
403
- */
404
- export type VoiceCallPromptEntity = OnlyStateProperties<VoiceCallPromptContract>;
405
- /**
406
- * VoiceCallPrompt methods
407
- */
408
- export type VoiceCallPromptMethods = OnlyFunctionProperties<VoiceCallPromptContract>;
409
- /**
410
- * Public Contract for a VoiceCallCollect
411
- */
412
- export interface VoiceCallCollectContract {
413
- /** Unique id for this recording */
414
- readonly id: string;
415
- /** @ignore */
416
- readonly callId: string;
417
- /** @ignore */
418
- readonly controlId: string;
419
- readonly type?: CallingCallCollectResult['type'];
420
- /** Alias for type in case of errors */
421
- readonly reason: string | undefined;
422
- readonly digits: string | undefined;
423
- readonly speech: string | undefined;
424
- readonly terminator: string | undefined;
425
- readonly text: string | undefined;
426
- readonly confidence: number | undefined;
427
- stop(): Promise<this>;
428
- startInputTimers(): Promise<this>;
429
- ended(): Promise<this>;
430
- }
431
- /**
432
- * VoiceCallCollect properties
433
- */
434
- export type VoiceCallCollectEntity = OnlyStateProperties<VoiceCallCollectContract>;
435
- /**
436
- * VoiceCallCollect methods
437
- */
438
- export type VoiceCallCollectMethods = OnlyFunctionProperties<VoiceCallCollectContract>;
439
- /**
440
- * Public Contract for a VoiceCallTap
441
- */
442
- export interface VoiceCallTapContract {
443
- /** Unique id for this recording */
444
- readonly id: string;
445
- /** @ignore */
446
- readonly callId: string;
447
- /** @ignore */
448
- readonly controlId: string;
449
- /** @ignore */
450
- readonly state: CallingCallTapState;
451
- stop(): Promise<this>;
452
- ended(): Promise<this>;
453
- }
454
- /**
455
- * VoiceCallTap properties
456
- */
457
- export type VoiceCallTapEntity = OnlyStateProperties<VoiceCallTapContract>;
458
- /**
459
- * VoiceCallTap methods
460
- */
461
- export type VoiceCallTapMethods = OnlyFunctionProperties<VoiceCallTapContract>;
462
153
  export type CallingCallWaitForState = Extract<CallingCallState, 'ending' | 'ended'>;
463
- /**
464
- * Public Contract for a VoiceCall
465
- */
466
154
  export interface VoiceCallContract<T = any> {
467
155
  /** Unique id for this voice call */
468
156
  readonly id: string;
@@ -555,567 +243,11 @@ export type VoiceCallMethods = OnlyFunctionProperties<VoiceCallContract>;
555
243
  export type InternalVoiceCallEntity = {
556
244
  [K in NonNullable<keyof VoiceCallEntity> as CamelToSnakeCase<K>]: VoiceCallEntity[K];
557
245
  };
558
- /**
559
- * ==========
560
- * ==========
561
- * Server-Side Events
562
- * ==========
563
- * ==========
564
- */
565
- type CallDeviceParamsShared = {
566
- timeout?: number;
567
- max_duration?: number;
568
- call_state_url?: string;
569
- call_state_events?: string[];
570
- };
571
- export interface CallingCallPhoneDevice {
572
- type: 'phone';
573
- params: {
574
- from_number: string;
575
- to_number: string;
576
- } & CallDeviceParamsShared;
577
- }
578
- export interface CallingCallSIPDevice {
579
- type: 'sip';
580
- params: {
581
- from: string;
582
- from_name?: string;
583
- to: string;
584
- headers?: SipHeader[];
585
- codecs?: SipCodec[];
586
- webrtc_media?: boolean;
587
- } & CallDeviceParamsShared;
588
- }
589
- type CallingCallDevice = CallingCallPhoneDevice | CallingCallSIPDevice;
590
- export type CallingCallDirection = 'inbound' | 'outbound';
591
- export type CallingCallState = 'created' | 'ringing' | 'answered' | 'ending' | 'ended';
592
- export interface CallingCall {
593
- call_id: string;
594
- call_state: CallingCallState;
595
- context?: string;
596
- tag?: string;
597
- direction: CallingCallDirection;
598
- device: CallingCallDevice;
599
- node_id: string;
600
- segment_id?: string;
601
- }
602
- interface CallingCallDial extends CallingCall {
603
- dial_winner: 'true' | 'false';
604
- }
605
- /**
606
- * 'calling.call.dial'
607
- */
608
- export type CallingCallDialDialingEventParams = {
609
- node_id: string;
610
- tag: string;
611
- dial_state: 'dialing';
612
- };
613
- export type CallingCallDialAnsweredEventParams = {
614
- node_id: string;
615
- tag: string;
616
- dial_state: 'answered';
617
- call: CallingCallDial;
618
- };
619
- export type CallingCallDialFailedEventParams = {
620
- node_id: string;
621
- tag: string;
622
- dial_state: 'failed';
623
- reason: string;
624
- source: CallingCallDirection;
625
- };
626
- export type CallingCallDialEventParams = CallingCallDialDialingEventParams | CallingCallDialAnsweredEventParams | CallingCallDialFailedEventParams;
627
- export interface CallingCallDialEvent extends SwEvent {
628
- event_type: ToInternalVoiceEvent<CallDial>;
629
- params: CallingCallDialEventParams;
630
- }
631
- /**
632
- * 'calling.call.state'
633
- */
634
- export interface CallingCallStateEventParams extends CallingCall {
635
- peer?: {
636
- call_id: string;
637
- node_id: string;
638
- };
639
- }
640
- export interface CallingCallStateEvent extends SwEvent {
641
- event_type: ToInternalVoiceEvent<CallState>;
642
- params: CallingCallStateEventParams;
643
- }
644
- /**
645
- * 'calling.call.receive'
646
- */
647
- export interface CallingCallReceiveEventParams extends CallingCall {
648
- }
649
- export interface CallingCallReceiveEvent extends SwEvent {
650
- event_type: ToInternalVoiceEvent<CallReceive>;
651
- params: CallingCallReceiveEventParams;
652
- }
653
- /**
654
- * 'calling.call.play'
655
- */
656
- export type CallingCallPlayState = 'playing' | 'paused' | 'error' | 'finished';
657
- export type CallingCallPlayEndState = Exclude<CallingCallPlayState, 'playing' | 'paused'>;
658
- export interface CallingCallPlayEventParams {
659
- node_id: string;
660
- call_id: string;
661
- control_id: string;
662
- state: CallingCallPlayState;
663
- }
664
- export interface CallingCallPlayEvent extends SwEvent {
665
- event_type: ToInternalVoiceEvent<CallPlay>;
666
- params: CallingCallPlayEventParams;
667
- }
668
- /**
669
- * 'calling.call.record'
670
- */
671
- export type CallingCallRecordState = 'recording' | 'paused' | 'no_input' | 'finished';
672
- export type CallingCallRecordEndState = Exclude<CallingCallRecordState, 'recording' | 'paused'>;
673
- export interface CallingCallRecordEventParams {
674
- node_id: string;
675
- call_id: string;
676
- control_id: string;
677
- state: CallingCallRecordState;
678
- url?: string;
679
- duration?: number;
680
- size?: number;
681
- record: any;
682
- }
683
- export interface CallingCallRecordEvent extends SwEvent {
684
- event_type: ToInternalVoiceEvent<CallRecord>;
685
- params: CallingCallRecordEventParams;
686
- }
687
- export interface CallingCallRecordPauseMethodParams {
688
- behavior?: 'silence' | 'skip';
689
- }
690
- /**
691
- * 'calling.call.collect'
692
- */
693
- interface CallingCallCollectResultError {
694
- type: 'error';
695
- }
696
- interface CallingCallCollectResultNoInput {
697
- type: 'no_input';
698
- }
699
- interface CallingCallCollectResultNoMatch {
700
- type: 'no_match';
701
- }
702
- interface CallingCallCollectResultStartOfInput {
703
- type: 'start_of_input';
704
- }
705
- interface CallingCallCollectResultDigit {
706
- type: 'digit';
707
- params: {
708
- digits: string;
709
- terminator: string;
710
- };
711
- }
712
- interface CallingCallCollectResultSpeech {
713
- type: 'speech';
714
- params: {
715
- text: string;
716
- confidence: number;
717
- };
718
- }
719
- export type CallingCallCollectResult = CallingCallCollectResultError | CallingCallCollectResultNoInput | CallingCallCollectResultNoMatch | CallingCallCollectResultStartOfInput | CallingCallCollectResultDigit | CallingCallCollectResultSpeech;
720
- export type CallingCallCollectEndState = Exclude<CallingCallCollectResult['type'], 'start_of_input'>;
721
- export type CallingCallCollectState = 'error' | 'collecting' | 'finished';
722
- export interface CallingCallCollectEventParams {
723
- node_id: string;
724
- call_id: string;
725
- control_id: string;
726
- result: CallingCallCollectResult;
727
- final?: boolean;
728
- state?: CallingCallCollectState;
729
- }
730
- export interface CallingCallCollectEvent extends SwEvent {
731
- event_type: ToInternalVoiceEvent<CallCollect>;
732
- params: CallingCallCollectEventParams;
733
- }
734
- /**
735
- * 'calling.call.tap'
736
- */
737
- export type CallingCallTapState = 'tapping' | 'finished';
738
- export type CallingCallTapEndState = Exclude<CallingCallTapState, 'tapping'>;
739
- interface CallingCallTapDeviceRTP {
740
- type: 'rtp';
741
- params: {
742
- addr: string;
743
- port: number;
744
- codec?: TapCodec;
745
- ptime?: number;
746
- };
747
- }
748
- interface CallingCallTapDeviceWS {
749
- type: 'ws';
750
- params: {
751
- uri: string;
752
- codec?: TapCodec;
753
- rate?: number;
754
- };
755
- }
756
- interface CallingCallTapAudio {
757
- type: 'audio';
758
- params: {
759
- direction?: TapDirection;
760
- };
761
- }
762
- export interface CallingCallTapEventParams {
763
- node_id: string;
764
- call_id: string;
765
- control_id: string;
766
- state: CallingCallTapState;
767
- tap: CallingCallTapAudio;
768
- device: CallingCallTapDeviceRTP | CallingCallTapDeviceWS;
769
- }
770
- export interface CallingCallTapEvent extends SwEvent {
771
- event_type: ToInternalVoiceEvent<CallTap>;
772
- params: CallingCallTapEventParams;
773
- }
774
- /**
775
- * 'calling.call.connect'
776
- */
777
- export type CallingCallConnectState = 'connecting' | 'connected' | 'failed' | 'disconnected';
778
- export type CallingCallConnectEventParams = CallingCallConnectSuccessEventParams | CallingCallConnectFailedEventParams;
779
- export interface CallingCallConnectSuccessEventParams {
780
- node_id: string;
781
- call_id: string;
782
- tag: string;
783
- connect_state: 'connecting' | 'connected' | 'disconnected';
784
- peer: {
785
- node_id: string;
786
- call_id: string;
787
- tag: string;
788
- device: CallingCallDevice;
789
- };
790
- }
791
- export interface CallingCallConnectFailedEventParams {
792
- node_id: string;
793
- call_id: string;
794
- tag: string;
795
- connect_state: 'failed';
796
- failed_reason: string;
797
- }
798
- export interface CallingCallConnectEvent extends SwEvent {
799
- event_type: ToInternalVoiceEvent<CallConnect>;
800
- params: CallingCallConnectEventParams;
801
- }
802
- /**
803
- * 'calling.call.send_digits
804
- */
805
- export type CallingCallSendDigitsState = 'finished';
806
- export interface CallingCallSendDigitsEventParams {
807
- node_id: string;
808
- call_id: string;
809
- control_id: string;
810
- state: CallingCallSendDigitsState;
811
- }
812
- export interface CallingCallSendDigitsEvent extends SwEvent {
813
- event_type: ToInternalVoiceEvent<CallSendDigits>;
814
- params: CallingCallSendDigitsEventParams;
815
- }
816
- /**
817
- * 'calling.call.detect'
818
- */
819
- type CallingCallDetectState = 'finished' | 'error';
820
- /** @deprecated */
821
- export type CallingCallDetectEndState = CallingCallDetectState;
822
- interface CallingCallDetectFax {
823
- type: 'fax';
824
- params: {
825
- event: 'CED' | 'CNG' | CallingCallDetectState;
826
- };
827
- }
828
- interface CallingCallDetectMachine {
829
- type: 'machine';
830
- params: {
831
- beep: boolean;
832
- event: 'MACHINE' | 'HUMAN' | 'UNKNOWN' | 'READY' | 'NOT_READY' | CallingCallDetectState;
833
- };
834
- }
835
- interface CallingCallDetectDigit {
836
- type: 'digit';
837
- params: {
838
- event: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '#' | '*' | CallingCallDetectState;
839
- };
840
- }
841
- export type Detector = CallingCallDetectFax | CallingCallDetectMachine | CallingCallDetectDigit;
842
- export type DetectorResult = Detector['params']['event'];
843
- export type CallingCallDetectType = Detector['type'];
844
- export interface CallingCallDetectEventParams {
845
- node_id: string;
846
- call_id: string;
847
- control_id: string;
848
- detect?: Detector;
849
- waitForBeep?: any;
850
- }
851
- export interface CallingCallDetectEvent extends SwEvent {
852
- event_type: ToInternalVoiceEvent<CallDetect>;
853
- params: CallingCallDetectEventParams;
854
- }
855
- /**
856
- * ==========
857
- * ==========
858
- * SDK-Side Events
859
- * ==========
860
- * ==========
861
- */
862
- /**
863
- * 'calling.playback.started'
864
- */
865
- export interface CallPlaybackStartedEvent extends SwEvent {
866
- event_type: ToInternalVoiceEvent<CallPlaybackStarted>;
867
- params: CallingCallPlayEventParams & {
868
- tag: string;
869
- };
870
- }
871
- /**
872
- * 'calling.playback.updated'
873
- */
874
- export interface CallPlaybackUpdatedEvent extends SwEvent {
875
- event_type: ToInternalVoiceEvent<CallPlaybackUpdated>;
876
- params: CallingCallPlayEventParams & {
877
- tag: string;
878
- };
879
- }
880
- /**
881
- * 'calling.playback.ended'
882
- */
883
- export interface CallPlaybackEndedEvent extends SwEvent {
884
- event_type: ToInternalVoiceEvent<CallPlaybackEnded>;
885
- params: CallingCallPlayEventParams & {
886
- tag: string;
887
- };
888
- }
889
- /**
890
- * 'calling.playback.failed'
891
- */
892
- export interface CallPlaybackFailedEvent extends SwEvent {
893
- event_type: ToInternalVoiceEvent<CallPlaybackFailed>;
894
- params: CallingCallPlayEventParams & {
895
- tag: string;
896
- };
897
- }
898
- /**
899
- * 'calling.call.received'
900
- */
901
- export interface CallReceivedEvent extends SwEvent {
902
- event_type: ToInternalVoiceEvent<CallReceived>;
903
- params: CallingCallReceiveEventParams;
904
- }
905
- /**
906
- * 'calling.recording.started'
907
- */
908
- export interface CallRecordingStartedEvent extends SwEvent {
909
- event_type: ToInternalVoiceEvent<CallRecordingStarted>;
910
- params: CallingCallRecordEventParams & {
911
- tag: string;
912
- };
913
- }
914
- /**
915
- * 'calling.recording.updated'
916
- */
917
- export interface CallRecordingUpdatedEvent extends SwEvent {
918
- event_type: ToInternalVoiceEvent<CallRecordingUpdated>;
919
- params: CallingCallRecordEventParams & {
920
- tag: string;
921
- };
922
- }
923
- /**
924
- * 'calling.recording.ended'
925
- */
926
- export interface CallRecordingEndedEvent extends SwEvent {
927
- event_type: ToInternalVoiceEvent<CallRecordingEnded>;
928
- params: CallingCallRecordEventParams & {
929
- tag: string;
930
- };
931
- }
932
- /**
933
- * 'calling.recording.failed'
934
- */
935
- export interface CallRecordingFailedEvent extends SwEvent {
936
- event_type: ToInternalVoiceEvent<CallRecordingFailed>;
937
- params: CallingCallRecordEventParams & {
938
- tag: string;
939
- };
940
- }
941
- /**
942
- * 'calling.prompt.started'
943
- */
944
- export interface CallPromptStartedEvent extends SwEvent {
945
- event_type: ToInternalVoiceEvent<CallPromptStarted>;
946
- params: CallingCallCollectEventParams & {
947
- tag: string;
948
- };
949
- }
950
- /**
951
- * 'calling.prompt.startOfInput'
952
- * Different from `started` because it's from the server
953
- */
954
- export interface CallPromptStartOfInputEvent extends SwEvent {
955
- event_type: ToInternalVoiceEvent<CallPromptStartOfInput>;
956
- params: CallingCallCollectEventParams & {
957
- tag: string;
958
- };
959
- }
960
- /**
961
- * 'calling.prompt.updated'
962
- */
963
- export interface CallPromptUpdatedEvent extends SwEvent {
964
- event_type: ToInternalVoiceEvent<CallPromptUpdated>;
965
- params: CallingCallCollectEventParams & {
966
- tag: string;
967
- };
968
- }
969
- /**
970
- * 'calling.prompt.ended'
971
- */
972
- export interface CallPromptEndedEvent extends SwEvent {
973
- event_type: ToInternalVoiceEvent<CallPromptEnded>;
974
- params: CallingCallCollectEventParams & {
975
- tag: string;
976
- };
977
- }
978
- /**
979
- * 'calling.prompt.failed'
980
- */
981
- export interface CallPromptFailedEvent extends SwEvent {
982
- event_type: ToInternalVoiceEvent<CallPromptFailed>;
983
- params: CallingCallCollectEventParams & {
984
- tag: string;
985
- };
986
- }
987
- /**
988
- * 'calling.tap.started'
989
- */
990
- export interface CallTapStartedEvent extends SwEvent {
991
- event_type: ToInternalVoiceEvent<CallTapStarted>;
992
- params: CallingCallTapEventParams & {
993
- tag: string;
994
- };
995
- }
996
- /**
997
- * 'calling.tap.ended'
998
- */
999
- export interface CallTapEndedEvent extends SwEvent {
1000
- event_type: ToInternalVoiceEvent<CallTapEnded>;
1001
- params: CallingCallTapEventParams & {
1002
- tag: string;
1003
- };
1004
- }
1005
- /**
1006
- * 'calling.connect.connecting'
1007
- */
1008
- export interface CallConnectConnectingEvent extends SwEvent {
1009
- event_type: ToInternalVoiceEvent<CallConnectConnecting>;
1010
- params: CallingCallConnectEventParams;
1011
- }
1012
- /**
1013
- * 'calling.connect.connected'
1014
- */
1015
- export interface CallConnectConnectedEvent extends SwEvent {
1016
- event_type: ToInternalVoiceEvent<CallConnectConnected>;
1017
- params: CallingCallConnectEventParams;
1018
- }
1019
- /**
1020
- * 'calling.connect.disconnected'
1021
- */
1022
- export interface CallConnectDisconnectedEvent extends SwEvent {
1023
- event_type: ToInternalVoiceEvent<CallConnectDisconnected>;
1024
- params: CallingCallConnectEventParams;
1025
- }
1026
- /**
1027
- * 'calling.connect.failed'
1028
- */
1029
- export interface CallConnectFailedEvent extends SwEvent {
1030
- event_type: ToInternalVoiceEvent<CallConnectFailed>;
1031
- params: CallingCallConnectEventParams;
1032
- }
1033
- /**
1034
- * 'calling.detect.started'
1035
- */
1036
- export interface CallDetectStartedEvent extends SwEvent {
1037
- event_type: ToInternalVoiceEvent<CallDetectStarted>;
1038
- params: CallingCallDetectEventParams & {
1039
- tag: string;
1040
- };
1041
- }
1042
- /**
1043
- * 'calling.detect.updated'
1044
- */
1045
- export interface CallDetectUpdatedEvent extends SwEvent {
1046
- event_type: ToInternalVoiceEvent<CallDetectUpdated>;
1047
- params: CallingCallDetectEventParams & {
1048
- tag: string;
1049
- };
1050
- }
1051
- /**
1052
- * 'calling.detect.ended'
1053
- */
1054
- export interface CallDetectEndedEvent extends SwEvent {
1055
- event_type: ToInternalVoiceEvent<CallDetectEnded>;
1056
- params: CallingCallDetectEventParams & {
1057
- tag: string;
1058
- };
1059
- }
1060
- /**
1061
- * 'calling.collect.started'
1062
- */
1063
- export interface CallCollectStartedEvent extends SwEvent {
1064
- event_type: ToInternalVoiceEvent<CallCollectStarted>;
1065
- params: CallingCallCollectEventParams & {
1066
- tag: string;
1067
- };
1068
- }
1069
- /**
1070
- * 'calling.collect.startOfInput'
1071
- * Different from `started` because it's from the server
1072
- */
1073
- export interface CallCollectStartOfInputEvent extends SwEvent {
1074
- event_type: ToInternalVoiceEvent<CallCollectStartOfInput>;
1075
- params: CallingCallCollectEventParams & {
1076
- tag: string;
1077
- };
1078
- }
1079
- /**
1080
- * 'calling.collect.updated'
1081
- */
1082
- export interface CallCollectUpdatedEvent extends SwEvent {
1083
- event_type: ToInternalVoiceEvent<CallCollectUpdated>;
1084
- params: CallingCallCollectEventParams & {
1085
- tag: string;
1086
- };
1087
- }
1088
- /**
1089
- * 'calling.collect.ended'
1090
- */
1091
- export interface CallCollectEndedEvent extends SwEvent {
1092
- event_type: ToInternalVoiceEvent<CallCollectEnded>;
1093
- params: CallingCallCollectEventParams & {
1094
- tag: string;
1095
- };
1096
- }
1097
- /**
1098
- * 'calling.collect.failed'
1099
- */
1100
- export interface CallCollectFailedEvent extends SwEvent {
1101
- event_type: ToInternalVoiceEvent<CallCollectFailed>;
1102
- params: CallingCallCollectEventParams & {
1103
- tag: string;
1104
- };
1105
- }
1106
- export type VoiceCallEvent = CallingCallDialEvent | CallingCallStateEvent | CallingCallReceiveEvent | CallingCallPlayEvent | CallingCallRecordEvent | CallingCallCollectEvent | CallingCallTapEvent | CallingCallConnectEvent | CallingCallSendDigitsEvent | CallingCallDetectEvent | CallReceivedEvent | CallPlaybackStartedEvent | CallPlaybackUpdatedEvent | CallPlaybackEndedEvent | CallPlaybackFailedEvent | CallRecordingStartedEvent | CallRecordingUpdatedEvent | CallRecordingEndedEvent | CallRecordingFailedEvent | CallPromptStartedEvent | CallPromptStartOfInputEvent | CallPromptUpdatedEvent | CallPromptEndedEvent | CallPromptFailedEvent | CallTapStartedEvent | CallTapEndedEvent | CallConnectConnectingEvent | CallConnectConnectedEvent | CallConnectDisconnectedEvent | CallConnectFailedEvent | CallDetectStartedEvent | CallDetectUpdatedEvent | CallDetectEndedEvent | CallCollectStartedEvent | CallCollectStartOfInputEvent | CallCollectUpdatedEvent | CallCollectEndedEvent | CallCollectFailedEvent;
1107
- export type VoiceCallEventParams = CallingCallDialEventParams | CallingCallStateEventParams | CallingCallReceiveEventParams | CallingCallPlayEventParams | CallingCallRecordEventParams | CallingCallCollectEventParams | CallingCallTapEventParams | CallingCallConnectEventParams | CallingCallSendDigitsEventParams | CallingCallDetectEventParams | CallReceivedEvent['params'] | CallPlaybackStartedEvent['params'] | CallPlaybackUpdatedEvent['params'] | CallPlaybackEndedEvent['params'] | CallPlaybackFailedEvent['params'] | CallRecordingStartedEvent['params'] | CallRecordingUpdatedEvent['params'] | CallRecordingEndedEvent['params'] | CallRecordingFailedEvent['params'] | CallPromptStartedEvent['params'] | CallPromptStartOfInputEvent['params'] | CallPromptUpdatedEvent['params'] | CallPromptEndedEvent['params'] | CallPromptFailedEvent['params'] | CallTapStartedEvent['params'] | CallTapEndedEvent['params'] | CallConnectConnectingEvent['params'] | CallConnectConnectedEvent['params'] | CallConnectDisconnectedEvent['params'] | CallConnectFailedEvent['params'] | CallDetectStartedEvent['params'] | CallDetectUpdatedEvent['params'] | CallDetectEndedEvent['params'] | CallCollectStartedEvent['params'] | CallCollectStartOfInputEvent['params'] | CallCollectUpdatedEvent['params'] | CallCollectEndedEvent['params'] | CallCollectFailedEvent['params'];
246
+ export type VoiceCallEvent = VoiceCallPlaybackEvent | VoiceCallRecordingEvent | VoiceCallDetectEvent | VoiceCallTapEvent | VoiceCallCollectEvent | VoiceCallPromptEvent | VoiceCallSendDigitsEvent | VoiceCallConnectEvent | CallingCallDialEvent | CallingCallStateEvent | CallingCallReceiveEvent | VoiceCallReceivedEvent;
247
+ export type VoiceCallEventParams = VoiceCallPlaybackEventParams | VoiceCallRecordingEventParams | VoiceCallDetectEventParams | VoiceCallTapEventParams | VoiceCallCollectEventParams | VoiceCallPromptEventParams | VoiceCallSendDigitsEventParams | VoiceCallConnectEventParams | CallingCallDialEventParams | CallingCallStateEventParams | CallingCallReceiveEventParams | VoiceCallReceivedEvent['params'];
1108
248
  export type VoiceCallAction = MapToPubSubShape<VoiceCallEvent>;
1109
249
  export type VoiceCallReceiveAction = MapToPubSubShape<CallingCallReceiveEvent>;
1110
250
  export type VoiceCallStateAction = MapToPubSubShape<CallingCallStateEvent>;
1111
251
  export type VoiceCallDialAction = MapToPubSubShape<CallingCallDialEvent>;
1112
- export type VoiceCallPlayAction = MapToPubSubShape<CallingCallPlayEvent>;
1113
- export type VoiceCallRecordAction = MapToPubSubShape<CallingCallRecordEvent>;
1114
- export type VoiceCallCollectAction = MapToPubSubShape<CallingCallCollectEvent>;
1115
- export type VoiceCallSendDigitsAction = MapToPubSubShape<CallingCallSendDigitsEvent>;
1116
- export type VoiceCallTapAction = MapToPubSubShape<CallingCallTapEvent>;
1117
- export type VoiceCallDetectAction = MapToPubSubShape<CallingCallDetectEvent>;
1118
- export type VoiceCallConnectAction = MapToPubSubShape<CallingCallConnectEvent>;
1119
- export type VoiceCallJSONRPCMethod = 'calling.dial' | 'calling.end' | 'calling.pass' | 'calling.answer' | 'calling.play' | 'calling.play.pause' | 'calling.play.resume' | 'calling.play.volume' | 'calling.play.stop' | 'calling.record' | 'calling.record.pause' | 'calling.record.resume' | 'calling.record.stop' | 'calling.play_and_collect' | 'calling.play_and_collect.stop' | 'calling.play_and_collect.volume' | 'calling.tap' | 'calling.tap.stop' | 'calling.connect' | 'calling.disconnect' | 'calling.send_digits' | 'calling.detect' | 'calling.detect.stop' | 'calling.collect' | 'calling.collect.stop' | 'calling.collect.start_input_timers';
1120
252
  export {};
1121
253
  //# sourceMappingURL=voiceCall.d.ts.map