aboutsummaryrefslogtreecommitdiffstats
path: root/doc/tex/ast_agi_commands.tex
blob: 5a63d3a3e9d56ba6fcc3d1363f4e252b28852bbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
% This file is automatically generated by the "manager dump actiondocs" CLI command.  Any manual edits will be lost.
\section{answer}
\subsection{Summary}
\begin{verbatim}
Answer channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: ANSWER
	Answers channel if not already in answer state. Returns -1 on
 channel failure, or 0 if successful.

\end{verbatim}


\section{channel status}
\subsection{Summary}
\begin{verbatim}
Returns status of the connected channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: CHANNEL STATUS [<channelname>]
	Returns the status of the specified channel.
 If no channel name is given the returns the status of the
 current channel.  Return values:
  0 Channel is down and available
  1 Channel is down, but reserved
  2 Channel is off hook
  3 Digits (or equivalent) have been dialed
  4 Line is ringing
  5 Remote end is ringing
  6 Line is up
  7 Line is busy

\end{verbatim}


\section{database del}
\subsection{Summary}
\begin{verbatim}
Removes database key/value
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: DATABASE DEL <family> <key>
	Deletes an entry in the Asterisk database for a
 given family and key.
 Returns 1 if successful, 0 otherwise.

\end{verbatim}


\section{database deltree}
\subsection{Summary}
\begin{verbatim}
Removes database keytree/value
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: DATABASE DELTREE <family> [keytree]
	Deletes a family or specific keytree within a family
 in the Asterisk database.
 Returns 1 if successful, 0 otherwise.

\end{verbatim}


\section{database get}
\subsection{Summary}
\begin{verbatim}
Gets database value
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: DATABASE GET <family> <key>
	Retrieves an entry in the Asterisk database for a
 given family and key.
 Returns 0 if <key> is not set.  Returns 1 if <key>
 is set and returns the variable in parentheses.
 Example return code: 200 result=1 (testvariable)

\end{verbatim}


\section{database put}
\subsection{Summary}
\begin{verbatim}
Adds/updates database value
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: DATABASE PUT <family> <key> <value>
	Adds or updates an entry in the Asterisk database for a
 given family, key, and value.
 Returns 1 if successful, 0 otherwise.

\end{verbatim}


\section{exec}
\subsection{Summary}
\begin{verbatim}
Executes a given Application
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: EXEC <application> <options>
	Executes <application> with given <options>.
 Returns whatever the application returns, or -2 on failure to find application

\end{verbatim}


\section{get data}
\subsection{Summary}
\begin{verbatim}
Prompts for DTMF on a channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: GET DATA <file to be streamed> [timeout] [max digits]
	Stream the given file, and recieve DTMF data. Returns the digits received
from the channel at the other end.

\end{verbatim}


\section{get full variable}
\subsection{Summary}
\begin{verbatim}
Evaluates a channel expression
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: GET FULL VARIABLE <variablename> [<channel name>]
	Returns 0 if <variablename> is not set or channel does not exist.  Returns 1
if <variablename>  is set and returns the variable in parenthesis.  Understands
complex variable names and builtin variables, unlike GET VARIABLE.
 example return code: 200 result=1 (testvariable)

\end{verbatim}


\section{get option}
\subsection{Summary}
\begin{verbatim}
Stream file, prompt for DTMF, with timeout
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: GET OPTION <filename> <escape_digits> [timeout]
	Behaves similar to STREAM FILE but used with a timeout option.

\end{verbatim}


\section{get variable}
\subsection{Summary}
\begin{verbatim}
Gets a channel variable
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: GET VARIABLE <variablename>
	Returns 0 if <variablename> is not set.  Returns 1 if <variablename>
 is set and returns the variable in parentheses.
 example return code: 200 result=1 (testvariable)

\end{verbatim}


\section{hangup}
\subsection{Summary}
\begin{verbatim}
Hangup the current channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: HANGUP [<channelname>]
	Hangs up the specified channel.
 If no channel name is given, hangs up the current channel

\end{verbatim}


\section{noop}
\subsection{Summary}
\begin{verbatim}
Does nothing
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: NoOp
	Does nothing.

\end{verbatim}


\section{receive char}
\subsection{Summary}
\begin{verbatim}
Receives one character from channels supporting it
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: RECEIVE CHAR <timeout>
	Receives a character of text on a channel. Specify timeout to be the
 maximum time to wait for input in milliseconds, or 0 for infinite. Most channels
 do not support the reception of text. Returns the decimal value of the character
 if one is received, or 0 if the channel does not support text reception.  Returns
 -1 only on error/hangup.

