37 #include <netinet/in.h>
49 static const char app[] =
"ADSIProg";
93 { 15,
"DISTINCTIVERING" },
95 { 17,
"REMINDERRING" },
96 { 18,
"SPECIALRING" },
112 #define STATE_NORMAL 0
113 #define STATE_INKEY 1
114 #define STATE_INSUB 2
117 #define MAX_RET_CODE 20
118 #define MAX_SUB_LEN 255
119 #define MAX_MAIN_LEN 1600
121 #define ARG_STRING (1 << 0)
122 #define ARG_NUMBER (1 << 1)
191 if ((strlen(src) > 1) && src[0] ==
'\"') {
197 if (maxlen > strlen(src) - 1)
198 maxlen = strlen(src) - 1;
199 memcpy(out, src, maxlen);
200 ((
char *)out)[maxlen] =
'\0';
205 if (sscanf(src,
"%30o", (
unsigned *)out) != 1)
209 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
211 }
else if ((strlen(src) > 2) && (src[0] ==
'0') && (tolower(src[1]) ==
'x')) {
215 if (sscanf(src + 2,
"%30x", (
unsigned int *)out) != 1)
219 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
225 if (sscanf(src,
"%30d", (
int *)out) != 1)
229 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
236 static char *
get_token(
char **buf,
const char *script,
int lineno)
238 char *tmp = *buf, *keyword;
242 while(*tmp && (*tmp < 33))
247 while(*tmp && ((*tmp > 32) || quoted)) {
259 while(*tmp && (*tmp < 33))
273 if (!(a =
get_token(&args, script, lineno))) {
274 ast_log(
LOG_WARNING,
"Expecting something to send for SENDDTMF at line %d of %s\n", lineno, script);
279 ast_log(
LOG_WARNING,
"Invalid token for SENDDTMF at line %d of %s\n", lineno, script);
286 if (strchr(validdtmf, *a)) {
291 ast_log(
LOG_WARNING,
"'%c' is not a valid DTMF tone at line %d of %s\n", *a, lineno, script);
300 char *page =
get_token(&args, script, lineno);
301 char *gline =
get_token(&args, script, lineno);
305 if (!page || !gline) {
306 ast_log(
LOG_WARNING,
"Expecting page and line number for GOTOLINE at line %d of %s\n", lineno, script);
310 if (!strcasecmp(page,
"INFO"))
312 else if (!strcasecmp(page,
"COMM"))
315 ast_log(
LOG_WARNING,
"Expecting either 'INFO' or 'COMM' page, got got '%s' at line %d of %s\n", page, lineno, script);
320 ast_log(
LOG_WARNING,
"Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
333 char *dir =
get_token(&args, script, lineno);
334 char *gline =
get_token(&args, script, lineno);
338 if (!dir || !gline) {
339 ast_log(
LOG_WARNING,
"Expecting direction and number of lines for GOTOLINEREL at line %d of %s\n", lineno, script);
343 if (!strcasecmp(dir,
"UP"))
345 else if (!strcasecmp(dir,
"DOWN"))
348 ast_log(
LOG_WARNING,
"Expecting either 'UP' or 'DOWN' direction, got '%s' at line %d of %s\n", dir, lineno, script);
353 ast_log(
LOG_WARNING,
"Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
366 char *gtime =
get_token(&args, script, lineno);
370 ast_log(
LOG_WARNING,
"Expecting number of milliseconds to wait at line %d of %s\n", lineno, script);
375 ast_log(
LOG_WARNING,
"Invalid delay milliseconds '%s' at line %d of %s\n", gtime, lineno, script);
391 char *gstate =
get_token(&args, script, lineno);
400 ast_log(
LOG_WARNING,
"Invalid state number '%s' at line %d of %s\n", gstate, lineno, script);
412 char *tok =
get_token(&args, script, lineno);
415 ast_log(
LOG_WARNING,
"Clearing timer requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
432 for (x = 0; x < state->
numflags; x++) {
434 return &state->
flags[x];
455 char *tok =
get_token(&args, script, lineno);
460 ast_log(
LOG_WARNING,
"Setting flag requires a flag number at line %d of %s\n", lineno, script);
469 if (!(flag =
getflagbyname(state, sname, script, lineno, 0))) {
470 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
475 buf[1] = ((flag->
id & 0x7) << 4) | 1;
482 char *tok =
get_token(&args, script, lineno);
487 ast_log(
LOG_WARNING,
"Clearing flag requires a flag number at line %d of %s\n", lineno, script);
496 if (!(flag =
getflagbyname(state, sname, script, lineno, 0))) {
497 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
502 buf[1] = ((flag->
id & 0x7) << 4);
509 char *tok =
get_token(&args, script, lineno);
518 ast_log(
LOG_WARNING,
"Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
533 for (x = 0; x <
ARRAY_LEN(events); x++) {
534 if (!strcasecmp(events[x].name, name))
545 for (x = 0; x <
ARRAY_LEN(justify); x++) {
546 if (!strcasecmp(justify[x].name, name))
547 return justify[x].
id;
557 for (x = 0; x < state->
numkeys; x++) {
558 if (!strcasecmp(state->
keys[x].
vname, name))
559 return &state->
keys[x];
578 for (x = 0; x < state->
numsubs; x++) {
579 if (!strcasecmp(state->
subs[x].
vname, name))
580 return &state->
subs[x];
647 char *tok, newkey[80];
648 int bytes, x, flagid = 0;
649 unsigned char keyid[6];
653 for (x = 0; x < 7; x++) {
655 if (!(tok =
get_token(&args, script, lineno)))
657 if (!strcasecmp(tok,
"UNLESS")) {
659 if (!(tok =
get_token(&args, script, lineno)))
660 ast_log(
LOG_WARNING,
"Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
662 ast_log(
LOG_WARNING,
"Invalid flag name '%s' at line %d of %s\n", tok, lineno, script);
663 else if (!(flag =
getflagbyname(state, newkey, script, lineno, 0)))
664 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", newkey, lineno, script);
667 if ((tok =
get_token(&args, script, lineno)))
668 ast_log(
LOG_WARNING,
"Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
672 ast_log(
LOG_WARNING,
"Only 6 keys can be defined, ignoring '%s' at line %d of %s\n", tok, lineno, script);
680 if (!(key =
getkeybyname(state, newkey, script, lineno)))
685 buf[1] = (flagid & 0x7) << 3 | (x & 0x7);
686 for (bytes = 0; bytes < x; bytes++)
687 buf[bytes + 2] = keyid[bytes];
694 char *tok, dispname[80];
695 int line = 0, flag = 0, cmd = 3;
700 ast_log(
LOG_WARNING,
"Invalid display name: %s at line %d of %s\n", tok ? tok :
"<nothing>", lineno, script);
705 ast_log(
LOG_WARNING,
"Display '%s' is undefined at line %d of %s\n", dispname, lineno, script);
709 if (!(tok =
get_token(&args, script, lineno)) || strcasecmp(tok,
"AT")) {
716 ast_log(
LOG_WARNING,
"Invalid line: '%s' at line %d of %s\n", tok ? tok :
"<nothing>", lineno, script);
720 if ((tok =
get_token(&args, script, lineno)) && !strcasecmp(tok,
"NOUPDATE")) {
725 if (tok && !strcasecmp(tok,
"UNLESS")) {
727 if (!(tok =
get_token(&args, script, lineno)))
728 ast_log(
LOG_WARNING,
"Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
730 ast_log(
LOG_WARNING,
"Invalid flag number '%s' at line %d of %s\n", tok, lineno, script);
732 if ((tok =
get_token(&args, script, lineno)))
733 ast_log(
LOG_WARNING,
"Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
737 buf[1] = (cmd << 6) | (disp->
id & 0x3f);
738 buf[2] = ((line & 0x1f) << 3) | (flag & 0x7);
745 char *tok =
get_token(&args, script, lineno);
748 ast_log(
LOG_WARNING,
"Clearing display requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
757 char *tok =
get_token(&args, script, lineno);
760 ast_log(
LOG_WARNING,
"Digitdirect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
769 char *tok =
get_token(&args, script, lineno);
772 ast_log(
LOG_WARNING,
"CLEARCB1 requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
781 char *tok =
get_token(&args, script, lineno);
784 ast_log(
LOG_WARNING,
"Digitcollect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
793 char *tok =
get_token(&args, script, lineno);
803 ast_log(
LOG_WARNING,
"Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
807 if (!(sub =
getsubbyname(state, subscr, script, lineno)))
818 char *tok =
get_token(&args, script, lineno);
819 char subscr[80], sname[80];
820 int sawin = 0, event, snums[8], scnt = 0, x;
824 ast_log(
LOG_WARNING,
"Missing event for 'ONEVENT' at line %d of %s\n", lineno, script);
829 ast_log(
LOG_WARNING,
"'%s' is not a valid event name, at line %d of %s\n", args, lineno, script);
834 while ((!sawin && !strcasecmp(tok,
"IN")) || (sawin && !strcasecmp(tok,
"OR"))) {
837 ast_log(
LOG_WARNING,
"No more than 8 states may be specified for inclusion at line %d of %s\n", lineno, script);
843 ast_log(
LOG_WARNING,
"'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
846 if ((snums[scnt] =
getstatebyname(state, sname, script, lineno, 0) == NULL)) {
847 ast_log(
LOG_WARNING,
"State '%s' not declared at line %d of %s\n", sname, lineno, script);
851 if (!(tok =
get_token(&args, script, lineno)))
854 if (!tok || strcasecmp(tok,
"GOTO")) {
858 ast_log(
LOG_WARNING,
"Got '%s' while looking for 'GOTO' or 'OR' at line %d of %s\n", tok, lineno, script);
860 ast_log(
LOG_WARNING,
"Got '%s' while looking for 'GOTO' or 'IN' at line %d of %s\n", tok, lineno, script);
862 if (!(tok =
get_token(&args, script, lineno))) {
867 ast_log(
LOG_WARNING,
"Invalid subscript '%s' at line %d of %s\n", tok, lineno, script);
870 if (!(sub =
getsubbyname(state, subscr, script, lineno)))
874 buf[2] = sub->
id | 0x80;
875 for (x = 0; x < scnt; x++)
876 buf[3 + x] = snums[x];
892 {
"WAITDIALTONE", 0x84 },
895 {
"SENDCHARS", 0x87 },
896 {
"CLEARCHARS", 0x88 },
897 {
"BACKSPACE", 0x89 },
902 {
"PAGEDOWN", 0x8e },
905 {
"DIALPULSEONE", 0x91 },
906 {
"DATAMODE", 0x92 },
907 {
"VOICEMODE", 0x93 },
954 if ((kcmds[x].
id > -1) && !strcasecmp(kcmds[x].
name, code)) {
957 code, kcmds[x].
id, args, state, script, lineno);
961 ast_log(
LOG_WARNING,
"No space for '%s' code in key '%s' at line %d of %s\n", kcmds[x].name, key->
vname, lineno, script);
963 if ((unused =
get_token(&args, script, lineno)))
964 ast_log(
LOG_WARNING,
"'%s' takes no arguments at line %d of %s (token is '%s')\n", kcmds[x].name, lineno, script, unused);
969 ast_log(
LOG_WARNING,
"No space for '%s' code in key '%s' at line %d of %s\n", kcmds[x].name, key->
vname, lineno, script);
982 for (x = 0; x <
ARRAY_LEN(opcmds); x++) {
983 if ((opcmds[x].
id > -1) && !strcasecmp(opcmds[x].
name, code)) {
986 code, opcmds[x].
id, args, state, script, lineno);
987 if ((sub->
datalen + res + 1) <= max)
990 ast_log(
LOG_WARNING,
"No space for '%s' code in subscript '%s' at line %d of %s\n", opcmds[x].name, sub->
vname, lineno, script);
994 if ((unused =
get_token(&args, script, lineno)))
995 ast_log(
LOG_WARNING,
"'%s' takes no arguments at line %d of %s (token is '%s')\n", opcmds[x].name, lineno, script, unused);
996 if ((sub->
datalen + 2) <= max) {
1000 ast_log(
LOG_WARNING,
"No space for '%s' code in key '%s' at line %d of %s\n", opcmds[x].name, sub->
vname, lineno, script);
1016 char *keyword =
get_token(&buf, script, lineno);
1017 char *
args, vname[256], tmp[80], tmp2[80];
1018 int lrci, wi, event;
1025 switch(state->
state) {
1027 if (!strcasecmp(keyword,
"DESCRIPTION")) {
1028 if ((args =
get_token(&buf, script, lineno))) {
1030 ast_log(
LOG_WARNING,
"'%s' is not a valid token for DESCRIPTION at line %d of %s\n", args, lineno, script);
1032 ast_log(
LOG_WARNING,
"Missing argument for DESCRIPTION at line %d of %s\n", lineno, script);
1033 }
else if (!strcasecmp(keyword,
"VERSION")) {
1034 if ((args =
get_token(&buf, script, lineno))) {
1036 ast_log(
LOG_WARNING,
"'%s' is not a valid token for VERSION at line %d of %s\n", args, lineno, script);
1038 ast_log(
LOG_WARNING,
"Missing argument for VERSION at line %d of %s\n", lineno, script);
1039 }
else if (!strcasecmp(keyword,
"SECURITY")) {
1040 if ((args =
get_token(&buf, script, lineno))) {
1042 ast_log(
LOG_WARNING,
"'%s' is not a valid token for SECURITY at line %d of %s\n", args, lineno, script);
1044 ast_log(
LOG_WARNING,
"Missing argument for SECURITY at line %d of %s\n", lineno, script);
1045 }
else if (!strcasecmp(keyword,
"FDN")) {
1046 if ((args =
get_token(&buf, script, lineno))) {
1048 ast_log(
LOG_WARNING,
"'%s' is not a valid token for FDN at line %d of %s\n", args, lineno, script);
1051 }
else if (!strcasecmp(keyword,
"KEY")) {
1052 if (!(args =
get_token(&buf, script, lineno))) {
1053 ast_log(
LOG_WARNING,
"KEY definition missing name at line %d of %s\n", lineno, script);
1057 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1065 ast_log(
LOG_WARNING,
"Cannot redefine key '%s' at line %d of %s\n", vname, lineno, script);
1068 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1069 ast_log(
LOG_WARNING,
"Expecting 'IS', but got '%s' at line %d of %s\n", args ? args :
"<nothing>", lineno, script);
1072 if (!(args =
get_token(&buf, script, lineno))) {
1073 ast_log(
LOG_WARNING,
"KEY definition missing short name at line %d of %s\n", lineno, script);
1077 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY short name at line %d of %s\n", args, lineno, script);
1080 if ((args =
get_token(&buf, script, lineno))) {
1081 if (strcasecmp(args,
"OR")) {
1082 ast_log(
LOG_WARNING,
"Expecting 'OR' but got '%s' instead at line %d of %s\n", args, lineno, script);
1085 if (!(args =
get_token(&buf, script, lineno))) {
1086 ast_log(
LOG_WARNING,
"KEY definition missing optional long name at line %d of %s\n", lineno, script);
1090 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY long name at line %d of %s\n", args, lineno, script);
1096 if (strlen(tmp2) > 18) {
1097 ast_log(
LOG_WARNING,
"Truncating full name to 18 characters at line %d of %s\n", lineno, script);
1100 if (strlen(tmp) > 7) {
1101 ast_log(
LOG_WARNING,
"Truncating short name to 7 bytes at line %d of %s\n", lineno, script);
1109 memcpy(state->
key->
retstr + 3, tmp2, strlen(tmp2));
1123 }
else if (!strcasecmp(keyword,
"SUB")) {
1124 if (!(args =
get_token(&buf, script, lineno))) {
1125 ast_log(
LOG_WARNING,
"SUB definition missing name at line %d of %s\n", lineno, script);
1129 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1137 ast_log(
LOG_WARNING,
"Cannot redefine subroutine '%s' at line %d of %s\n", vname, lineno, script);
1145 if (state->
sub->
id) {
1153 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1154 ast_log(
LOG_WARNING,
"Expecting 'IS', but got '%s' at line %d of %s\n", args ? args :
"<nothing>", lineno, script);
1158 }
else if (!strcasecmp(keyword,
"STATE")) {
1159 if (!(args =
get_token(&buf, script, lineno))) {
1160 ast_log(
LOG_WARNING,
"STATE definition missing name at line %d of %s\n", lineno, script);
1164 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a STATE name at line %d of %s\n", args, lineno, script);
1168 ast_log(
LOG_WARNING,
"State '%s' is already defined at line %d of %s\n", vname, lineno, script);
1172 }
else if (!strcasecmp(keyword,
"FLAG")) {
1173 if (!(args =
get_token(&buf, script, lineno))) {
1174 ast_log(
LOG_WARNING,
"FLAG definition missing name at line %d of %s\n", lineno, script);
1178 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a FLAG name at line %d of %s\n", args, lineno, script);
1186 }
else if (!strcasecmp(keyword,
"DISPLAY")) {
1189 if (!(args =
get_token(&buf, script, lineno))) {
1190 ast_log(
LOG_WARNING,
"SUB definition missing name at line %d of %s\n", lineno, script);
1194 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1203 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1207 if (!(args =
get_token(&buf, script, lineno))) {
1212 ast_log(
LOG_WARNING,
"Token '%s' is not valid column 1 text at line %d of %s\n", args, lineno, script);
1215 if (strlen(tmp) > 20) {
1216 ast_log(
LOG_WARNING,
"Truncating column one to 20 characters at line %d of %s\n", lineno, script);
1219 memcpy(disp->
data + 5, tmp, strlen(tmp));
1220 disp->
datalen = strlen(tmp) + 5;
1226 if (strlen(tmp) > 20) {
1227 ast_log(
LOG_WARNING,
"Truncating column two to 20 characters at line %d of %s\n", lineno, script);
1230 memcpy(disp->
data + disp->
datalen, tmp, strlen(tmp));
1235 if (!strcasecmp(args,
"JUSTIFY")) {
1238 ast_log(
LOG_WARNING,
"Qualifier 'JUSTIFY' requires an argument at line %d of %s\n", lineno, script);
1243 ast_log(
LOG_WARNING,
"'%s' is not a valid justification at line %d of %s\n", args, lineno, script);
1246 }
else if (!strcasecmp(args,
"WRAP")) {
1249 ast_log(
LOG_WARNING,
"'%s' is not a known qualifier at line %d of %s\n", args, lineno, script);
1258 disp->
data[0] = 129;
1260 disp->
data[2] = ((lrci & 0x3) << 6) | disp->
id;
1262 disp->
data[4] = 0xff;
1269 if (!strcasecmp(keyword,
"ENDKEY")) {
1276 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in SOFTKEY definition at line %d of %s\n", keyword, lineno, script);
1282 if (!strcasecmp(keyword,
"ENDIF")) {
1288 }
else if (!strcasecmp(keyword,
"GOTO")) {
1289 if (!(args =
get_token(&buf, script, lineno))) {
1290 ast_log(
LOG_WARNING,
"GOTO clause missing Subscript name at line %d of %s\n", lineno, script);
1294 ast_log(
LOG_WARNING,
"'%s' is not a valid subscript name token at line %d of %s\n", args, lineno, script);
1297 if (!(newsub =
getsubbyname(state, tmp, script, lineno)))
1309 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in IF clause at line %d of %s\n", keyword, lineno, script);
1316 if (!strcasecmp(keyword,
"ENDSUB")) {
1322 if (state->
sub->
id) {
1327 }
else if (!strcasecmp(keyword,
"IFEVENT")) {
1328 if (!(args =
get_token(&buf, script, lineno))) {
1329 ast_log(
LOG_WARNING,
"IFEVENT clause missing Event name at line %d of %s\n", lineno, script);
1336 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"THEN")) {
1337 ast_log(
LOG_WARNING,
"IFEVENT clause missing 'THEN' at line %d of %s\n", lineno, script);
1352 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in SUB definition at line %d of %s\n", keyword, lineno, script);
1365 char fn[256], buf[256], *c;
1366 int lineno = 0, x, err;
1369 if (script[0] ==
'/')
1374 if (!(f = fopen(fn,
"r"))) {
1387 if (!fgets(buf,
sizeof(buf), f)) {
1393 buf[strlen(buf) - 1] =
'\0';
1395 if ((c = strchr(buf,
';')))
1403 switch(scr->
state) {
1418 for (x = 0; x < scr->
numkeys; x++) {
1426 for (x = 0; x < scr->
numsubs; x++) {
1431 if (x == (scr->
numsubs - 1)) {
1444 #ifdef DUMP_MESSAGES
1445 static void dump_message(
char *
type,
char *vname,
unsigned char *buf,
int buflen)
1448 printf(
"%s %s: [ ", type, vname);
1449 for (x = 0; x < buflen; x++)
1450 printf(
"%02x ", buf[x]);
1459 unsigned char buf[1024];
1471 ast_verb(3,
"User rejected download attempt\n");
1479 for (x = 0; x < scr->
numkeys; x++) {
1490 #ifdef DUMP_MESSAGES
1514 #ifdef DUMP_MESSAGES
1527 for (x = 0; x < scr->
numsubs; x++) {
1538 #ifdef DUMP_MESSAGES
1556 ast_verb(3,
"Download attempt failed\n");
1571 data =
"asterisk.adsi";
1574 ast_verb(3,
"ADSI Unavailable on CPE. Not bothering to try.\n");
1576 ast_verb(3,
"ADSI Available on CPE. Attempting Upload.\n");
1598 .nonoptreq =
"res_adsi",
static char * get_token(char **buf, const char *script, int lineno)
enum sip_cc_notify_state state
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static int process_opcode(struct adsi_subscript *sub, char *code, char *args, struct adsi_script *state, const char *script, int lineno)
int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
static struct _map_x_s dtmfstr[]
mapping between dtmf flags and strings
static int adsi_prog(struct ast_channel *chan, const char *script)
static int starttimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
Check if scripts for a given app are already loaded. Version may be -1, if any version is okay...
struct adsi_state states[256]
struct adsi_soft_key keys[62]
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static struct adsi_event justify[]
ADSI Support (built upon Caller*ID)
static int showkeys(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
int ast_unregister_application(const char *app)
Unregister an application.
static int load_module(void)
static int process_returncode(struct adsi_soft_key *key, char *code, char *args, struct adsi_script *state, const char *script, int lineno)
#define ast_verb(level,...)
static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
struct adsi_subscript * sub
static int onevent(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static struct adsi_state * getstatebyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)
struct adsi_subscript subs[128]
int ast_adsi_set_line(unsigned char *buf, int page, int line)
Sets the current line and page.
struct adsi_display displays[63]
struct adsi_soft_key * key
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
static int cleartimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
static int digitdirect(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2)
Loads a line of info into the display.
static struct adsi_script * compile_script(const char *script)
Core PBX routines and definitions.
static struct adsi_subscript * getsubbyname(struct adsi_script *state, char *name, const char *script, int lineno)
int ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
static struct adsi_display * getdisplaybyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)
static int set_state(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
const char * ast_config_AST_CONFIG_DIR
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static int subscript(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static int cleardisplay(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
static int adsi_exec(struct ast_channel *chan, const char *data)
int ast_adsi_end_download(struct ast_channel *chan)
static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
#define ADSI_MSG_DOWNLOAD
static int unload_module(void)
static int getjustifybyname(char *name)
static int clearflag(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static int goto_line(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
int ast_adsi_available(struct ast_channel *chan)
Returns non-zero if Channel does or might support ADSI.
int(* add_args)(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int process_token(void *out, char *src, int maxlen, int argtype)
static int geteventbyname(char *name)
static int send_delay(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static int adsi_process(struct adsi_script *state, char *buf, const char *script, int lineno)
static struct adsi_event events[]
int ast_adsi_unload_session(struct ast_channel *chan)
static struct adsi_soft_key * getkeybyname(struct adsi_script *state, char *name, const char *script, int lineno)
static struct adsi_key_cmd opcmds[]
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static struct adsi_key_cmd kcmds[]
static int setflag(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
struct adsi_flag flags[7]
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
static struct adsi_flag * getflagbyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)