typescript-agi-ipcom 0.0.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.
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2020 Brandon Lehmann
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # Welcome to typescript-agi 👋
2
+ ![Version](https://img.shields.io/badge/version-0.0.5-blue.svg?cacheSeconds=2592000)
3
+ [![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://brandonlehmann.github.io/typescript-agi/)
4
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/brandonlehmann/typescript-agi/graphs/commit-activity)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/brandonlehmann/typescript-agi/blob/master/LICENSE)
6
+
7
+ [![NPM](https://nodei.co/npm/typescript-agi.png?downloads=true&stars=true)](https://nodei.co/npm/typescript-agi/)
8
+
9
+ > NodeJS TypeScript Library for Asterisk AGI Interfaces
10
+
11
+ ### 🏠 [Homepage](https://brandonlehmann.github.io/typescript-agi/)
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ npm install typescript-agi
17
+ ```
18
+
19
+ ## Run tests
20
+
21
+ ```sh
22
+ npm run test
23
+ ```
24
+
25
+ ## Example Usage
26
+
27
+ ```typescript
28
+ import {
29
+ AGIServer,
30
+ Channel
31
+ } from 'typescript-agi';
32
+
33
+ const agiServer = new AGIServer();
34
+
35
+ agiServer.on('channel', async(channel: Channel) => {
36
+ await channel.answer();
37
+ await channel.sayNumber(12345);
38
+ await channel.hangup();
39
+ });
40
+
41
+ agiServer.start();
42
+ ````
43
+
44
+ ## Documentation
45
+
46
+ Library documentation is available at [https://brandonlehmann.github.io/typescript-agi/](https://brandonlehmann.github.io/typescript-agi/)
47
+
48
+ ## Author
49
+
50
+ 👤 **Brandon Lehmann <brandonlehmann@gmail.com>**
51
+
52
+ * Github: [@brandonlehmann](https://github.com/brandonlehmann)
53
+
54
+ ## 🤝 Contributing
55
+
56
+ Contributions, issues and feature requests are welcome!
57
+
58
+ Feel free to check [issues page](https://github.com/brandonlehmann/typescript-agi/issues).
59
+
60
+ ## Show your support
61
+
62
+ Give a ⭐️ if this project helped you!
63
+
64
+
65
+ ## 📝 License
66
+
67
+ Copyright © 2020 [Brandon Lehmann <brandonlehmann@gmail.com>](https://github.com/brandonlehmann).
68
+
69
+ This project is [MIT](https://github.com/brandonlehmann/typescript-agi/blob/master/LICENSE) licensed.
70
+
71
+ ***
72
+ _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
@@ -0,0 +1,49 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import { Channel } from './Channel';
4
+ /**
5
+ * Represents an AGI server instance
6
+ */
7
+ export declare class AGIServer extends EventEmitter {
8
+ private readonly m_port;
9
+ private readonly m_ip;
10
+ private readonly m_server;
11
+ /**
12
+ * Constructs a new instance of the object
13
+ * @param port
14
+ * @param ip
15
+ */
16
+ constructor(port?: number, ip?: string);
17
+ /**
18
+ * Event that is emitted when a new AGI channel has been established and is ready for interation
19
+ * @param event
20
+ * @param listener
21
+ */
22
+ on(event: 'channel', listener: (channel: Channel) => void): this;
23
+ /**
24
+ * Event that is emitted when the AGI server is started and in a listening state
25
+ * @param event
26
+ * @param listener
27
+ */
28
+ on(event: 'listening', listener: (port: number, ip: string) => void): this;
29
+ /**
30
+ * Event that is emitted when the server encounters and error
31
+ * @param event
32
+ * @param listener
33
+ */
34
+ on(event: 'error', listener: (error: any) => void): this;
35
+ /**
36
+ * Event that emitted when the server is closed and stopped
37
+ * @param event
38
+ * @param listener
39
+ */
40
+ on(event: 'close', listener: () => void): this;
41
+ /**
42
+ * Starts the AGI server
43
+ */
44
+ start(): Promise<void>;
45
+ /**
46
+ * Stops the AGI server
47
+ */
48
+ stop(): Promise<void>;
49
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ // Copyright (c) 2020, Brandon Lehmann
3
+ //
4
+ // Please see the included LICENSE file for more information.
5
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AGIServer = void 0;
16
+ const net = require("net");
17
+ const events_1 = require("events");
18
+ const Channel_1 = require("./Channel");
19
+ const util_1 = require("util");
20
+ /**
21
+ * Represents an AGI server instance
22
+ */
23
+ class AGIServer extends events_1.EventEmitter {
24
+ /**
25
+ * Constructs a new instance of the object
26
+ * @param port
27
+ * @param ip
28
+ */
29
+ constructor(port = 3000, ip = '0.0.0.0') {
30
+ super();
31
+ this.m_server = net.createServer();
32
+ this.setMaxListeners(10);
33
+ this.m_port = port;
34
+ this.m_ip = ip;
35
+ this.m_server.on('connection', (socket) => {
36
+ const channel = new Channel_1.Channel(socket);
37
+ channel.on('ready', () => this.emit('channel', channel));
38
+ });
39
+ }
40
+ on(event, listener) {
41
+ return super.on(event, listener);
42
+ }
43
+ /**
44
+ * Starts the AGI server
45
+ */
46
+ start() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ this.m_server.on('error', (error) => this.emit('error', new Error(util_1.format('Internal TCP server error: %s', error.toString()))));
49
+ this.m_server.on('close', () => this.emit('close'));
50
+ this.m_server.listen(this.m_port, this.m_ip, () => {
51
+ this.emit('listening', this.m_port, this.m_ip);
52
+ });
53
+ });
54
+ }
55
+ /**
56
+ * Stops the AGI server
57
+ */
58
+ stop() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ return new Promise((resolve, reject) => {
61
+ this.m_server.close((error) => {
62
+ if (error) {
63
+ return reject(error);
64
+ }
65
+ return resolve();
66
+ });
67
+ });
68
+ });
69
+ }
70
+ }
71
+ exports.AGIServer = AGIServer;
@@ -0,0 +1,498 @@
1
+ /// <reference types="node" />
2
+ import { Socket } from 'net';
3
+ import { EventEmitter } from 'events';
4
+ import { ResponseArguments } from './ResponseArguments';
5
+ /**
6
+ * Represents the current channel state
7
+ */
8
+ export declare enum ChannelState {
9
+ DOWN_AVAILABLE = 0,
10
+ DOWN_RESERVED = 1,
11
+ OFF_HOOK = 2,
12
+ DIGITS_DIALED = 3,
13
+ RINGING = 4,
14
+ REMOTE_RINGING = 5,
15
+ UP = 6,
16
+ BUSY = 7
17
+ }
18
+ /**
19
+ * Represents the result of a Dial() attempt
20
+ */
21
+ export declare enum DialStatus {
22
+ ANSWER = 0,
23
+ BUSY = 1,
24
+ NOANSWER = 2,
25
+ CANCEL = 3,
26
+ CONGESTION = 4,
27
+ CHANUNAVAIL = 5,
28
+ DONTCALL = 6,
29
+ TORTURE = 7,
30
+ INVALIDARGS = 8
31
+ }
32
+ /**
33
+ * Represents the playback status
34
+ */
35
+ export declare enum PlaybackStatus {
36
+ SUCCESS = 0,
37
+ USER_STOPPED = 1,
38
+ REMOTE_STOPPED = 2,
39
+ ERROR = 3
40
+ }
41
+ /** @ignore */
42
+ interface IResponse {
43
+ code: number;
44
+ result: number;
45
+ arguments: ResponseArguments;
46
+ }
47
+ /**
48
+ * Represents an AGI Channel
49
+ */
50
+ export declare class Channel extends EventEmitter {
51
+ private readonly m_connection;
52
+ private m_state;
53
+ private m_message;
54
+ private m_network;
55
+ private m_network_script;
56
+ private m_request;
57
+ private m_channel;
58
+ private m_language;
59
+ private m_type;
60
+ private m_uniqueid;
61
+ private m_version;
62
+ private m_callerid;
63
+ private m_calleridname;
64
+ private m_callingpres;
65
+ private m_callingani2;
66
+ private m_callington;
67
+ private m_callingtns;
68
+ private m_dnid;
69
+ private m_rdnis;
70
+ private m_context;
71
+ private m_extension;
72
+ private m_priority;
73
+ private m_enhanced;
74
+ private m_accountcode;
75
+ private m_threadid;
76
+ /**
77
+ * Creates a new instance of a channel object
78
+ * @param connection the AGI socket connection
79
+ */
80
+ constructor(connection: Socket);
81
+ /**
82
+ * Event that is emitted when the underlying socket encounters an error
83
+ * @param event
84
+ * @param listener
85
+ */
86
+ on(event: 'error', listener: (error: any) => void): this;
87
+ /**
88
+ * Event that is emitted when the underlying socket is closed
89
+ * @param event
90
+ * @param listener
91
+ */
92
+ on(event: 'close', listener: () => void): this;
93
+ /**
94
+ * Event that emitted when the underlying socket times out
95
+ * @param event
96
+ * @param listener
97
+ */
98
+ on(event: 'timeout', listener: () => void): this;
99
+ /**
100
+ * Event that is emitted when the channel is ready
101
+ * @param event
102
+ * @param listener
103
+ */
104
+ on(event: 'ready', listener: () => void): this;
105
+ /**
106
+ * Event that is emitted when a response is received from the Asterisk server
107
+ * @param event
108
+ * @param listener
109
+ */
110
+ on(event: 'recv', listener: (response: string) => void): this;
111
+ /**
112
+ * Event that emitted when the channel is hung up
113
+ * @param event
114
+ * @param listener
115
+ */
116
+ on(event: 'hangup', listener: () => void): this;
117
+ /**
118
+ * Event that emitted when the response from the Asterisk server is processed into a structured response
119
+ * @param event
120
+ * @param listener
121
+ */
122
+ on(event: 'response', listener: (response: IResponse) => void): this;
123
+ /**
124
+ * Event that is emitted when data is sent to the Asterisk server
125
+ * @param event
126
+ * @param listener
127
+ */
128
+ on(event: 'send', listener: (data: string) => void): this;
129
+ /**
130
+ * Whether this AGI request is over the network
131
+ */
132
+ get network(): boolean;
133
+ /**
134
+ * The network path included in the AGI request
135
+ * ie. agi://127.0.0.1:3000/test
136
+ * This value would return 'test'
137
+ */
138
+ get network_script(): string;
139
+ /**
140
+ * The version of Asterisk
141
+ */
142
+ get version(): string;
143
+ /**
144
+ * The filename of your script
145
+ * ie. agi
146
+ */
147
+ get request(): string;
148
+ /**
149
+ * The originating channel (your phone)
150
+ */
151
+ get channel(): string;
152
+ /**
153
+ * The language code (e.g. “en”)
154
+ */
155
+ get language(): string;
156
+ /**
157
+ * The originating channel type (e.g. “SIP” or “ZAP”)
158
+ */
159
+ get type(): string;
160
+ /**
161
+ * A unique ID for the call
162
+ */
163
+ get uniqueid(): string;
164
+ /**
165
+ * The caller ID number (or “unknown”)
166
+ */
167
+ get callerid(): string;
168
+ /**
169
+ * The caller ID name (or “unknown”)
170
+ */
171
+ get calleridname(): string;
172
+ /**
173
+ * The presentation for the callerid in a ZAP channel
174
+ */
175
+ get callingpres(): string;
176
+ /**
177
+ * The number which is defined in ANI2 see Asterisk Detailed Variable List (only for PRI Channels)
178
+ */
179
+ get callingani2(): string;
180
+ /**
181
+ * The type of number used in PRI Channels see Asterisk Detailed Variable List
182
+ */
183
+ get callington(): string;
184
+ /**
185
+ * An optional 4 digit number (Transit Network Selector) used in PRI Channels see Asterisk Detailed Variable List
186
+ */
187
+ get callingtns(): string;
188
+ /**
189
+ * The dialed number id (or “unknown”)
190
+ */
191
+ get dnid(): string;
192
+ /**
193
+ * The referring DNIS number (or “unknown”)
194
+ */
195
+ get rdnis(): string;
196
+ /**
197
+ * Origin context in extensions.conf
198
+ */
199
+ get context(): string;
200
+ /**
201
+ * The called number
202
+ */
203
+ get extension(): string;
204
+ /**
205
+ * The priority it was executed as in the dial plan
206
+ */
207
+ get priority(): string;
208
+ /**
209
+ * The flag value is 1.0 if started as an EAGI script, 0.0 otherwise
210
+ */
211
+ get enhanced(): string;
212
+ /**
213
+ * Account code of the origin channel
214
+ */
215
+ get accountcode(): string;
216
+ /**
217
+ * Thread ID of the AGI script
218
+ */
219
+ get threadid(): string;
220
+ /**
221
+ * Answers channel if not already in answer state.
222
+ */
223
+ answer(): Promise<void>;
224
+ /**
225
+ * Interrupts expected flow of Async AGI commands and returns control to
226
+ * previous source (typically, the PBX dialplan).
227
+ */
228
+ break(): Promise<void>;
229
+ /**
230
+ * Returns status of the connected channel.
231
+ * @param channel
232
+ */
233
+ channelStatus(channel?: string): Promise<ChannelState>;
234
+ /**
235
+ * Sends audio file on channel and allows the listener to control the stream.
236
+ * @param filename
237
+ * @param escapeDigits
238
+ * @param skipms
239
+ * @param fastForwardCharacter
240
+ * @param rewindCharacter
241
+ * @param pauseCharacter
242
+ */
243
+ controlStreamFile(filename: string, escapeDigits?: string, skipms?: number, fastForwardCharacter?: string, rewindCharacter?: string, pauseCharacter?: string): Promise<{
244
+ digit: string;
245
+ playbackStatus: PlaybackStatus;
246
+ playbackOffset: number;
247
+ }>;
248
+ /**
249
+ * Attempts to establish a new outgoing connection on a channel, and then link it to the calling input channel.
250
+ * @param target
251
+ * @param timeout
252
+ * @param params
253
+ */
254
+ dial(target: string, timeout?: number, params?: string): Promise<DialStatus>;
255
+ /**
256
+ * Deletes an entry in the Asterisk database for a given family and key.
257
+ * @param family
258
+ * @param key
259
+ */
260
+ databaseDel(family: string, key: string): Promise<void>;
261
+ /**
262
+ * Deletes a family or specific keytree within a family in the Asterisk database.
263
+ * @param family
264
+ * @param keyTree
265
+ */
266
+ databaseDelTree(family: string, keyTree?: string): Promise<boolean>;
267
+ /**
268
+ * Retrieves an entry in the Asterisk database for a given family and key.
269
+ * @param family
270
+ * @param key
271
+ */
272
+ databaseGet(family: string, key: string): Promise<string>;
273
+ /**
274
+ * Adds or updates an entry in the Asterisk database for a given family, key, and value.
275
+ * @param family
276
+ * @param key
277
+ * @param value
278
+ */
279
+ databasePut(family: string, key: string, value: string): Promise<string>;
280
+ /**
281
+ * Executes application with given options
282
+ * @param application.
283
+ * @param args
284
+ */
285
+ exec(application: string, ...args: string[]): Promise<number>;
286
+ /**
287
+ * Stream the given file, and receive DTMF data.
288
+ * @param soundFile
289
+ * @param timeout
290
+ * @param maxDigits
291
+ */
292
+ getData(soundFile: string, timeout?: number, maxDigits?: number): Promise<{
293
+ digits: string;
294
+ timeout: boolean;
295
+ }>;
296
+ /**
297
+ * Evaluates a channel expression
298
+ * Understands complex variable names and builtin variables, unlike GET VARIABLE.
299
+ * @param key
300
+ * @param channel
301
+ */
302
+ getFullVariable(key: string, channel?: string): Promise<string>;
303
+ /**
304
+ * Stream file, prompt for DTMF, with timeout.
305
+ * Behaves similar to STREAM FILE but used with a timeout option.
306
+ * @param soundFile
307
+ * @param escapeDigits
308
+ * @param timeout
309
+ */
310
+ getOption(soundFile: string, escapeDigits?: string, timeout?: number): Promise<{
311
+ digit: string;
312
+ endpos: number;
313
+ }>;
314
+ /**
315
+ * Gets a channel variable.
316
+ * @param key
317
+ */
318
+ getVariable(key: string): Promise<string>;
319
+ /**
320
+ * Cause the channel to execute the specified dialplan subroutine.
321
+ * @param context
322
+ * @param extension
323
+ * @param priority
324
+ * @param argument
325
+ */
326
+ goSub(context: string, extension: string, priority: number, argument?: string): Promise<void>;
327
+ /**
328
+ * Hangs up the specified channel. If no channel name is given, hangs up the current channel
329
+ * @param channel
330
+ */
331
+ hangup(channel?: string): Promise<void>;
332
+ /**
333
+ * Does nothing
334
+ */
335
+ noop(): Promise<void>;
336
+ /**
337
+ * Receives one character from channels supporting it.
338
+ * @param timeout
339
+ */
340
+ receiveChar(timeout?: number): Promise<{
341
+ char: string;
342
+ timeout: boolean;
343
+ }>;
344
+ /**
345
+ * Receives text from channels supporting it.
346
+ * @param timeout
347
+ */
348
+ receiveText(timeout?: number): Promise<string>;
349
+ /**
350
+ * Records to a given file.
351
+ * @param filename
352
+ * @param fileFormat
353
+ * @param escapeDigits
354
+ * @param timeout
355
+ * @param beep
356
+ * @param silence
357
+ * @param offsetSamples
358
+ */
359
+ recordFile(filename: string, fileFormat?: string, escapeDigits?: string, timeout?: number, beep?: boolean, silence?: number, offsetSamples?: number): Promise<{
360
+ digit: string;
361
+ endpos: number;
362
+ timeout: boolean;
363
+ }>;
364
+ /**
365
+ * Says a given character string.
366
+ * @param value
367
+ * @param escapeDigits
368
+ */
369
+ sayAlpha(value: string, escapeDigits?: string): Promise<string>;
370
+ /**
371
+ * Says a given date.
372
+ * @param value
373
+ * @param escapeDigits
374
+ */
375
+ sayDate(value: Date | number, escapeDigits?: string): Promise<string>;
376
+ /**
377
+ * Says a given time as specified by the format given.
378
+ * @param value
379
+ * @param escapeDigits
380
+ * @param dateFormat
381
+ * @param timezone
382
+ */
383
+ sayDateTime(value: Date | number, escapeDigits?: string, dateFormat?: string, timezone?: string): Promise<string>;
384
+ /**
385
+ * Says a given digit string.
386
+ * @param value
387
+ * @param escapeDigits
388
+ */
389
+ sayDigits(value: string, escapeDigits?: string): Promise<string>;
390
+ /**
391
+ * Says a given number.
392
+ * @param value
393
+ * @param escapeDigits
394
+ */
395
+ sayNumber(value: number, escapeDigits?: string): Promise<string>;
396
+ /**
397
+ * Says a given character string with phonetics.
398
+ * @param value
399
+ * @param escapeDigits
400
+ */
401
+ sayPhonetic(value: string, escapeDigits?: string): Promise<string>;
402
+ /**
403
+ * Says a given time.
404
+ * @param value
405
+ * @param escapeDigits
406
+ */
407
+ sayTime(value: Date | number, escapeDigits?: string): Promise<string>;
408
+ /**
409
+ * Sends images to channels supporting it.
410
+ * @param image
411
+ */
412
+ sendImage(image: string): Promise<void>;
413
+ /**
414
+ * Sends text to channels supporting it.
415
+ * @param text
416
+ */
417
+ sendText(text: string): Promise<void>;
418
+ /**
419
+ * Autohangup channel in some time.
420
+ * @param timeout
421
+ */
422
+ setAutoHangup(timeout?: number): Promise<void>;
423
+ /**
424
+ * Sets callerid for the current channel.
425
+ * @param callerNumber
426
+ * @param callerName
427
+ */
428
+ setCallerID(callerNumber: number, callerName?: string): Promise<void>;
429
+ /**
430
+ * Sets channel context.
431
+ * @param context
432
+ */
433
+ setContext(context: string): Promise<void>;
434
+ /**
435
+ * Changes channel extension.
436
+ * @param extension
437
+ */
438
+ setExtension(extension: string): Promise<void>;
439
+ /**
440
+ * Enable/Disable Music on hold generator
441
+ * @param status
442
+ * @param musicClass
443
+ */
444
+ setMusic(status?: boolean, musicClass?: string): Promise<void>;
445
+ /**
446
+ * Set channel dialplan priority.
447
+ * @param priority
448
+ */
449
+ setPriority(priority: number): Promise<void>;
450
+ /**
451
+ * Set channel dialplan priority.
452
+ * @param key
453
+ * @param value
454
+ */
455
+ setVariable(key: string, value: string): Promise<void>;
456
+ speechActivateGrammar(grammar: string): Promise<IResponse>;
457
+ speechCreate(engine: string): Promise<IResponse>;
458
+ speechDeactivateGrammar(grammar: string): Promise<IResponse>;
459
+ speechDestroy(): Promise<IResponse>;
460
+ speechLoadGrammar(grammar: string, path: string): Promise<IResponse>;
461
+ speechRecognize(soundFile: string, timeout: number | undefined, offset: number): Promise<IResponse>;
462
+ speechSet(key: string, value: string): Promise<IResponse>;
463
+ speedUnloadGrammar(grammar: string): Promise<IResponse>;
464
+ /**
465
+ * Sends audio file on channel.
466
+ * @param filename
467
+ * @param escapeDigits
468
+ * @param offset
469
+ */
470
+ streamFile(filename: string, escapeDigits?: string, offset?: number): Promise<{
471
+ digit: string;
472
+ endpos: number;
473
+ }>;
474
+ /**
475
+ * Toggles TDD mode (for the deaf).
476
+ * @param status
477
+ */
478
+ tddMode(status: boolean): Promise<void>;
479
+ /**
480
+ * Logs a message to the asterisk verbose log.
481
+ * @param message
482
+ * @param level
483
+ */
484
+ verbose(message: string, level?: number): Promise<void>;
485
+ /**
486
+ * Waits for a digit to be pressed.
487
+ * @param timeout
488
+ */
489
+ waitForDigit(timeout?: number): Promise<string>;
490
+ private close;
491
+ private read;
492
+ private readVariables;
493
+ private readResponse;
494
+ private readResponseLine;
495
+ private send;
496
+ private sendCommand;
497
+ }
498
+ export {};