@ipcom/asterisk-ari 0.0.42 → 0.0.44
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/index.cjs +176 -577
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/esm/index.js +176 -577
- package/dist/esm/index.js.map +4 -4
- package/dist/types/ari-client/ariClient.d.ts +21 -182
- package/dist/types/ari-client/ariClient.d.ts.map +1 -1
- package/dist/types/ari-client/resources/baseResource.d.ts +31 -0
- package/dist/types/ari-client/resources/baseResource.d.ts.map +1 -0
- package/dist/types/ari-client/resources/channels.d.ts +32 -178
- package/dist/types/ari-client/resources/channels.d.ts.map +1 -1
- package/dist/types/ari-client/utils.d.ts +2 -0
- package/dist/types/ari-client/utils.d.ts.map +1 -0
- package/dist/types/ari-client/websocketClient.d.ts +2 -0
- package/dist/types/ari-client/websocketClient.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { Application, ApplicationDetails,
|
|
1
|
+
import type { Application, ApplicationDetails, WebSocketEventType } from "./interfaces";
|
|
2
2
|
import type { AsteriskInfo, Logging, Module, Variable } from "./interfaces";
|
|
3
|
-
import type { Channel,
|
|
3
|
+
import type { Channel, ChannelVar, ExternalMediaOptions, OriginateRequest, RTPStats, RecordingOptions, SnoopOptions } from "./interfaces";
|
|
4
4
|
import type { Endpoint, EndpointDetails } from "./interfaces";
|
|
5
5
|
import type { WebSocketEvent } from "./interfaces";
|
|
6
6
|
import type { AriClientConfig } from "./interfaces";
|
|
7
7
|
import type { Sound, SoundListRequest } from "./interfaces";
|
|
8
|
-
import type { GlobalEvent } from "./interfaces/events.types";
|
|
9
8
|
import type { Playback as APIPlayback, PlaybackControlRequest } from "./interfaces/playbacks.types";
|
|
10
9
|
import { Applications } from "./resources/applications.js";
|
|
11
10
|
import { Asterisk } from "./resources/asterisk";
|
|
@@ -16,14 +15,13 @@ import { type PlaybackInstance, Playbacks } from "./resources/playbacks";
|
|
|
16
15
|
import { Sounds } from "./resources/sounds";
|
|
17
16
|
export declare class AriClient {
|
|
18
17
|
private config;
|
|
18
|
+
private eventListeners;
|
|
19
19
|
private wsClient;
|
|
20
|
-
private readonly channelEmitters;
|
|
21
20
|
private readonly baseClient;
|
|
22
21
|
private isReconnecting;
|
|
23
|
-
private readonly eventEmitter;
|
|
24
|
-
private wsConnections;
|
|
25
22
|
private isWebSocketConnectedFlag;
|
|
26
23
|
private webSocketReady;
|
|
24
|
+
private channelInstances;
|
|
27
25
|
private pendingListeners;
|
|
28
26
|
private processPendingListeners;
|
|
29
27
|
channels: Channels;
|
|
@@ -34,6 +32,23 @@ export declare class AriClient {
|
|
|
34
32
|
asterisk: Asterisk;
|
|
35
33
|
bridges: Bridges;
|
|
36
34
|
constructor(config: AriClientConfig);
|
|
35
|
+
/**
|
|
36
|
+
* Registra um listener para eventos globais de WebSocket.
|
|
37
|
+
*/
|
|
38
|
+
on<T extends WebSocketEvent["type"]>(eventType: T, callback: (data: Extract<WebSocketEvent, {
|
|
39
|
+
type: T;
|
|
40
|
+
}>) => void): void;
|
|
41
|
+
/**
|
|
42
|
+
* Type guard to check if the given data object contains a valid channel property.
|
|
43
|
+
* This function is used to narrow down the type of the data object and ensure it has a channel with an id.
|
|
44
|
+
*
|
|
45
|
+
* @param data - The object to be checked for the presence of a channel property.
|
|
46
|
+
* @returns A type predicate indicating whether the data object contains a valid channel.
|
|
47
|
+
* Returns true if the data object has a channel property with an id, false otherwise.
|
|
48
|
+
*/
|
|
49
|
+
private hasChannel;
|
|
50
|
+
private createChannelInstance;
|
|
51
|
+
private handleWebSocketEvent;
|
|
37
52
|
/**
|
|
38
53
|
* Connects to the ARI WebSocket for a specific application.
|
|
39
54
|
* This function establishes a WebSocket connection to the Asterisk ARI, sets up event listeners,
|
|
@@ -50,63 +65,6 @@ export declare class AriClient {
|
|
|
50
65
|
* Integrates WebSocket events with playback listeners.
|
|
51
66
|
*/
|
|
52
67
|
private integrateWebSocketEvents;
|
|
53
|
-
/**
|
|
54
|
-
* Registra um listener para eventos globais.
|
|
55
|
-
* @param eventType
|
|
56
|
-
* @param callback - A função a ser executada quando um evento global for recebido.
|
|
57
|
-
*/
|
|
58
|
-
onGlobalEvent<T extends GlobalEvent["type"]>(eventType: T, callback: (data: Extract<GlobalEvent, {
|
|
59
|
-
type: T;
|
|
60
|
-
}>) => void): void;
|
|
61
|
-
/**
|
|
62
|
-
* Remove um listener para eventos globais.
|
|
63
|
-
* @param callback - A função a ser removida dos eventos globais.
|
|
64
|
-
*/
|
|
65
|
-
offGlobalEvent(callback: (data: WebSocketEvent) => void): void;
|
|
66
|
-
/**
|
|
67
|
-
* Emite um evento global.
|
|
68
|
-
* @param data - Os dados do evento a serem emitidos.
|
|
69
|
-
*/
|
|
70
|
-
emitGlobalEvent(data: WebSocketEvent): void;
|
|
71
|
-
/**
|
|
72
|
-
* Unregisters a listener for playback events.
|
|
73
|
-
*
|
|
74
|
-
* This method removes a specific listener registered for a playback event type,
|
|
75
|
-
* ensuring that no further notifications are sent to the callback function.
|
|
76
|
-
*
|
|
77
|
-
* @param eventType - The type of event to stop listening for.
|
|
78
|
-
* @param playbackId - The unique ID of the playback associated with the listener.
|
|
79
|
-
* @param callback - The callback function to remove from the listener.
|
|
80
|
-
*/
|
|
81
|
-
unregisterPlaybackListener<T extends WebSocketEvent["type"]>(eventType: T, playbackId: string, callback: (data: Extract<WebSocketEvent, {
|
|
82
|
-
type: T;
|
|
83
|
-
}>) => void): void;
|
|
84
|
-
registerListener<E extends ChannelEvent | PlaybackEvent>(eventType: E["type"], condition: (event: E) => boolean, callback: (event: E) => void): void;
|
|
85
|
-
/**
|
|
86
|
-
* Registers a listener for playback events.
|
|
87
|
-
* The listener is triggered for events such as "PlaybackFinished".
|
|
88
|
-
*
|
|
89
|
-
* @param eventType - The type of event to listen for.
|
|
90
|
-
* @param playbackId - The ID of the playback to associate with this listener.
|
|
91
|
-
* @param callback - The callback function to execute when the event occurs.
|
|
92
|
-
*/
|
|
93
|
-
registerPlaybackListener(eventType: "PlaybackStarted" | "PlaybackFinished", playbackId: string, callback: (data: Extract<WebSocketEvent, {
|
|
94
|
-
type: "PlaybackStarted" | "PlaybackFinished";
|
|
95
|
-
}>) => void): void;
|
|
96
|
-
registerChannelListener<T extends Extract<WebSocketEvent, {
|
|
97
|
-
channel: Channel;
|
|
98
|
-
}>["type"]>(eventType: T, channelId: string, callback: (data: Extract<WebSocketEvent, {
|
|
99
|
-
type: T;
|
|
100
|
-
channel: Channel;
|
|
101
|
-
}>) => void): void;
|
|
102
|
-
/**
|
|
103
|
-
* Checks if a listener is already registered for a specific event and playback.
|
|
104
|
-
*
|
|
105
|
-
* @param eventType - The type of event to check.
|
|
106
|
-
* @param playbackId - The playback ID associated with the listener.
|
|
107
|
-
* @returns True if a listener is already registered, false otherwise.
|
|
108
|
-
*/
|
|
109
|
-
isPlaybackListenerRegistered<T extends WebSocketEvent["type"]>(eventType: T, playbackId: string): boolean;
|
|
110
68
|
/**
|
|
111
69
|
* Ensures the ARI application is registered.
|
|
112
70
|
*
|
|
@@ -120,53 +78,6 @@ export declare class AriClient {
|
|
|
120
78
|
* @returns {boolean} True if connected, false otherwise.
|
|
121
79
|
*/
|
|
122
80
|
isWebSocketConnected(): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Registers a listener for WebSocket events.
|
|
125
|
-
*
|
|
126
|
-
* This function allows you to attach a callback function to a specific WebSocket event type.
|
|
127
|
-
* The callback will be executed whenever an event of the specified type is received.
|
|
128
|
-
*
|
|
129
|
-
* @template T - The type of WebSocket event, extending WebSocketEvent["type"].
|
|
130
|
-
* @param {T} event - The type of WebSocket event to listen for.
|
|
131
|
-
* @param {(data: Extract<WebSocketEvent, { type: T }>) => void} callback - The function to be called when the event is received.
|
|
132
|
-
* The callback receives the event data as its parameter.
|
|
133
|
-
* @throws {Error} Throws an error if the WebSocket client is not connected when this method is called.
|
|
134
|
-
* @returns {void} This function doesn't return a value.
|
|
135
|
-
*/
|
|
136
|
-
onWebSocketEvent<T extends WebSocketEvent["type"]>(event: T, callback: (data: Extract<WebSocketEvent, {
|
|
137
|
-
type: T;
|
|
138
|
-
}>) => void): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
* Removes a specific listener for WebSocket events.
|
|
141
|
-
*
|
|
142
|
-
* This function unregisters a previously registered callback function for a specific WebSocket event type.
|
|
143
|
-
* It's useful for removing event handlers when they are no longer needed or for cleaning up resources.
|
|
144
|
-
*
|
|
145
|
-
* @template T - The type of WebSocket event, extending WebSocketEvent["type"].
|
|
146
|
-
* @param {T} event - The type of WebSocket event to remove the listener from.
|
|
147
|
-
* @param {(data: Extract<WebSocketEvent, { type: T }>) => void} callback - The callback function to be removed.
|
|
148
|
-
* This should be the same function reference that was used when adding the event listener.
|
|
149
|
-
* @throws {Error} Throws an error if the WebSocket client is not connected when this method is called.
|
|
150
|
-
* @returns {void} This function doesn't return a value.
|
|
151
|
-
*/
|
|
152
|
-
offWebSocketEvent<T extends WebSocketEvent["type"]>(event: T, callback: (data: Extract<WebSocketEvent, {
|
|
153
|
-
type: T;
|
|
154
|
-
}>) => void): void;
|
|
155
|
-
/**
|
|
156
|
-
* Removes all listeners for a specific WebSocket event type.
|
|
157
|
-
*
|
|
158
|
-
* This function removes all event listeners that have been registered for a particular
|
|
159
|
-
* WebSocket event type. It's useful for cleaning up event listeners when they are no
|
|
160
|
-
* longer needed or before re-registering new listeners.
|
|
161
|
-
*
|
|
162
|
-
* @param event - The type of WebSocket event for which all listeners should be removed.
|
|
163
|
-
* This should be a string identifying the event type (e.g., 'message', 'close', etc.).
|
|
164
|
-
*
|
|
165
|
-
* @throws {Error} Throws an error if the WebSocket client is not connected when this method is called.
|
|
166
|
-
*
|
|
167
|
-
* @returns {void} This function doesn't return a value.
|
|
168
|
-
*/
|
|
169
|
-
removeAllWebSocketListeners(event: string): void;
|
|
170
81
|
/**
|
|
171
82
|
* Closes the WebSocket connection and removes all associated listeners.
|
|
172
83
|
*
|
|
@@ -178,25 +89,6 @@ export declare class AriClient {
|
|
|
178
89
|
* @returns {void} This function doesn't return a value.
|
|
179
90
|
*/
|
|
180
91
|
closeWebSocket(): void;
|
|
181
|
-
/**
|
|
182
|
-
* Obtém ou cria um emissor de eventos para o canal especificado.
|
|
183
|
-
*/
|
|
184
|
-
private getOrCreateChannelEmitter;
|
|
185
|
-
handleChannelEvent(event: WebSocketEvent): void;
|
|
186
|
-
registerGlobalWebSocketListener(): void;
|
|
187
|
-
/**
|
|
188
|
-
* Adiciona um listener para um evento específico de canal.
|
|
189
|
-
*/
|
|
190
|
-
onChannelEvent<T extends ChannelEvent["type"]>(channelId: string, eventType: T, callback: (data: Extract<ChannelEvent, {
|
|
191
|
-
type: T;
|
|
192
|
-
}>) => void): void;
|
|
193
|
-
removeChannel(channelId: string): void;
|
|
194
|
-
/**
|
|
195
|
-
* Remove um listener para um evento específico de canal.
|
|
196
|
-
*/
|
|
197
|
-
offChannelEvent<T extends WebSocketEvent["type"]>(channelId: string, eventType: T, callback: (data: Extract<WebSocketEvent, {
|
|
198
|
-
type: T;
|
|
199
|
-
}>) => void): void;
|
|
200
92
|
/**
|
|
201
93
|
* Retrieves a list of active channels from the Asterisk ARI.
|
|
202
94
|
*
|
|
@@ -210,14 +102,6 @@ export declare class AriClient {
|
|
|
210
102
|
* Creates a new channel.
|
|
211
103
|
*/
|
|
212
104
|
originateChannel(data: OriginateRequest): Promise<Channel>;
|
|
213
|
-
/**
|
|
214
|
-
* Retrieves details of a specific channel.
|
|
215
|
-
*/
|
|
216
|
-
getChannelDetails(channelId: string): Promise<Channel>;
|
|
217
|
-
/**
|
|
218
|
-
* Hangs up a specific channel.
|
|
219
|
-
*/
|
|
220
|
-
hangupChannel(channelId: string): Promise<void>;
|
|
221
105
|
/**
|
|
222
106
|
* Continues the dialplan for a specific channel.
|
|
223
107
|
*/
|
|
@@ -234,10 +118,6 @@ export declare class AriClient {
|
|
|
234
118
|
* Gets a channel variable.
|
|
235
119
|
*/
|
|
236
120
|
getChannelVariable(channelId: string, variable: string): Promise<ChannelVar>;
|
|
237
|
-
/**
|
|
238
|
-
* Plays a media file to a channel.
|
|
239
|
-
*/
|
|
240
|
-
playMediaToChannel(channelId: string, media: string, options?: PlaybackOptions): Promise<ChannelPlayback>;
|
|
241
121
|
/**
|
|
242
122
|
* Starts music on hold for a channel.
|
|
243
123
|
*/
|
|
@@ -246,30 +126,6 @@ export declare class AriClient {
|
|
|
246
126
|
* Stops music on hold for a channel.
|
|
247
127
|
*/
|
|
248
128
|
stopChannelMusicOnHold(channelId: string): Promise<void>;
|
|
249
|
-
/**
|
|
250
|
-
* Starts playback of a media file on a channel.
|
|
251
|
-
*/
|
|
252
|
-
startChannelPlayback(channelId: string, media: string, options?: PlaybackOptions): Promise<ChannelPlayback>;
|
|
253
|
-
/**
|
|
254
|
-
* Stops playback of a media file on a channel.
|
|
255
|
-
*/
|
|
256
|
-
stopChannelPlayback(channelId: string, playbackId: string): Promise<void>;
|
|
257
|
-
/**
|
|
258
|
-
* Pauses playback of a media file on a channel.
|
|
259
|
-
*/
|
|
260
|
-
pauseChannelPlayback(channelId: string, playbackId: string): Promise<void>;
|
|
261
|
-
/**
|
|
262
|
-
* Resumes playback of a media file on a channel.
|
|
263
|
-
*/
|
|
264
|
-
resumeChannelPlayback(channelId: string, playbackId: string): Promise<void>;
|
|
265
|
-
/**
|
|
266
|
-
* Rewinds playback of a media file on a channel.
|
|
267
|
-
*/
|
|
268
|
-
rewindChannelPlayback(channelId: string, playbackId: string, skipMs: number): Promise<void>;
|
|
269
|
-
/**
|
|
270
|
-
* Fast-forwards playback of a media file on a channel.
|
|
271
|
-
*/
|
|
272
|
-
fastForwardChannelPlayback(channelId: string, playbackId: string, skipMs: number): Promise<void>;
|
|
273
129
|
/**
|
|
274
130
|
* Records audio from a channel.
|
|
275
131
|
*/
|
|
@@ -305,10 +161,6 @@ export declare class AriClient {
|
|
|
305
161
|
* Redirects a channel to a different location.
|
|
306
162
|
*/
|
|
307
163
|
redirectChannel(channelId: string, endpoint: string): Promise<void>;
|
|
308
|
-
/**
|
|
309
|
-
* Answers a channel.
|
|
310
|
-
*/
|
|
311
|
-
answerChannel(channelId: string): Promise<void>;
|
|
312
164
|
/**
|
|
313
165
|
* Sends a ringing indication to a channel.
|
|
314
166
|
*/
|
|
@@ -442,19 +294,6 @@ export declare class AriClient {
|
|
|
442
294
|
* such as invalid parameters or system issues.
|
|
443
295
|
*/
|
|
444
296
|
createChannel(data: OriginateRequest): Promise<Channel>;
|
|
445
|
-
/**
|
|
446
|
-
* Hangs up a specific channel.
|
|
447
|
-
*
|
|
448
|
-
* @param channelId - The unique identifier of the channel to hang up.
|
|
449
|
-
* @param options - Optional parameters for the hangup operation.
|
|
450
|
-
* @param options.reason_code - An optional reason code for the hangup.
|
|
451
|
-
* @param options.reason - An optional textual reason for the hangup.
|
|
452
|
-
* @returns A promise that resolves when the hangup operation is complete.
|
|
453
|
-
*/
|
|
454
|
-
hangup(channelId: string, options?: {
|
|
455
|
-
reason_code?: string;
|
|
456
|
-
reason?: string;
|
|
457
|
-
}): Promise<void>;
|
|
458
297
|
/**
|
|
459
298
|
* Originates a new channel with a specified ID using the provided originate request data.
|
|
460
299
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ariClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/ariClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ariClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/ariClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,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AAO,EAAE,CAAC;IAI/C;;;;;;;;;OASG;IACG,gBAAgB,CACpB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,KAAK,GAAG,QAAQ,EACxB,aAAa,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACxD,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;;OAKG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIhE;;;;;;;;;;;;;;;;OAgBG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;;;;OAKG;IACH,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe;IAI5C;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB;CAGhD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AriClient } from "../ariClient";
|
|
2
|
+
export declare abstract class BaseResource {
|
|
3
|
+
protected readonly client: AriClient;
|
|
4
|
+
private readonly emitter;
|
|
5
|
+
private readonly resourceId;
|
|
6
|
+
constructor(client: AriClient, resourceId: string);
|
|
7
|
+
/**
|
|
8
|
+
* Registra um listener para eventos do recurso.
|
|
9
|
+
* @param event O tipo de evento a escutar.
|
|
10
|
+
* @param callback Função callback a ser chamada quando o evento ocorre.
|
|
11
|
+
*/
|
|
12
|
+
on<T extends string>(event: T, callback: (data: any) => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* Remove um listener para eventos do recurso.
|
|
15
|
+
* @param event O tipo de evento.
|
|
16
|
+
* @param callback Função callback a ser removida.
|
|
17
|
+
*/
|
|
18
|
+
removeListener<T extends string>(event: T, callback: (data: any) => void): void;
|
|
19
|
+
/**
|
|
20
|
+
* Remove todos os listeners de um tipo de evento.
|
|
21
|
+
* @param event O tipo de evento.
|
|
22
|
+
*/
|
|
23
|
+
removeAllListeners<T extends string>(event: T): void;
|
|
24
|
+
/**
|
|
25
|
+
* Emite um evento específico para este recurso.
|
|
26
|
+
* @param event O tipo de evento.
|
|
27
|
+
* @param data Os dados associados ao evento.
|
|
28
|
+
*/
|
|
29
|
+
emit<T extends string>(event: T, data: any): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=baseResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseResource.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/resources/baseResource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM;IAMjD;;;;OAIG;IACI,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAI1E;;;;OAIG;IACI,cAAc,CAAC,CAAC,SAAS,MAAM,EACpC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAC5B,IAAI;IAIP;;;OAGG;IACI,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI3D;;;;OAIG;IACI,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI;CAGzD"}
|
|
@@ -1,35 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
2
|
import type { AriClient } from "../ariClient";
|
|
3
3
|
import type { BaseClient } from "../baseClient.js";
|
|
4
|
-
import type { Channel, ChannelPlayback, ChannelVar, ExternalMediaOptions, OriginateRequest, PlaybackOptions, RTPStats, RecordingOptions, SnoopOptions
|
|
4
|
+
import type { Channel, ChannelPlayback, ChannelVar, ExternalMediaOptions, OriginateRequest, PlaybackOptions, RTPStats, RecordingOptions, SnoopOptions } from "../interfaces";
|
|
5
5
|
import type { PlaybackInstance } from "./playbacks";
|
|
6
|
-
export declare class ChannelEventEmitter {
|
|
7
|
-
private readonly eventEmitter;
|
|
8
|
-
readonly channel: Channel;
|
|
9
|
-
constructor(channel: Channel);
|
|
10
|
-
/**
|
|
11
|
-
* Registra um listener para um evento no canal.
|
|
12
|
-
*/
|
|
13
|
-
on<T extends WebSocketEvent["type"]>(eventType: T, callback: (data: Extract<WebSocketEvent, {
|
|
14
|
-
type: T;
|
|
15
|
-
}>) => void): void;
|
|
16
|
-
/**
|
|
17
|
-
* Emite um evento no canal.
|
|
18
|
-
*/
|
|
19
|
-
emit<T extends WebSocketEvent["type"]>(eventType: T, data: Extract<WebSocketEvent, {
|
|
20
|
-
type: T;
|
|
21
|
-
}>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Remove um listener de evento do canal.
|
|
24
|
-
*/
|
|
25
|
-
off<T extends WebSocketEvent["type"]>(eventType: T, callback: (data: Extract<WebSocketEvent, {
|
|
26
|
-
type: T;
|
|
27
|
-
}>) => void): void;
|
|
28
|
-
/**
|
|
29
|
-
* Remove todos os listeners de um evento no canal.
|
|
30
|
-
*/
|
|
31
|
-
removeAllListeners(eventType?: string): void;
|
|
32
|
-
}
|
|
33
6
|
export declare class ChannelInstance extends EventEmitter {
|
|
34
7
|
private client;
|
|
35
8
|
private baseClient;
|
|
@@ -38,7 +11,6 @@ export declare class ChannelInstance extends EventEmitter {
|
|
|
38
11
|
constructor(client: AriClient, baseClient: BaseClient, channelId?: string);
|
|
39
12
|
/**
|
|
40
13
|
* Getter para o ID do canal.
|
|
41
|
-
* Sempre retorna um ID, seja o definido manualmente ou o gerado automaticamente.
|
|
42
14
|
*/
|
|
43
15
|
get id(): string;
|
|
44
16
|
/**
|
|
@@ -54,89 +26,66 @@ export declare class ChannelInstance extends EventEmitter {
|
|
|
54
26
|
*/
|
|
55
27
|
hangup(): Promise<void>;
|
|
56
28
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @param options - Opções para o playback, incluindo mídia e idioma.
|
|
60
|
-
* @param playback - (Opcional) Uma instância de `PlaybackInstance` para gerenciar o playback. Se não fornecido, será criada uma nova.
|
|
61
|
-
* @returns Uma instância de `PlaybackInstance` associada ao playback.
|
|
29
|
+
* Reproduz mídia no canal.
|
|
62
30
|
*/
|
|
63
31
|
play(options: {
|
|
64
32
|
media: string;
|
|
65
33
|
lang?: string;
|
|
66
34
|
}, playback?: PlaybackInstance): Promise<PlaybackInstance>;
|
|
67
35
|
/**
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
on<T extends WebSocketEvent["type"]>(event: T, callback: (data: Extract<WebSocketEvent, {
|
|
71
|
-
type: T;
|
|
72
|
-
}>) => void): this;
|
|
73
|
-
/**
|
|
74
|
-
* Adiciona um listener para ser chamado apenas uma vez.
|
|
36
|
+
* Reproduz mídia em um canal.
|
|
75
37
|
*/
|
|
76
|
-
|
|
77
|
-
type: T;
|
|
78
|
-
}>) => void): this;
|
|
38
|
+
playMedia(media: string, options?: PlaybackOptions): Promise<ChannelPlayback>;
|
|
79
39
|
/**
|
|
80
|
-
*
|
|
40
|
+
* Para a reprodução de mídia.
|
|
81
41
|
*/
|
|
82
|
-
|
|
83
|
-
type: T;
|
|
84
|
-
}>) => void): this;
|
|
85
|
-
}
|
|
86
|
-
export declare class Channels extends EventEmitter {
|
|
87
|
-
private baseClient;
|
|
88
|
-
private client;
|
|
89
|
-
private channelId?;
|
|
90
|
-
constructor(baseClient: BaseClient, client: AriClient, channelId?: string | undefined);
|
|
42
|
+
stopPlayback(playbackId: string): Promise<void>;
|
|
91
43
|
/**
|
|
92
|
-
*
|
|
44
|
+
* Pausa a reprodução de mídia.
|
|
93
45
|
*/
|
|
94
|
-
|
|
46
|
+
pausePlayback(playbackId: string): Promise<void>;
|
|
95
47
|
/**
|
|
96
|
-
*
|
|
48
|
+
* Retoma a reprodução de mídia.
|
|
97
49
|
*/
|
|
98
|
-
|
|
50
|
+
resumePlayback(playbackId: string): Promise<void>;
|
|
99
51
|
/**
|
|
100
|
-
*
|
|
52
|
+
* Retrocede a reprodução de mídia.
|
|
101
53
|
*/
|
|
102
|
-
|
|
103
|
-
type: T;
|
|
104
|
-
}>): void;
|
|
54
|
+
rewindPlayback(playbackId: string, skipMs: number): Promise<void>;
|
|
105
55
|
/**
|
|
106
|
-
*
|
|
56
|
+
* Avança a reprodução de mídia.
|
|
107
57
|
*/
|
|
108
|
-
|
|
109
|
-
type: T;
|
|
110
|
-
}>) => void): void;
|
|
58
|
+
fastForwardPlayback(playbackId: string, skipMs: number): Promise<void>;
|
|
111
59
|
/**
|
|
112
|
-
*
|
|
60
|
+
* Muta o canal.
|
|
113
61
|
*/
|
|
114
|
-
|
|
115
|
-
type: T;
|
|
116
|
-
}>) => void): void;
|
|
62
|
+
muteChannel(direction?: "both" | "in" | "out"): Promise<void>;
|
|
117
63
|
/**
|
|
118
|
-
*
|
|
64
|
+
* Desmuta o canal.
|
|
119
65
|
*/
|
|
120
|
-
|
|
66
|
+
unmuteChannel(direction?: "both" | "in" | "out"): Promise<void>;
|
|
121
67
|
/**
|
|
122
|
-
*
|
|
68
|
+
* Coloca o canal em espera.
|
|
123
69
|
*/
|
|
124
|
-
|
|
70
|
+
holdChannel(): Promise<void>;
|
|
125
71
|
/**
|
|
126
|
-
*
|
|
72
|
+
* Remove o canal da espera.
|
|
127
73
|
*/
|
|
128
|
-
|
|
74
|
+
unholdChannel(): Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
export declare class Channels extends EventEmitter {
|
|
77
|
+
private baseClient;
|
|
78
|
+
private client;
|
|
79
|
+
constructor(baseClient: BaseClient, client: AriClient);
|
|
80
|
+
createChannelInstance(channelId?: string): ChannelInstance;
|
|
129
81
|
/**
|
|
130
|
-
*
|
|
82
|
+
* Origina um canal físico diretamente, sem uma instância de `ChannelInstance`.
|
|
131
83
|
*/
|
|
132
|
-
|
|
84
|
+
originate(data: OriginateRequest): Promise<Channel>;
|
|
133
85
|
/**
|
|
134
|
-
*
|
|
86
|
+
* Lista todos os canais ativos.
|
|
135
87
|
*/
|
|
136
|
-
|
|
137
|
-
reason_code?: string;
|
|
138
|
-
reason?: string;
|
|
139
|
-
}): Promise<void>;
|
|
88
|
+
list(): Promise<Channel[]>;
|
|
140
89
|
/**
|
|
141
90
|
* Inicia a escuta em um canal.
|
|
142
91
|
*/
|
|
@@ -148,124 +97,29 @@ export declare class Channels extends EventEmitter {
|
|
|
148
97
|
playWithId(channelId: string, playbackId: string, media: string, options?: PlaybackOptions): Promise<ChannelPlayback>;
|
|
149
98
|
snoopChannelWithId(channelId: string, snoopId: string, options: SnoopOptions): Promise<Channel>;
|
|
150
99
|
startMohWithClass(channelId: string, mohClass: string): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* Gets the value of a channel variable or function.
|
|
153
|
-
*
|
|
154
|
-
* @param channelId - The ID of the channel.
|
|
155
|
-
* @param variable - The name of the channel variable or function to retrieve.
|
|
156
|
-
* @returns A promise that resolves to the value of the variable.
|
|
157
|
-
* @throws Will throw an error if the variable is missing or the channel is not found.
|
|
158
|
-
*/
|
|
159
100
|
getChannelVariable(channelId: string, variable: string): Promise<ChannelVar>;
|
|
160
|
-
/**
|
|
161
|
-
* Sets the value of a channel variable or function.
|
|
162
|
-
*
|
|
163
|
-
* @param channelId - The ID of the channel.
|
|
164
|
-
* @param variable - The name of the channel variable or function to set.
|
|
165
|
-
* @param value - The value to set the variable to.
|
|
166
|
-
* @returns A promise that resolves when the variable is successfully set.
|
|
167
|
-
* @throws Will throw an error if the variable is missing or the channel is not found.
|
|
168
|
-
*/
|
|
169
101
|
setChannelVariable(channelId: string, variable: string, value?: string): Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* Moves the channel to another Stasis application.
|
|
172
|
-
*/
|
|
173
102
|
moveToApplication(channelId: string, app: string, appArgs?: string): Promise<void>;
|
|
174
|
-
/**
|
|
175
|
-
* Continues the dialplan for a specific channel.
|
|
176
|
-
*/
|
|
177
103
|
continueDialplan(channelId: string, context?: string, extension?: string, priority?: number, label?: string): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Stops music on hold (MOH) for a channel.
|
|
180
|
-
*/
|
|
181
104
|
stopMusicOnHold(channelId: string): Promise<void>;
|
|
182
|
-
/**
|
|
183
|
-
* Starts music on hold (MOH) for a channel.
|
|
184
|
-
*/
|
|
185
105
|
startMusicOnHold(channelId: string): Promise<void>;
|
|
186
|
-
/**
|
|
187
|
-
* Starts playback of a media file on a channel.
|
|
188
|
-
*/
|
|
189
|
-
/**
|
|
190
|
-
* Starts playback of a media file on a channel.
|
|
191
|
-
*/
|
|
192
|
-
startPlayback(channelId: string, media: string, options?: PlaybackOptions): Promise<ChannelPlayback>;
|
|
193
|
-
/**
|
|
194
|
-
* Stops playback of a media file on a channel.
|
|
195
|
-
*/
|
|
196
|
-
stopPlayback(channelId: string, playbackId: string): Promise<void>;
|
|
197
|
-
/**
|
|
198
|
-
* Pauses playback of a media file on a channel.
|
|
199
|
-
*/
|
|
200
|
-
pausePlayback(channelId: string, playbackId: string): Promise<void>;
|
|
201
|
-
/**
|
|
202
|
-
* Resumes playback of a media file on a channel.
|
|
203
|
-
*/
|
|
204
|
-
resumePlayback(channelId: string, playbackId: string): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Rewinds playback of a media file on a channel.
|
|
207
|
-
*/
|
|
208
|
-
rewindPlayback(channelId: string, playbackId: string, skipMs: number): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Fast-forwards playback of a media file on a channel.
|
|
211
|
-
*/
|
|
212
|
-
fastForwardPlayback(channelId: string, playbackId: string, skipMs: number): Promise<void>;
|
|
213
|
-
/**
|
|
214
|
-
* Records audio from a channel.
|
|
215
|
-
*/
|
|
216
106
|
record(channelId: string, options: RecordingOptions): Promise<Channel>;
|
|
217
|
-
/**
|
|
218
|
-
* Dials a created channel.
|
|
219
|
-
*/
|
|
220
107
|
dial(channelId: string, caller?: string, timeout?: number): Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* Redirects the channel to a different location.
|
|
223
|
-
*/
|
|
224
108
|
redirectChannel(channelId: string, endpoint: string): Promise<void>;
|
|
225
|
-
/**
|
|
226
|
-
* Answers a channel.
|
|
227
|
-
*/
|
|
228
109
|
answerChannel(channelId: string): Promise<void>;
|
|
229
|
-
/**
|
|
230
|
-
* Sends a ringing indication to a channel.
|
|
231
|
-
*/
|
|
232
110
|
ringChannel(channelId: string): Promise<void>;
|
|
233
|
-
/**
|
|
234
|
-
* Stops ringing indication on a channel.
|
|
235
|
-
*/
|
|
236
111
|
stopRingChannel(channelId: string): Promise<void>;
|
|
237
|
-
/**
|
|
238
|
-
* Sends DTMF to a channel.
|
|
239
|
-
*/
|
|
240
112
|
sendDTMF(channelId: string, dtmf: string, options?: {
|
|
241
113
|
before?: number;
|
|
242
114
|
between?: number;
|
|
243
115
|
duration?: number;
|
|
244
116
|
after?: number;
|
|
245
117
|
}): Promise<void>;
|
|
246
|
-
/**
|
|
247
|
-
* Mutes a channel.
|
|
248
|
-
*/
|
|
249
118
|
muteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
250
|
-
/**
|
|
251
|
-
* Unmutes a channel.
|
|
252
|
-
*/
|
|
253
119
|
unmuteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
254
|
-
/**
|
|
255
|
-
* Puts a channel on hold.
|
|
256
|
-
*/
|
|
257
120
|
holdChannel(channelId: string): Promise<void>;
|
|
258
|
-
/**
|
|
259
|
-
* Removes a channel from hold.
|
|
260
|
-
*/
|
|
261
121
|
unholdChannel(channelId: string): Promise<void>;
|
|
262
|
-
/**
|
|
263
|
-
* Creates a channel and places it in a Stasis app without dialing it.
|
|
264
|
-
*/
|
|
265
122
|
createChannel(data: OriginateRequest): Promise<Channel>;
|
|
266
|
-
/**
|
|
267
|
-
* Creates a new channel with a specific ID and originates a call.
|
|
268
|
-
*/
|
|
269
123
|
originateWithId(channelId: string, data: OriginateRequest): Promise<Channel>;
|
|
270
124
|
}
|
|
271
125
|
//# sourceMappingURL=channels.d.ts.map
|