1+ import type { ChannelInstance } from "../resources/channels" ;
2+ import type { PlaybackInstance , Playbacks } from "../resources/playbacks" ;
3+ import type { Channel } from "./channels.types" ;
4+ import type { Playback } from "./playbacks.types" ;
5+ export type ChannelEvent = Extract < WebSocketEvent , {
6+ channel : Channel ;
7+ } > ;
8+ export type PlaybackEvent = Extract < WebSocketEvent , {
9+ playback : Playback ;
10+ } > ;
11+ export type WebSocketEventType = "DeviceStateChanged" | "PlaybackStarted" | "PlaybackContinuing" | "PlaybackFinished" | "RecordingStarted" | "RecordingFinished" | "RecordingFailed" | "ApplicationMoveFailed" | "ApplicationReplaced" | "BridgeCreated" | "BridgeDestroyed" | "BridgeMerged" | "BridgeBlindTransfer" | "BridgeAttendedTransfer" | "BridgeVideoSourceChanged" | "ChannelCreated" | "ChannelDestroyed" | "ChannelEnteredBridge" | "ChannelLeftBridge" | "ChannelStateChange" | "ChannelDtmfReceived" | "ChannelDialplan" | "ChannelCallerId" | "ChannelUserevent" | "ChannelHangupRequest" | "ChannelVarset" | "ChannelTalkingStarted" | "ChannelTalkingFinished" | "ChannelHold" | "ChannelUnhold" | "ContactStatusChange" | "EndpointStateChange" | "Dial" | "StasisEnd" | "StasisStart" | "TextMessageReceived" | "ChannelConnectedLine" | "PeerStatusChange" ;
12+ export type WebSocketEvent = {
13+ type : "ChannelDtmfReceived" ;
14+ digit : string ;
15+ duration_ms : number ;
16+ channel : Channel ;
17+ instanceChannel ?: ChannelInstance ;
18+ application : string ;
19+ } | {
20+ type : "ChannelDialplan" ;
21+ channel : Channel ;
22+ instanceChannel ?: ChannelInstance ;
23+ dialplan_app : string ;
24+ dialplan_app_data : string ;
25+ application : string ;
26+ } | {
27+ type : "ChannelVarset" ;
28+ variable : string ;
29+ value : string ;
30+ channel ?: Channel ;
31+ application : string ;
32+ instanceChannel ?: ChannelInstance ;
33+ } | {
34+ type : "StasisStart" ;
35+ args : string [ ] ;
36+ channel : Channel ;
37+ instanceChannel ?: ChannelInstance ;
38+ replace_channel ?: Channel ;
39+ application : string ;
40+ } | {
41+ type : "PlaybackStarted" ;
42+ playback : Playbacks ;
43+ asterisk_id : string ;
44+ application : string ;
45+ instancePlayback ?: PlaybackInstance ;
46+ } | {
47+ type : "PlaybackContinuing" ;
48+ playback : Playbacks ;
49+ playbackId : string ;
50+ asterisk_id : string ;
51+ application : string ;
52+ instancePlayback ?: PlaybackInstance ;
53+ } | {
54+ type : "PlaybackFinished" ;
55+ playback : Playbacks ;
56+ playbackId : string ;
57+ asterisk_id : string ;
58+ application : string ;
59+ instancePlayback ?: PlaybackInstance ;
60+ } | {
61+ type : "BridgeCreated" ;
62+ bridgeId : string ;
63+ bridgeType : string ;
64+ channels : Channel [ ] ;
65+ application : string ;
66+ } | {
67+ type : "BridgeDestroyed" ;
68+ bridgeId : string ;
69+ application : string ;
70+ } | {
71+ type : "ChannelCreated" ;
72+ channel : Channel ;
73+ instanceChannel ?: ChannelInstance ;
74+ application : string ;
75+ } | {
76+ type : "ChannelDestroyed" ;
77+ channel : Channel ;
78+ instanceChannel ?: ChannelInstance ;
79+ application : string ;
80+ } | {
81+ type : "ApplicationMoveFailed" ;
82+ application : string ;
83+ channel : Channel ;
84+ instanceChannel ?: ChannelInstance ;
85+ } | {
86+ type : "RecordingStarted" ;
87+ recordingId : string ;
88+ name : string ;
89+ application : string ;
90+ } | {
91+ type : "RecordingFinished" ;
92+ recordingId : string ;
93+ name : string ;
94+ application : string ;
95+ } | {
96+ type : "RecordingFailed" ;
97+ recordingId : string ;
98+ name : string ;
99+ reason : string ;
100+ application : string ;
101+ } | {
102+ type : "DeviceStateChanged" ;
103+ device : string ;
104+ state : string ;
105+ application : string ;
106+ } | {
107+ type : "BridgeMerged" ;
108+ bridgeId : string ;
109+ bridges : string [ ] ;
110+ application : string ;
111+ } | {
112+ type : "BridgeBlindTransfer" ;
113+ bridgeId : string ;
114+ channel : Channel ;
115+ instanceChannel ?: ChannelInstance ;
116+ transferee : Channel ;
117+ application : string ;
118+ } | {
119+ type : "BridgeAttendedTransfer" ;
120+ bridgeId : string ;
121+ transferer : Channel ;
122+ transferee : Channel ;
123+ destination : Channel ;
124+ application : string ;
125+ } | {
126+ type : "BridgeVideoSourceChanged" ;
127+ bridgeId : string ;
128+ old_video_source_id ?: string ;
129+ new_video_source_id : string ;
130+ application : string ;
131+ } | {
132+ type : "ChannelEnteredBridge" ;
133+ bridgeId : string ;
134+ channel : Channel ;
135+ instanceChannel ?: ChannelInstance ;
136+ application : string ;
137+ } | {
138+ type : "ChannelLeftBridge" ;
139+ bridgeId : string ;
140+ channel : Channel ;
141+ instanceChannel ?: ChannelInstance ;
142+ application : string ;
143+ } | {
144+ type : "ChannelStateChange" ;
145+ channel : Channel ;
146+ instanceChannel ?: ChannelInstance ;
147+ application : string ;
148+ } | {
149+ type : "ChannelTalkingStarted" ;
150+ channel : Channel ;
151+ instanceChannel ?: ChannelInstance ;
152+ application : string ;
153+ } | {
154+ type : "ChannelTalkingFinished" ;
155+ channel : Channel ;
156+ instanceChannel ?: ChannelInstance ;
157+ application : string ;
158+ } | {
159+ type : "ChannelUnhold" ;
160+ channel : Channel ;
161+ instanceChannel ?: ChannelInstance ;
162+ application : string ;
163+ } | {
164+ type : "ChannelHold" ;
165+ channel : Channel ;
166+ instanceChannel ?: ChannelInstance ;
167+ application : string ;
168+ } | {
169+ type : "ContactStatusChange" ;
170+ contact_info : Record < string , any > ;
171+ status : string ;
172+ aor ?: string ;
173+ application : string ;
174+ } | {
175+ type : "EndpointStateChange" ;
176+ endpoint : Record < string , any > ;
177+ state : string ;
178+ application : string ;
179+ } | {
180+ type : "Dial" ;
181+ caller : Channel ;
182+ peer : Channel ;
183+ dialstring ?: string ;
184+ application : string ;
185+ } | {
186+ type : "StasisEnd" ;
187+ channel : Channel ;
188+ instanceChannel ?: ChannelInstance ;
189+ application : string ;
190+ } | {
191+ type : "TextMessageReceived" ;
192+ to : string ;
193+ from : string ;
194+ body : string ;
195+ variables ?: Record < string , any > ;
196+ application : string ;
197+ } | {
198+ type : "ChannelConnectedLine" ;
199+ channel : Channel ;
200+ instanceChannel ?: ChannelInstance ;
201+ application : string ;
202+ } | {
203+ type : "ChannelHangupRequest" ;
204+ cause : number ;
205+ soft : boolean ;
206+ channel : Channel ;
207+ instanceChannel ?: ChannelInstance ;
208+ application : string ;
209+ } | {
210+ type : "PeerStatusChange" ;
211+ peer : string ;
212+ peer_status : string ;
213+ application : string ;
214+ } | {
215+ type : string ;
216+ [ key : string ] : any ;
217+ } ;
218+ //# sourceMappingURL=events.types.d.ts.map
0 commit comments