\end{verbatim}


\section{receive text}
\subsection{Summary}
\begin{verbatim}
Receives text from channels supporting it
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: RECEIVE TEXT <timeout>
	Receives a string of text on a channel. Specify timeout to be the
 maximum time to wait for input in milliseconds, or 0 for infinite. Most channels
 do not support the reception of text. Returns -1 for failure or 1 for success, and the string in parentheses.

\end{verbatim}


\section{record file}
\subsection{Summary}
\begin{verbatim}
Records to a given file
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: RECORD FILE <filename> <format> <escape digits> <timeout> \
                                          [offset samples] [BEEP] [s=silence]
	Record to a file until a given dtmf digit in the sequence is received
 Returns -1 on hangup or error.  The format will specify what kind of file
 will be recorded.  The timeout is the maximum record time in milliseconds, or
 -1 for no timeout. "Offset samples" is optional, and, if provided, will seek
 to the offset without exceeding the end of the file.  "silence" is the number
 of seconds of silence allowed before the function returns despite the
 lack of dtmf digits or reaching timeout.  Silence value must be
 preceeded by "s=" and is also optional.

\end{verbatim}


\section{say alpha}
\subsection{Summary}
\begin{verbatim}
Says a given character string
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY ALPHA <number> <escape digits>
	Say a given character string, returning early if any of the given DTMF digits
 are received on the channel. Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed or
 -1 on error/hangup.

\end{verbatim}


\section{say digits}
\subsection{Summary}
\begin{verbatim}
Says a given digit string
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY DIGITS <number> <escape digits>
	Say a given digit string, returning early if any of the given DTMF digits
 are received on the channel. Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed or
 -1 on error/hangup.

\end{verbatim}


\section{say number}
\subsection{Summary}
\begin{verbatim}
Says a given number
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY NUMBER <number> <escape digits> [gender]
	Say a given number, returning early if any of the given DTMF digits
 are received on the channel.  Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed or
 -1 on error/hangup.

\end{verbatim}


\section{say phonetic}
\subsection{Summary}
\begin{verbatim}
Says a given character string with phonetics
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY PHONETIC <string> <escape digits>
	Say a given character string with phonetics, returning early if any of the
 given DTMF digits are received on the channel. Returns 0 if playback
 completes without a digit pressed, the ASCII numerical value of the digit
 if one was pressed, or -1 on error/hangup.

\end{verbatim}


\section{say date}
\subsection{Summary}
\begin{verbatim}
Says a given date
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY DATE <date> <escape digits>
	Say a given date, returning early if any of the given DTMF digits are
 received on the channel.  <date> is number of seconds elapsed since 00:00:00
 on January 1, 1970, Coordinated Universal Time (UTC). Returns 0 if playback
 completes without a digit being pressed, or the ASCII numerical value of the
 digit if one was pressed or -1 on error/hangup.

\end{verbatim}


\section{say time}
\subsection{Summary}
\begin{verbatim}
Says a given time
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY TIME <time> <escape digits>
	Say a given time, returning early if any of the given DTMF digits are
 received on the channel.  <time> is number of seconds elapsed since 00:00:00
 on January 1, 1970, Coordinated Universal Time (UTC). Returns 0 if playback
 completes without a digit being pressed, or the ASCII numerical value of the
 digit if one was pressed or -1 on error/hangup.

\end{verbatim}


