aboutsummaryrefslogtreecommitdiffstats
path: root/doc/tex/ast_funcdocs.tex
blob: 280308b252569294f3c0c5601981499914b5061d (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
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
% This file is automatically generated by the "core dump funcdocs" CLI command.  Any manual edits will be lost.
\section{AGENT}
\subsection{Syntax}
\begin{verbatim}
AGENT(<agentid>[:item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets information about an Agent
\end{verbatim}
\subsection{Description}
\begin{verbatim}
The valid items to retrieve are:
- status (default)      The status of the agent
                          LOGGEDIN | LOGGEDOUT
- password              The password of the agent
- name                  The name of the agent
- mohclass              MusicOnHold class
- exten                 The callback extension for the Agent (AgentCallbackLogin)
- channel               The name of the active channel for the Agent (AgentLogin)

\end{verbatim}


\section{ARRAY}
\subsection{Syntax}
\begin{verbatim}
ARRAY(var1[|var2[...][|varN]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Allows setting multiple variables at once
\end{verbatim}
\subsection{Description}
\begin{verbatim}
The comma-separated list passed as a value to which the function is set will
be interpreted as a set of values to which the comma-separated list of
variable names in the argument should be set.
Hence, Set(ARRAY(var1|var2)=1\,2) will set var1 to 1 and var2 to 2
Note: remember to either backslash your commas in extensions.conf or quote the
entire argument, since Set can take multiple arguments itself.

\end{verbatim}


\section{BASE64\_DECODE}
\subsection{Syntax}
\begin{verbatim}
BASE64_DECODE(<base64_string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Decode a base64 string
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the plain text string

\end{verbatim}


\section{BASE64\_ENCODE}
\subsection{Syntax}
\begin{verbatim}
BASE64_ENCODE(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Encode a string in base64
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the base64 string

\end{verbatim}


\section{BLACKLIST}
\subsection{Syntax}
\begin{verbatim}
BLACKLIST()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Check if the callerid is on the blacklist
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Uses astdb to check if the Caller*ID is in family 'blacklist'.  Returns 1 or 0.

\end{verbatim}


\section{CALLERID}
\subsection{Syntax}
\begin{verbatim}
CALLERID(datatype[,<optional-CID>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets Caller*ID data on the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets Caller*ID data on the channel.  The allowable datatypes
are "all", "name", "num", "ANI", "DNID", "RDNIS", "pres",
and "ton".
Uses channel callerid by default or optional callerid, if specified.

\end{verbatim}


\section{CALLERPRES}
\subsection{Syntax}
\begin{verbatim}
CALLERPRES()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets Caller*ID presentation on the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets Caller*ID presentation on the channel.  The following values
are valid:
      allowed_not_screened    : Presentation Allowed, Not Screened
      allowed_passed_screen   : Presentation Allowed, Passed Screen
      allowed_failed_screen   : Presentation Allowed, Failed Screen
      allowed                 : Presentation Allowed, Network Number
      prohib_not_screened     : Presentation Prohibited, Not Screened
      prohib_passed_screen    : Presentation Prohibited, Passed Screen
      prohib_failed_screen    : Presentation Prohibited, Failed Screen
      prohib                  : Presentation Prohibited, Network Number
      unavailable             : Number Unavailable

\end{verbatim}


\section{CDR}
\subsection{Syntax}
\begin{verbatim}
CDR(<name>[|options])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets a CDR variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Options:
  'r' searches the entire stack of CDRs on the channel
  'u' retrieves the raw, unprocessed value
  For example, 'start', 'answer', and 'end' will be retrieved as epoch
  values, when the 'u' option is passed, but formatted as YYYY-MM-DD HH:MM:SS
  otherwise.  Similarly, disposition and amaflags will return their raw
  integral values.
  Here is a list of all the available cdr field names:
    clid          lastdata       disposition
    src           start          amaflags
    dst           answer         accountcode
    dcontext      end            uniqueid
    dstchannel    duration       userfield
    lastapp       billsec        channel
  All of the above variables are read-only, except for accountcode,
  userfield, and amaflags. You may, however,  supply
  a name not on the above list, and create your own
  variable, whose value can be changed with this function,
  and this variable will be stored on the cdr.
   raw values for disposition:
       1 = NO ANSWER
	2 = BUSY
	3 = FAILED
	4 = ANSWERED
    raw values for amaflags:
       1 = OMIT
       2 = BILLING
       3 = DOCUMENTATION

\end{verbatim}


\section{CHANNEL}
\subsection{Syntax}
\begin{verbatim}
CHANNEL(item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets/sets various pieces of information about the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets/set various pieces of information about the channel.
Standard items (provided by all channel technologies) are:
R/O	audioreadformat    format currently being read
R/O	audionativeformat  format used natively for audio
R/O	audiowriteformat   format currently being written
R/W	callgroup          call groups for call pickup
R/O	channeltype        technology used for channel
R/W	language           language for sounds played
R/W	musicclass         class (from musiconhold.conf) for hold music
R/W	rxgain             set rxgain level on channel drivers that support it
R/O	state              state for channel
R/W	tonezone           zone for indications played
R/W	txgain             set txgain level on channel drivers that support it
R/O	videonativeformat  format used natively for video

chan_sip provides the following additional options:
R/O    rtpqos             Get QOS information about the RTP stream
       This option takes two additional arguments:
  Argument 1:
    audio                 Get data about the audio stream
    video                 Get data about the video stream
    text                  Get data about the text stream
  Argument 2:
    local_ssrc            Local SSRC (stream ID)
    local_lostpackets     Local lost packets
    local_jitter          Local calculated jitter
    local_count           Number of received packets
    remote_ssrc           Remote SSRC (stream ID)
    remote_lostpackets    Remote lost packets
    remote_jitter         Remote reported jitter
    remote_count          Number of transmitted packets
    rtt                   Round trip time
    all                   All statistics (in a form suited to logging, but not for parsing)
R/O    rtpdest            Get remote RTP destination information
       This option takes one additional argument:
  Argument 1:
    audio                 Get audio destination
    video                 Get video destination

chan_iax2 provides the following additional options:
R/W    osptoken           Get or set the OSP token information for a call

Additional items may be available from the channel driver providing
the channel; see its documentation for details.

Any item requested that is not available on the current channel will
return an empty string.

\end{verbatim}


\section{CHECKSIPDOMAIN}
\subsection{Syntax}
\begin{verbatim}
CHECKSIPDOMAIN(<domain|IP>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Checks if domain is a local domain
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function checks if the domain in the argument is configured
as a local SIP domain that this Asterisk server is configured to handle.
Returns the domain name if it is locally handled, otherwise an empty string.
Check the domain= configuration in sip.conf

\end{verbatim}


\section{CURL}
\subsection{Syntax}
\begin{verbatim}
CURL(url[|post-data])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieves the contents of a URL
\end{verbatim}
\subsection{Description}
\begin{verbatim}
  url       - URL to retrieve
  post-data - Optional data to send as a POST (GET is default action)

\end{verbatim}


\section{CUT}
\subsection{Syntax}
\begin{verbatim}
CUT(<varname>,<char-delim>,<range-spec>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Slices and dices strings, based upon a named delimiter.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
  varname    - variable you want cut
  char-delim - defaults to '-'
  range-spec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)

\end{verbatim}


\section{DB}
\subsection{Syntax}
\begin{verbatim}
DB(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Read from or write to the Asterisk database
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will read from or write a value to the Asterisk database.  On a
read, this function returns the corresponding value from the database, or blank
if it does not exist.  Reading a database value will also set the variable
DB_RESULT.  If you wish to find out if an entry exists, use the DB_EXISTS
function.

\end{verbatim}


\section{DB\_DELETE}
\subsection{Syntax}
\begin{verbatim}
DB_DELETE(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return a value from the database and delete it
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve a value from the Asterisk database
 and then remove that key from the database.  DB_RESULT
will be set to the key's value if it exists.

\end{verbatim}


\section{DB\_EXISTS}
\subsection{Syntax}
\begin{verbatim}
DB_EXISTS(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Check to see if a key exists in the Asterisk database
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will check to see if a key exists in the Asterisk
database. If it exists, the function will return "1". If not,
it will return "0".  Checking for existence of a database key will
also set the variable DB_RESULT to the key's value if it exists.

\end{verbatim}


\section{DEVSTATE}
\subsection{Syntax}
\begin{verbatim}
DEVSTATE(device)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Get or Set a device state
\end{verbatim}
\subsection{Description}
\begin{verbatim}
  The DEVSTATE function can be used to retrieve the device state from any
device state provider.  For example:
   NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)})
   NoOp(Conference number 1234 has state ${DEVSTATE(MeetMe:1234)})

  The DEVSTATE function can also be used to set custom device state from
the dialplan.  The "Custom:" prefix must be used.  For example:
  Set(DEVSTATE(Custom:lamp1)=BUSY)
  Set(DEVSTATE(Custom:lamp2)=NOT_INUSE)
You can subscribe to the status of a custom device state using a hint in
the dialplan:
  exten => 1234,hint,Custom:lamp1

  The possible values for both uses of this function are:
UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING
RINGINUSE | ONHOLD

\end{verbatim}


\section{DUNDILOOKUP}
\subsection{Syntax}
\begin{verbatim}
DUNDILOOKUP(number[|context[|options]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Do a DUNDi lookup of a phone number.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a DUNDi lookup of the given phone number.
If no context is given, the default will be e164. The result of
this function will return the Technology/Resource found in the first result
in the DUNDi lookup. If no results were found, the result will be blank.
If the 'b' option is specified, the internal DUNDi cache will
be bypassed.

\end{verbatim}


\section{DUNDIQUERY}
\subsection{Syntax}
\begin{verbatim}
DUNDIQUERY(number[|context[|options]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Initiate a DUNDi query.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a DUNDi lookup of the given phone number.
If no context is given, the default will be e164. The result of
this function will be a numeric ID that can be used to retrieve
the results with the DUNDIRESULT function. If the 'b' option is
is specified, the internal DUNDi cache will be bypassed.

\end{verbatim}


\section{DUNDIRESULT}
\subsection{Syntax}
\begin{verbatim}
DUNDIRESULT(id|resultnum)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve results from a DUNDIQUERY
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve results from a previous use
of the DUNDIQUERY function.
  id - This argument is the identifier returned by the DUNDIQUERY function.
  resultnum - This is the number of the result that you want to retrieve.
       Results start at 1.  If this argument is specified as "getnum",
       then it will return the total number of results that are available.

\end{verbatim}


\section{ENUMLOOKUP}
\subsection{Syntax}
\begin{verbatim}
ENUMLOOKUP(number[|Method-type[|options[|record#[|zone-suffix]]]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
General or specific querying of NAPTR records for ENUM or ENUM-like DNS pointers
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Option 'c' returns an integer count of the number of NAPTRs of a certain RR type.
Combination of 'c' and Method-type of 'ALL' will return a count of all NAPTRs for the record.
Defaults are: Method-type=sip, no options, record=1, zone-suffix=e164.arpa

For more information, see doc/asterisk.pdf
\end{verbatim}


\section{ENUMQUERY}
\subsection{Syntax}
\begin{verbatim}
ENUMQUERY(number[|Method-type[|zone-suffix]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Initiate an ENUM query
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a ENUM lookup of the given phone number.
If no method-tpye is given, the default will be sip. If no
zone-suffix is given, the default will be "e164.arpa".
The result of this function will be a numeric ID that can
be used to retrieve the results using the ENUMRESULT function.

\end{verbatim}


\section{ENUMRESULT}
\subsection{Syntax}
\begin{verbatim}
ENUMRESULT(id|resultnum)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve results from a ENUMQUERY
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve results from a previous use
of the ENUMQUERY function.
  id - This argument is the identifier returned by the ENUMQUERY function.
  resultnum - This is the number of the result that you want to retrieve.
       Results start at 1.  If this argument is specified as "getnum",
       then it will return the total number of results that are available.

\end{verbatim}


\section{ENV}
\subsection{Syntax}
\begin{verbatim}
ENV(<envname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the environment variable specified
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{EVAL}
\subsection{Syntax}
\begin{verbatim}
EVAL(<variable>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Evaluate stored variables.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Using EVAL basically causes a string to be evaluated twice.
When a variable or expression is in the dialplan, it will be
evaluated at runtime. However, if the result of the evaluation
is in fact a variable or expression, using EVAL will have it
evaluated a second time. For example, if the variable ${MYVAR}
contains "${OTHERVAR}", then the result of putting ${EVAL(${MYVAR})}
in the dialplan will be the contents of the variable, OTHERVAR.
Normally, by just putting ${MYVAR} in the dialplan, you would be
left with "${OTHERVAR}".

\end{verbatim}


\section{EXISTS}
\subsection{Syntax}
\begin{verbatim}
EXISTS(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Existence Test: Returns 1 if exists, 0 otherwise
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{FIELDQTY}
\subsection{Syntax}
\begin{verbatim}
FIELDQTY(<varname>|<delim>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count the fields, with an arbitrary delimiter
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{FILTER}
\subsection{Syntax}
\begin{verbatim}
FILTER(<allowed-chars>|<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Filter the string to include only the allowed characters
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{GLOBAL}
\subsection{Syntax}
\begin{verbatim}
GLOBAL(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the global variable specified
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{GROUP}
\subsection{Syntax}
\begin{verbatim}
GROUP([category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the channel group.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets the channel group.

\end{verbatim}


\section{GROUP\_COUNT}
\subsection{Syntax}
\begin{verbatim}
GROUP_COUNT([groupname][@category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the number of channels in the specified group
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Calculates the group count for the specified group, or uses the
channel's current group if not specifed (and non-empty).

\end{verbatim}


\section{GROUP\_LIST}
\subsection{Syntax}
\begin{verbatim}
GROUP_LIST()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets a list of the groups set on a channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets a list of the groups set on a channel.

\end{verbatim}


\section{GROUP\_MATCH\_COUNT}
\subsection{Syntax}
\begin{verbatim}
GROUP_MATCH_COUNT(groupmatch[@category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the number of channels in the groups matching the specified pattern
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Calculates the group count for all groups that match the specified pattern.
Uses standard regular expression matching (see regex(7)).

\end{verbatim}


\section{HASH}
\subsection{Syntax}
\begin{verbatim}
HASH(hashname[|hashkey])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Implementation of a dialplan associative array
\end{verbatim}
\subsection{Description}
\begin{verbatim}
In two argument mode, gets and sets values to corresponding keys within a named
associative array.  The single-argument mode will only work when assigned to from
a function defined by func_odbc.so.

\end{verbatim}


\section{HASHKEYS}
\subsection{Syntax}
\begin{verbatim}
HASHKEYS(<hashname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve the keys of a HASH()
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a comma-delimited list of the current keys of an associative array
defined by the HASH() function.  Note that if you iterate over the keys of
the result, adding keys during iteration will cause the result of the HASHKEYS
function to change.

\end{verbatim}


\section{IAXPEER}
\subsection{Syntax}
\begin{verbatim}
IAXPEER(<peername|CURRENTCHANNEL>[|item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets IAX peer information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
If peername specified, valid items are:
- ip (default)          The IP address.
- status                The peer's status (if qualify=yes)
- mailbox               The configured mailbox.
- context               The configured context.
- expire                The epoch time of the next expire.
- dynamic               Is it dynamic? (yes/no).
- callerid_name         The configured Caller ID name.
- callerid_num          The configured Caller ID number.
- codecs                The configured codecs.
- codec[x]              Preferred codec index number 'x' (beginning with zero).

If CURRENTCHANNEL specified, returns IP address of current channel


\end{verbatim}


\section{IAXVAR}
\subsection{Syntax}
\begin{verbatim}
IAXVAR(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sets or retrieves a remote variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{ICONV}
\subsection{Syntax}
\begin{verbatim}
ICONV(in-charset,out-charset,string)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Converts charsets of strings.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Converts string from in-charset into out-charset.  For available charsets,
use 'iconv -l' on your shell command line.
Note: due to limitations within the API, ICONV will not currently work with
charsets with embedded NULLs.  If found, the string will terminate.

\end{verbatim}


\section{IF}
\subsection{Syntax}
\begin{verbatim}
IF(<expr>?[<true>][:<false>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Conditional: Returns the data following '?' if true else the data following ':'
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{IFMODULE}
\subsection{Syntax}
\begin{verbatim}
IFMODULE(<modulename.so>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Checks if an Asterisk module is loaded in memory
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Checks if a module is loaded. Use the full module name
as shown by the list in "module list". 
Returns "1" if module exists in memory, otherwise "0".

\end{verbatim}


\section{IFTIME}
\subsection{Syntax}
\begin{verbatim}
IFTIME(<timespec>?[<true>][:<false>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Temporal Conditional: Returns the data following '?' if true else the data following ':'
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{ISNULL}
\subsection{Syntax}
\begin{verbatim}
ISNULL(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
NULL Test: Returns 1 if NULL or 0 otherwise
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{KEYPADHASH}
\subsection{Syntax}
\begin{verbatim}
KEYPADHASH(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Hash the letters in the string into the equivalent keypad numbers.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Example:  ${KEYPADHASH(Les)} returns "537"

\end{verbatim}


\section{LEN}
\subsection{Syntax}
\begin{verbatim}
LEN(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the length of the argument given
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{LOCAL}
\subsection{Syntax}
\begin{verbatim}
LOCAL(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Variables local to the gosub stack frame
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{MAILBOX\_EXISTS}
\subsection{Syntax}
\begin{verbatim}
MAILBOX_EXISTS(<vmbox>[@<context>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Tell if a mailbox is configured
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a boolean of whether the corresponding mailbox exists.  If context
is not specified, defaults to the "default" context.

\end{verbatim}


\section{MATH}
\subsection{Syntax}
\begin{verbatim}
MATH(<number1><op><number2>[,<type_of_result>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Performs Mathematical Functions
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Perform calculation on number1 to number2. Valid ops are: 
    +,-,/,*,%,<<,>>,^,AND,OR,XOR,<,>,>=,<=,==
and behave as their C equivalents.
<type_of_result> - wanted type of result:
	f, float - float(default)
	i, int - integer,
	h, hex - hex,
	c, char - char
Example: Set(i=${MATH(123%16,int)}) - sets var i=11
\end{verbatim}


\section{MD5}
\subsection{Syntax}
\begin{verbatim}
MD5(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Computes an MD5 digest
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{MINIVMACCOUNT}
\subsection{Syntax}
\begin{verbatim}
MINIVMACCOUNT(<account>:item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets MiniVoicemail account information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- path           Path to account mailbox (if account exists, otherwise temporary mailbox)
- hasaccount     1 if static Minivm account exists, 0 otherwise
- fullname       Full name of account owner
- email          Email address used for account
- etemplate      E-mail template for account (default template if none is configured)
- ptemplate      Pager template for account (default template if none is configured)
- accountcode    Account code for voicemail account
- pincode        Pin code for voicemail account
- timezone       Time zone for voicemail account
- language       Language for voicemail account
- <channel variable name> Channel variable value (set in configuration for account)


\end{verbatim}


\section{MINIVMCOUNTER}
\subsection{Syntax}
\begin{verbatim}
MINIVMCOUNTER(<account>:name[:operand])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Reads or sets counters for MiniVoicemail message
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid operands for changing the value of a counter when assigning a value are:
- i   Increment by value
- d   Decrement by value
- s   Set to value

The counters never goes below zero.
- The name of the counter is a string, up to 10 characters
- If account is given and it exists, the counter is specific for the account
- If account is a domain and the domain directory exists, counters are specific for a domain
The operation is atomic and the counter is locked while changing the value

The counters are stored as text files in the minivm account directories. It might be better to use
realtime functions if you are using a database to operate your Asterisk

\end{verbatim}


\section{ODBC\_ANTIGF}
\subsection{Syntax}
\begin{verbatim}
ODBC_ANTIGF(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}.  This function may only be read, not set.

SQL:
SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'

\end{verbatim}


\section{ODBC\_FETCH}
\subsection{Syntax}
\begin{verbatim}
ODBC_FETCH(<result-id>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Fetch a row from a multirow query
\end{verbatim}
\subsection{Description}
\begin{verbatim}
For queries which are marked as mode=multirow, the original query returns a
result-id from which results may be fetched.  This function implements the
actual fetch of the results.

\end{verbatim}


\section{ODBC\_PRESENCE}
\subsection{Syntax}
\begin{verbatim}
ODBC_PRESENCE(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}.  When setting the function, the values are provided
either in whole as ${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.

Read:
SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'

Write:
UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'

\end{verbatim}


\section{ODBC\_SQL}
\subsection{Syntax}
\begin{verbatim}
ODBC_SQL(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}.  This function may only be read, not set.

SQL:
${ARG1}

\end{verbatim}


\section{QUEUE\_MEMBER\_COUNT}
\subsection{Syntax}
\begin{verbatim}
QUEUE_MEMBER_COUNT(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count number of members answering a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the number of members currently associated with the specified queue.

\end{verbatim}


\section{QUEUE\_MEMBER\_LIST}
\subsection{Syntax}
\begin{verbatim}
QUEUE_MEMBER_LIST(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns a list of interfaces on a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a comma-separated list of members associated with the specified queue.

\end{verbatim}


\section{QUEUE\_VARIABLES}
\subsection{Syntax}
\begin{verbatim}
QUEUE_VARIABLES(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return Queue information in variables
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Makes the following queue variables available.
QUEUEMAX maxmimum number of calls allowed
QUEUESTRATEGY the strategy of the queue
QUEUECALLS number of calls currently in the queue
QUEUEHOLDTIME current average hold time
QUEUECOMPLETED number of completed calls for the queue
QUEUEABANDONED number of abandoned calls
QUEUESRVLEVEL queue service level
QUEUESRVLEVELPERF current service level performance
Returns 0 if queue is found and setqueuevar is defined, -1 otherwise
\end{verbatim}


\section{QUEUE\_WAITING\_COUNT}
\subsection{Syntax}
\begin{verbatim}
QUEUE_WAITING_COUNT(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count number of calls currently waiting in a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the number of callers currently waiting in the specified queue.

\end{verbatim}


\section{QUOTE}
\subsection{Syntax}
\begin{verbatim}
QUOTE(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Quotes a given string, escaping embedded quotes as necessary
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{RAND}
\subsection{Syntax}
\begin{verbatim}
RAND([min][|max])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Choose a random number in a range
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Choose a random number between min and max.  Min defaults to 0, if not
specified, while max defaults to RAND_MAX (2147483647 on many systems).
  Example:  Set(junky=${RAND(1|8)}); 
  Sets junky to a random number between 1 and 8, inclusive.

\end{verbatim}


\section{REALTIME}
\subsection{Syntax}
\begin{verbatim}
REALTIME(family|fieldmatch[|value[|delim1[|delim2]]]) on read
REALTIME(family|fieldmatch|value|field) on write

\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
RealTime Read/Write Functions
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will read or write values from/to a RealTime repository.
REALTIME(....) will read names/values from the repository, and 
REALTIME(....)= will write a new value/field to the repository. On a
read, this function returns a delimited text string. The name/value 
pairs are delimited by delim1, and the name and value are delimited 
between each other with delim2. The default for delim1 is '|' and   
the default for delim2 is '='. If there is no match, NULL will be   
returned by the function. On a write, this function will always     
return NULL. 

\end{verbatim}


\section{REGEX}
\subsection{Syntax}
\begin{verbatim}
REGEX("<regular expression>" <data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Regular Expression
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns 1 if data matches regular expression, or 0 otherwise.
Please note that the space following the double quotes separating the regex from the data
is optional and if present, is skipped. If a space is desired at the beginning of the data,
then put two spaces there; the second will not be skipped.

\end{verbatim}


\section{SET}
\subsection{Syntax}
\begin{verbatim}
SET(<varname>=[<value>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
SET assigns a value to a channel variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{SHA1}
\subsection{Syntax}
\begin{verbatim}
SHA1(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Computes a SHA1 digest
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Generate a SHA1 digest via the SHA1 algorythm.
 Example:  Set(sha1hash=${SHA1(junky)})
 Sets the asterisk variable sha1hash to the string '60fa5675b9303eb62f99a9cd47f9f5837d18f9a0'
 which is known as his hash

\end{verbatim}


\section{SHELL}
\subsection{Syntax}
\begin{verbatim}
SHELL(<command>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Executes a command as if you were at a shell.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the value from a system command
  Example:  Set(foo=${SHELL(echo "bar")})
  Note:  When using the SHELL() dialplan function, your "SHELL" is /bin/sh,
  which may differ as to the underlying shell, depending upon your production
  platform.  Also keep in mind that if you are using a common path, you should
  be mindful of race conditions that could result from two calls running
  SHELL() simultaneously.

\end{verbatim}


\section{SIP\_HEADER}
\subsection{Syntax}
\begin{verbatim}
SIP_HEADER(<name>[,<number>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the specified SIP header
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Since there are several headers (such as Via) which can occur multiple
times, SIP_HEADER takes an optional second argument to specify which header with
that name to retrieve. Headers start at offset 1.

\end{verbatim}


\section{SIPCHANINFO}
\subsection{Syntax}
\begin{verbatim}
SIPCHANINFO(item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the specified SIP parameter from the current channel
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- peerip                The IP address of the peer.
- recvip                The source IP address of the peer.
- from                  The URI from the From: header.
- uri                   The URI from the Contact: header.
- useragent             The useragent.
- peername              The name of the peer.
- t38passthrough        1 if T38 is offered or enabled in this channel, otherwise 0

\end{verbatim}


\section{SIPPEER}
\subsection{Syntax}
\begin{verbatim}
SIPPEER(<peername>[|item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets SIP peer information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- ip (default)          The IP address.
- port                  The port number
- mailbox               The configured mailbox.
- context               The configured context.
- expire                The epoch time of the next expire.
- dynamic               Is it dynamic? (yes/no).
- callerid_name         The configured Caller ID name.
- callerid_num          The configured Caller ID number.
- callgroup             The configured Callgroup.
- pickupgroup           The configured Pickupgroup.
- codecs                The configured codecs.
- status                Status (if qualify=yes).
- regexten              Registration extension
- limit                 Call limit (call-limit)
- curcalls              Current amount of calls 
                        Only available if call-limit is set
- language              Default language for peer
- accountcode           Account code for this peer
- useragent             Current user agent id for peer
- codec[x]              Preferred codec index number 'x' (beginning with zero).


\end{verbatim}


\section{SORT}
\subsection{Syntax}
\begin{verbatim}
SORT(key1:val1[...][,keyN:valN])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sorts a list of key/vals into a list of keys, based upon the vals
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Takes a comma-separated list of keys and values, each separated by a colon, and returns a
comma-separated list of the keys, sorted by their values.  Values will be evaluated as
floating-point numbers.

\end{verbatim}


\section{SPEECH}
\subsection{Syntax}
\begin{verbatim}
SPEECH(argument)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets information about speech recognition results.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets information about speech recognition results.
status:   Returns 1 upon speech object existing, or 0 if not
spoke:  Returns 1 if spoker spoke, or 0 if not
results:  Returns number of results that were recognized

\end{verbatim}


\section{SPEECH\_ENGINE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_ENGINE(name)=value
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Change a speech engine specific attribute.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Changes a speech engine specific attribute.

\end{verbatim}


\section{SPEECH\_GRAMMAR}
\subsection{Syntax}
\begin{verbatim}
SPEECH_GRAMMAR([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the matched grammar of a result if available.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the matched grammar of a result if available.

\end{verbatim}


\section{SPEECH\_RESULTS\_TYPE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_RESULTS_TYPE()=results type
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sets the type of results that will be returned.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Sets the type of results that will be returned. Valid options are normal or nbest.
\end{verbatim}


\section{SPEECH\_SCORE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_SCORE([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the confidence score of a result.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the confidence score of a result.

\end{verbatim}


\section{SPEECH\_TEXT}
\subsection{Syntax}
\begin{verbatim}
SPEECH_TEXT([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the recognized text of a result.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the recognized text of a result.

\end{verbatim}


\section{SPRINTF}
\subsection{Syntax}
\begin{verbatim}
SPRINTF(<format>|<arg1>[|...<argN>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Format a variable according to a format string
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Parses the format string specified and returns a string matching that format.
Supports most options supported by sprintf(3).  Returns a shortened string if
a format specifier is not recognized.

\end{verbatim}


\section{SQL\_ESC}
\subsection{Syntax}
\begin{verbatim}
SQL_ESC(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Escapes single ticks for use in SQL statements
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Used in SQL templates to escape data which may contain single ticks (') which
are otherwise used to delimit data.  For example:
SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}'

\end{verbatim}


\section{STAT}
\subsection{Syntax}
\begin{verbatim}
STAT(<flag>,<filename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Does a check on the specified file
\end{verbatim}
\subsection{Description}
\begin{verbatim}
flag may be one of the following:
  d - Checks if the file is a directory
  e - Checks if the file exists
  f - Checks if the file is a regular file
  m - Returns the file mode (in octal)
  s - Returns the size (in bytes) of the file
  A - Returns the epoch at which the file was last accessed
  C - Returns the epoch at which the inode was last changed
  M - Returns the epoch at which the file was last modified

\end{verbatim}


\section{STRFTIME}
\subsection{Syntax}
\begin{verbatim}
STRFTIME([<epoch>][|[timezone][|format]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the current date/time in a specified format.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{STRPTIME}
\subsection{Syntax}
\begin{verbatim}
STRPTIME(<datetime>|<timezone>|<format>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the epoch of the arbitrary date/time string structured as described in the format.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This is useful for converting a date into an EPOCH time, possibly to pass to
an application like SayUnixTime or to calculate the difference between two
date strings.

Example:
  ${STRPTIME(2006-03-01 07:30:35|America/Chicago|%Y-%m-%d %H:%M:%S)} returns 1141219835

\end{verbatim}


\section{TIMEOUT}
\subsection{Syntax}
\begin{verbatim}
TIMEOUT(timeouttype)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets timeouts on the channel. Timeout values are in seconds.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets various channel timeouts. The timeouts that can be
manipulated are:

absolute: The absolute maximum amount of time permitted for a call.  A
	   setting of 0 disables the timeout.

digit:    The maximum amount of time permitted between digits when the
          user is typing in an extension.  When this timeout expires,
          after the user has started to type in an extension, the
          extension will be considered complete, and will be
          interpreted.  Note that if an extension typed in is valid,
          it will not have to timeout to be tested, so typically at
          the expiry of this timeout, the extension will be considered
          invalid (and thus control would be passed to the 'i'
          extension, or if it doesn't exist the call would be
          terminated).  The default timeout is 5 seconds.

response: The maximum amount of time permitted after falling through a
	   series of priorities for a channel in which the user may
	   begin typing an extension.  If the user does not type an
	   extension in this amount of time, control will pass to the
	   't' extension if it exists, and if not the call would be
	   terminated.  The default timeout is 10 seconds.

\end{verbatim}


\section{TXTCIDNAME}
\subsection{Syntax}
\begin{verbatim}
TXTCIDNAME(<number>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
TXTCIDNAME looks up a caller name via DNS
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function looks up the given phone number in DNS to retrieve
the caller id name.  The result will either be blank or be the value
found in the TXT record in DNS.

\end{verbatim}


\section{URIDECODE}
\subsection{Syntax}
\begin{verbatim}
URIDECODE(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Decodes a URI-encoded string according to RFC 2396.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{URIENCODE}
\subsection{Syntax}
\begin{verbatim}
URIENCODE(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Encodes a string to URI-safe encoding according to RFC 2396.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}


\section{VERSION}
\subsection{Syntax}
\begin{verbatim}
VERSION([info])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return the Version info for this Asterisk
\end{verbatim}
\subsection{Description}
\begin{verbatim}
If there are no arguments, return the version of Asterisk in this format: SVN-branch-1.4-r44830M
If the argument is 'ASTERISK_VERSION_NUM', a string of digits is returned (right now fixed at 999999).
If the argument is 'BUILD_USER', the string representing the user's name whose account was used to configure Asterisk, is returned.
If the argument is 'BUILD_HOSTNAME', the string representing the name of the host on which Asterisk was configured, is returned.
If the argument is 'BUILD_MACHINE', the string representing the type of machine on which Asterisk was configured, is returned.
If the argument is 'BUILD_OS', the string representing the OS of the machine on which Asterisk was configured, is returned.
If the argument is 'BUILD_DATE', the string representing the date on which Asterisk was configured, is returned.
If the argument is 'BUILD_KERNEL', the string representing the kernel version of the machine on which Asterisk was configured, is returned .
  Example:  Set(junky=${VERSION()}; 
  Sets junky to the string 'SVN-branch-1.6-r74830M', or possibly, 'SVN-trunk-r45126M'.

\end{verbatim}


\section{VMCOUNT}
\subsection{Syntax}
\begin{verbatim}
VMCOUNT(vmbox[@context][|folder])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the voicemail in a specified mailbox
\end{verbatim}
\subsection{Description}
\begin{verbatim}
  context - defaults to "default"
  folder  - defaults to "INBOX"

\end{verbatim}