\section{say datetime}
\subsection{Summary}
\begin{verbatim}
Says a given time as specfied by the format given
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SAY DATETIME <time> <escape digits> [format] [timezone]
	Say a given time, returning early if any of the given DTMF digits are
 received on the channel.  <time> is number of seconds elapsed since 00:00:00
 on January 1, 1970, Coordinated Universal Time (UTC). [format] is the format
 the time should be said in.  See voicemail.conf (defaults to "ABdY
 'digits/at' IMp").  Acceptable values for [timezone] can be found in
 /usr/share/zoneinfo.  Defaults to machine default. Returns 0 if playback
 completes without a digit being pressed, or the ASCII numerical value of the
 digit if one was pressed or -1 on error/hangup.

\end{verbatim}


\section{send image}
\subsection{Summary}
\begin{verbatim}
Sends images to channels supporting it
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SEND IMAGE <image>
	Sends the given image on a channel. Most channels do not support the
 transmission of images. Returns 0 if image is sent, or if the channel does not
 support image transmission.  Returns -1 only on error/hangup. Image names
 should not include extensions.

\end{verbatim}


\section{send text}
\subsection{Summary}
\begin{verbatim}
Sends text to channels supporting it
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SEND TEXT "<text to send>"
	Sends the given text on a channel. Most channels do not support the
 transmission of text.  Returns 0 if text is sent, or if the channel does not
 support text transmission.  Returns -1 only on error/hangup.  Text
 consisting of greater than one word should be placed in quotes since the
 command only accepts a single argument.

\end{verbatim}


\section{set autohangup}
\subsection{Summary}
\begin{verbatim}
Autohangup channel in some time
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET AUTOHANGUP <time>
	Cause the channel to automatically hangup at <time> seconds in the
 future.  Of course it can be hungup before then as well. Setting to 0 will
 cause the autohangup feature to be disabled on this channel.

\end{verbatim}


\section{set callerid}
\subsection{Summary}
\begin{verbatim}
Sets callerid for the current channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET CALLERID <number>
	Changes the callerid of the current channel.

\end{verbatim}


\section{set context}
\subsection{Summary}
\begin{verbatim}
Sets channel context
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET CONTEXT <desired context>
	Sets the context for continuation upon exiting the application.

\end{verbatim}


\section{set extension}
\subsection{Summary}
\begin{verbatim}
Changes channel extension
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET EXTENSION <new extension>
	Changes the extension for continuation upon exiting the application.

\end{verbatim}


\section{set music}
\subsection{Summary}
\begin{verbatim}
Enable/Disable Music on hold generator
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET MUSIC ON <on|off> <class>
	Enables/Disables the music on hold generator.  If <class> is
 not specified, then the default music on hold class will be used.
 Always returns 0.

\end{verbatim}


\section{set priority}
\subsection{Summary}
\begin{verbatim}
Set channel dialplan priority
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET PRIORITY <priority>
	Changes the priority for continuation upon exiting the application.
 The priority must be a valid priority or label.

\end{verbatim}


\section{set variable}
\subsection{Summary}
\begin{verbatim}
Sets a channel variable
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: SET VARIABLE <variablename> <value>

\end{verbatim}


\section{stream file}
\subsection{Summary}
\begin{verbatim}
Sends audio file on channel
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: STREAM FILE <filename> <escape digits> [sample offset]
	Send the given file, allowing playback to be interrupted by the given
 digits, if any. Use double quotes for the digits if you wish none to be
 permitted. If sample offset is provided then the audio will seek to sample
 offset before play starts.  Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed,
 or -1 on error or if the channel was disconnected. Remember, the file
 extension must not be included in the filename.

\end{verbatim}


\section{control stream file}
\subsection{Summary}
\begin{verbatim}
Sends audio file on channel and allows the listner to control the stream
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: CONTROL STREAM FILE <filename> <escape digits> [skipms] [ffchar] [rewchr] [pausechr]
	Send the given file, allowing playback to be controled by the given
 digits, if any. Use double quotes for the digits if you wish none to be
 permitted.  Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed,
 or -1 on error or if the channel was disconnected. Remember, the file
 extension must not be included in the filename.

 Note: ffchar and rewchar default to * and # respectively.

\end{verbatim}


\section{tdd mode}
\subsection{Summary}
\begin{verbatim}
Toggles TDD mode (for the deaf)
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: TDD MODE <on|off>
	Enable/Disable TDD transmission/reception on a channel. Returns 1 if
 successful, or 0 if channel is not TDD-capable.

\end{verbatim}


\section{verbose}
\subsection{Summary}
\begin{verbatim}
Logs a message to the asterisk verbose log
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: VERBOSE <message> <level>
	Sends <message> to the console via verbose message system.
 <level> is the the verbose level (1-4)
 Always returns 1.

\end{verbatim}


\section{wait for digit}
\subsection{Summary}
\begin{verbatim}
Waits for a digit to be pressed
\end{verbatim}
\subsection{Usage}
\begin{verbatim}
 Usage: WAIT FOR DIGIT <timeout>
	Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.
 Returns -1 on channel failure, 0 if no digit is received in the timeout, or
 the numerical value of the ascii of the digit if one is received.  Use -1
 for the timeout value if you desire the call to block indefinitely.

\end{verbatim}