44 #include <netinet/in.h> 56 static const char app[] =
"ADSIProg";
100 { 15,
"DISTINCTIVERING" },
102 { 17,
"REMINDERRING" },
103 { 18,
"SPECIALRING" },
119 #define STATE_NORMAL 0 120 #define STATE_INKEY 1 121 #define STATE_INSUB 2 124 #define MAX_RET_CODE 20 125 #define MAX_SUB_LEN 255 126 #define MAX_MAIN_LEN 1600 128 #define ARG_STRING (1 << 0) 129 #define ARG_NUMBER (1 << 1) 189 unsigned char sec[5];
191 unsigned char fdn[5];
198 if ((strlen(src) > 1) && src[0] ==
'\"') {
204 if (maxlen > strlen(src) - 1)
205 maxlen = strlen(src) - 1;
206 memcpy(out, src, maxlen);
207 ((
char *)out)[maxlen] =
'\0';
212 if (sscanf(src,
"%30o", (
unsigned *)
out) != 1)
216 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
218 }
else if ((strlen(src) > 2) && (src[0] ==
'0') && (tolower(src[1]) ==
'x')) {
222 if (sscanf(src + 2,
"%30x", (
unsigned int *)out) != 1)
226 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
232 if (sscanf(src,
"%30d", (
int *)out) != 1)
236 *((
unsigned int *)out) = htonl(*((
unsigned int *)out));
245 char *
tmp = *
buf, *keyword;
249 while(*tmp && (*tmp < 33))
254 while(*tmp && ((*tmp > 32) || quoted)) {
266 while(*tmp && (*tmp < 33))
280 if (!(a =
get_token(&args, script, lineno))) {
281 ast_log(
LOG_WARNING,
"Expecting something to send for SENDDTMF at line %d of %s\n", lineno, script);
286 ast_log(
LOG_WARNING,
"Invalid token for SENDDTMF at line %d of %s\n", lineno, script);
298 ast_log(
LOG_WARNING,
"'%c' is not a valid DTMF tone at line %d of %s\n", *a, lineno, script);
307 char *page =
get_token(&args, script, lineno);
308 char *gline =
get_token(&args, script, lineno);
312 if (!page || !gline) {
313 ast_log(
LOG_WARNING,
"Expecting page and line number for GOTOLINE at line %d of %s\n", lineno, script);
317 if (!strcasecmp(page,
"INFO"))
319 else if (!strcasecmp(page,
"COMM"))
322 ast_log(
LOG_WARNING,
"Expecting either 'INFO' or 'COMM' page, got '%s' at line %d of %s\n", page, lineno, script);
327 ast_log(
LOG_WARNING,
"Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
340 char *dir =
get_token(&args, script, lineno);
341 char *gline =
get_token(&args, script, lineno);
345 if (!dir || !gline) {
346 ast_log(
LOG_WARNING,
"Expecting direction and number of lines for GOTOLINEREL at line %d of %s\n", lineno, script);
350 if (!strcasecmp(dir,
"UP"))
352 else if (!strcasecmp(dir,
"DOWN"))
355 ast_log(
LOG_WARNING,
"Expecting either 'UP' or 'DOWN' direction, got '%s' at line %d of %s\n", dir, lineno, script);
360 ast_log(
LOG_WARNING,
"Invalid line number '%s' at line %d of %s\n", gline, lineno, script);
373 char *gtime =
get_token(&args, script, lineno);
377 ast_log(
LOG_WARNING,
"Expecting number of milliseconds to wait at line %d of %s\n", lineno, script);
382 ast_log(
LOG_WARNING,
"Invalid delay milliseconds '%s' at line %d of %s\n", gtime, lineno, script);
398 char *gstate =
get_token(&args, script, lineno);
407 ast_log(
LOG_WARNING,
"Invalid state number '%s' at line %d of %s\n", gstate, lineno, script);
419 char *tok =
get_token(&args, script, lineno);
422 ast_log(
LOG_WARNING,
"Clearing timer requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
439 for (x = 0; x < state->
numflags; x++) {
441 return &state->
flags[x];
462 char *tok =
get_token(&args, script, lineno);
467 ast_log(
LOG_WARNING,
"Setting flag requires a flag number at line %d of %s\n", lineno, script);
476 if (!(flag =
getflagbyname(state, sname, script, lineno, 0))) {
477 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
482 buf[1] = ((flag->
id & 0x7) << 4) | 1;
489 char *tok =
get_token(&args, script, lineno);
494 ast_log(
LOG_WARNING,
"Clearing flag requires a flag number at line %d of %s\n", lineno, script);
503 if (!(flag =
getflagbyname(state, sname, script, lineno, 0))) {
504 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", sname, lineno, script);
509 buf[1] = ((flag->
id & 0x7) << 4);
516 char *tok =
get_token(&args, script, lineno);
525 ast_log(
LOG_WARNING,
"Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
540 for (x = 0; x <
ARRAY_LEN(events); x++) {
541 if (!strcasecmp(events[x].name, name))
552 for (x = 0; x <
ARRAY_LEN(justify); x++) {
553 if (!strcasecmp(justify[x].name, name))
554 return justify[x].
id;
564 for (x = 0; x < state->
numkeys; x++) {
565 if (!strcasecmp(state->
keys[x].
vname, name))
566 return &state->
keys[x];
585 for (x = 0; x < state->
numsubs; x++) {
586 if (!strcasecmp(state->
subs[x].
vname, name))
587 return &state->
subs[x];
654 char *tok, newkey[80];
655 int bytes, x, flagid = 0;
656 unsigned char keyid[6];
660 for (x = 0; x < 7; x++) {
662 if (!(tok =
get_token(&args, script, lineno)))
664 if (!strcasecmp(tok,
"UNLESS")) {
666 if (!(tok =
get_token(&args, script, lineno)))
667 ast_log(
LOG_WARNING,
"Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
669 ast_log(
LOG_WARNING,
"Invalid flag name '%s' at line %d of %s\n", tok, lineno, script);
670 else if (!(flag =
getflagbyname(state, newkey, script, lineno, 0)))
671 ast_log(
LOG_WARNING,
"Flag '%s' is undeclared at line %d of %s\n", newkey, lineno, script);
674 if ((tok =
get_token(&args, script, lineno)))
675 ast_log(
LOG_WARNING,
"Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
679 ast_log(
LOG_WARNING,
"Only 6 keys can be defined, ignoring '%s' at line %d of %s\n", tok, lineno, script);
687 if (!(key =
getkeybyname(state, newkey, script, lineno)))
692 buf[1] = (flagid & 0x7) << 3 | (x & 0x7);
693 for (bytes = 0; bytes < x; bytes++)
694 buf[bytes + 2] = keyid[bytes];
701 char *tok, dispname[80];
702 int line = 0,
flag = 0, cmd = 3;
707 ast_log(
LOG_WARNING,
"Invalid display name: %s at line %d of %s\n", tok ? tok :
"<nothing>", lineno, script);
712 ast_log(
LOG_WARNING,
"Display '%s' is undefined at line %d of %s\n", dispname, lineno, script);
716 if (!(tok =
get_token(&args, script, lineno)) || strcasecmp(tok,
"AT")) {
723 ast_log(
LOG_WARNING,
"Invalid line: '%s' at line %d of %s\n", tok ? tok :
"<nothing>", lineno, script);
727 if ((tok =
get_token(&args, script, lineno)) && !strcasecmp(tok,
"NOUPDATE")) {
732 if (tok && !strcasecmp(tok,
"UNLESS")) {
734 if (!(tok =
get_token(&args, script, lineno)))
735 ast_log(
LOG_WARNING,
"Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
737 ast_log(
LOG_WARNING,
"Invalid flag number '%s' at line %d of %s\n", tok, lineno, script);
739 if ((tok =
get_token(&args, script, lineno)))
740 ast_log(
LOG_WARNING,
"Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
744 buf[1] = (cmd << 6) | (disp->
id & 0x3f);
745 buf[2] = ((line & 0x1f) << 3) | (
flag & 0x7);
752 char *tok =
get_token(&args, script, lineno);
755 ast_log(
LOG_WARNING,
"Clearing display requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
764 char *tok =
get_token(&args, script, lineno);
767 ast_log(
LOG_WARNING,
"Digitdirect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
776 char *tok =
get_token(&args, script, lineno);
779 ast_log(
LOG_WARNING,
"CLEARCB1 requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
788 char *tok =
get_token(&args, script, lineno);
791 ast_log(
LOG_WARNING,
"Digitcollect requires no arguments ('%s') at line %d of %s\n", tok, lineno, script);
800 char *tok =
get_token(&args, script, lineno);
810 ast_log(
LOG_WARNING,
"Invalid number of seconds '%s' at line %d of %s\n", tok, lineno, script);
814 if (!(sub =
getsubbyname(state, subscr, script, lineno)))
825 char *tok =
get_token(&args, script, lineno);
826 char subscr[80], sname[80];
827 int sawin = 0,
event, snums[8], scnt = 0, x;
831 ast_log(
LOG_WARNING,
"Missing event for 'ONEVENT' at line %d of %s\n", lineno, script);
836 ast_log(
LOG_WARNING,
"'%s' is not a valid event name, at line %d of %s\n", args, lineno, script);
841 while ((!sawin && !strcasecmp(tok,
"IN")) || (sawin && !strcasecmp(tok,
"OR"))) {
844 ast_log(
LOG_WARNING,
"No more than 8 states may be specified for inclusion at line %d of %s\n", lineno, script);
850 ast_log(
LOG_WARNING,
"'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
854 ast_log(
LOG_WARNING,
"State '%s' not declared at line %d of %s\n", sname, lineno, script);
858 if (!(tok =
get_token(&args, script, lineno)))
861 if (!tok || strcasecmp(tok,
"GOTO")) {
865 ast_log(
LOG_WARNING,
"Got '%s' while looking for 'GOTO' or 'OR' at line %d of %s\n", tok, lineno, script);
867 ast_log(
LOG_WARNING,
"Got '%s' while looking for 'GOTO' or 'IN' at line %d of %s\n", tok, lineno, script);
869 if (!(tok =
get_token(&args, script, lineno))) {
874 ast_log(
LOG_WARNING,
"Invalid subscript '%s' at line %d of %s\n", tok, lineno, script);
877 if (!(sub =
getsubbyname(state, subscr, script, lineno)))
881 buf[2] = sub->
id | 0x80;
882 for (x = 0; x < scnt; x++)
883 buf[3 + x] = snums[x];
899 {
"WAITDIALTONE", 0x84 },
902 {
"SENDCHARS", 0x87 },
903 {
"CLEARCHARS", 0x88 },
904 {
"BACKSPACE", 0x89 },
909 {
"PAGEDOWN", 0x8e },
912 {
"DIALPULSEONE", 0x91 },
913 {
"DATAMODE", 0x92 },
914 {
"VOICEMODE", 0x93 },
961 if ((kcmds[x].
id > -1) && !strcasecmp(kcmds[x].
name, code)) {
964 code, kcmds[x].
id, args, state, script, lineno);
968 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);
970 if ((unused =
get_token(&args, script, lineno)))
971 ast_log(
LOG_WARNING,
"'%s' takes no arguments at line %d of %s (token is '%s')\n", kcmds[x].name, lineno, script, unused);
976 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);
989 for (x = 0; x <
ARRAY_LEN(opcmds); x++) {
990 if ((opcmds[x].
id > -1) && !strcasecmp(opcmds[x].
name, code)) {
993 code, opcmds[x].
id, args, state, script, lineno);
994 if ((sub->
datalen + res + 1) <= max)
997 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);
1001 if ((unused =
get_token(&args, script, lineno)))
1002 ast_log(
LOG_WARNING,
"'%s' takes no arguments at line %d of %s (token is '%s')\n", opcmds[x].name, lineno, script, unused);
1003 if ((sub->
datalen + 2) <= max) {
1007 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);
1023 char *keyword =
get_token(&buf, script, lineno);
1024 char *
args, vname[256],
tmp[80], tmp2[80];
1025 int lrci, wi,
event;
1032 switch(state->
state) {
1034 if (!strcasecmp(keyword,
"DESCRIPTION")) {
1035 if ((args =
get_token(&buf, script, lineno))) {
1037 ast_log(
LOG_WARNING,
"'%s' is not a valid token for DESCRIPTION at line %d of %s\n", args, lineno, script);
1039 ast_log(
LOG_WARNING,
"Missing argument for DESCRIPTION at line %d of %s\n", lineno, script);
1040 }
else if (!strcasecmp(keyword,
"VERSION")) {
1041 if ((args =
get_token(&buf, script, lineno))) {
1043 ast_log(
LOG_WARNING,
"'%s' is not a valid token for VERSION at line %d of %s\n", args, lineno, script);
1045 ast_log(
LOG_WARNING,
"Missing argument for VERSION at line %d of %s\n", lineno, script);
1046 }
else if (!strcasecmp(keyword,
"SECURITY")) {
1047 if ((args =
get_token(&buf, script, lineno))) {
1049 ast_log(
LOG_WARNING,
"'%s' is not a valid token for SECURITY at line %d of %s\n", args, lineno, script);
1051 ast_log(
LOG_WARNING,
"Missing argument for SECURITY at line %d of %s\n", lineno, script);
1052 }
else if (!strcasecmp(keyword,
"FDN")) {
1053 if ((args =
get_token(&buf, script, lineno))) {
1055 ast_log(
LOG_WARNING,
"'%s' is not a valid token for FDN at line %d of %s\n", args, lineno, script);
1058 }
else if (!strcasecmp(keyword,
"KEY")) {
1059 if (!(args =
get_token(&buf, script, lineno))) {
1060 ast_log(
LOG_WARNING,
"KEY definition missing name at line %d of %s\n", lineno, script);
1064 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1072 ast_log(
LOG_WARNING,
"Cannot redefine key '%s' at line %d of %s\n", vname, lineno, script);
1075 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1076 ast_log(
LOG_WARNING,
"Expecting 'IS', but got '%s' at line %d of %s\n", args ? args :
"<nothing>", lineno, script);
1079 if (!(args =
get_token(&buf, script, lineno))) {
1080 ast_log(
LOG_WARNING,
"KEY definition missing short name at line %d of %s\n", lineno, script);
1084 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY short name at line %d of %s\n", args, lineno, script);
1087 if ((args =
get_token(&buf, script, lineno))) {
1088 if (strcasecmp(args,
"OR")) {
1089 ast_log(
LOG_WARNING,
"Expecting 'OR' but got '%s' instead at line %d of %s\n", args, lineno, script);
1092 if (!(args =
get_token(&buf, script, lineno))) {
1093 ast_log(
LOG_WARNING,
"KEY definition missing optional long name at line %d of %s\n", lineno, script);
1097 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY long name at line %d of %s\n", args, lineno, script);
1103 if (strlen(tmp2) > 18) {
1104 ast_log(
LOG_WARNING,
"Truncating full name to 18 characters at line %d of %s\n", lineno, script);
1107 if (strlen(tmp) > 7) {
1108 ast_log(
LOG_WARNING,
"Truncating short name to 7 bytes at line %d of %s\n", lineno, script);
1116 memcpy(state->
key->
retstr + 3, tmp2, strlen(tmp2));
1130 }
else if (!strcasecmp(keyword,
"SUB")) {
1131 if (!(args =
get_token(&buf, script, lineno))) {
1132 ast_log(
LOG_WARNING,
"SUB definition missing name at line %d of %s\n", lineno, script);
1136 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1144 ast_log(
LOG_WARNING,
"Cannot redefine subroutine '%s' at line %d of %s\n", vname, lineno, script);
1152 if (state->
sub->
id) {
1160 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1161 ast_log(
LOG_WARNING,
"Expecting 'IS', but got '%s' at line %d of %s\n", args ? args :
"<nothing>", lineno, script);
1165 }
else if (!strcasecmp(keyword,
"STATE")) {
1166 if (!(args =
get_token(&buf, script, lineno))) {
1167 ast_log(
LOG_WARNING,
"STATE definition missing name at line %d of %s\n", lineno, script);
1171 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a STATE name at line %d of %s\n", args, lineno, script);
1175 ast_log(
LOG_WARNING,
"State '%s' is already defined at line %d of %s\n", vname, lineno, script);
1179 }
else if (!strcasecmp(keyword,
"FLAG")) {
1180 if (!(args =
get_token(&buf, script, lineno))) {
1181 ast_log(
LOG_WARNING,
"FLAG definition missing name at line %d of %s\n", lineno, script);
1185 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a FLAG name at line %d of %s\n", args, lineno, script);
1193 }
else if (!strcasecmp(keyword,
"DISPLAY")) {
1196 if (!(args =
get_token(&buf, script, lineno))) {
1197 ast_log(
LOG_WARNING,
"SUB definition missing name at line %d of %s\n", lineno, script);
1201 ast_log(
LOG_WARNING,
"'%s' is not a valid token for a KEY name at line %d of %s\n", args, lineno, script);
1210 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"IS")) {
1214 if (!(args =
get_token(&buf, script, lineno))) {
1219 ast_log(
LOG_WARNING,
"Token '%s' is not valid column 1 text at line %d of %s\n", args, lineno, script);
1222 if (strlen(tmp) > 20) {
1223 ast_log(
LOG_WARNING,
"Truncating column one to 20 characters at line %d of %s\n", lineno, script);
1226 memcpy(disp->
data + 5, tmp, strlen(tmp));
1227 disp->
datalen = strlen(tmp) + 5;
1233 if (strlen(tmp) > 20) {
1234 ast_log(
LOG_WARNING,
"Truncating column two to 20 characters at line %d of %s\n", lineno, script);
1237 memcpy(disp->
data + disp->
datalen, tmp, strlen(tmp));
1242 if (!strcasecmp(args,
"JUSTIFY")) {
1245 ast_log(
LOG_WARNING,
"Qualifier 'JUSTIFY' requires an argument at line %d of %s\n", lineno, script);
1250 ast_log(
LOG_WARNING,
"'%s' is not a valid justification at line %d of %s\n", args, lineno, script);
1253 }
else if (!strcasecmp(args,
"WRAP")) {
1256 ast_log(
LOG_WARNING,
"'%s' is not a known qualifier at line %d of %s\n", args, lineno, script);
1265 disp->
data[0] = 0x81;
1267 disp->
data[2] = ((lrci & 0x3) << 6) | disp->
id;
1269 disp->
data[4] = 0xff;
1276 if (!strcasecmp(keyword,
"ENDKEY")) {
1283 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in SOFTKEY definition at line %d of %s\n", keyword, lineno, script);
1289 if (!strcasecmp(keyword,
"ENDIF")) {
1295 }
else if (!strcasecmp(keyword,
"GOTO")) {
1296 if (!(args =
get_token(&buf, script, lineno))) {
1297 ast_log(
LOG_WARNING,
"GOTO clause missing Subscript name at line %d of %s\n", lineno, script);
1301 ast_log(
LOG_WARNING,
"'%s' is not a valid subscript name token at line %d of %s\n", args, lineno, script);
1304 if (!(newsub =
getsubbyname(state, tmp, script, lineno)))
1316 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in IF clause at line %d of %s\n", keyword, lineno, script);
1323 if (!strcasecmp(keyword,
"ENDSUB")) {
1329 if (state->
sub->
id) {
1334 }
else if (!strcasecmp(keyword,
"IFEVENT")) {
1335 if (!(args =
get_token(&buf, script, lineno))) {
1336 ast_log(
LOG_WARNING,
"IFEVENT clause missing Event name at line %d of %s\n", lineno, script);
1343 if (!(args =
get_token(&buf, script, lineno)) || strcasecmp(args,
"THEN")) {
1344 ast_log(
LOG_WARNING,
"IFEVENT clause missing 'THEN' at line %d of %s\n", lineno, script);
1359 ast_log(
LOG_WARNING,
"Invalid or Unknown keyword '%s' in SUB definition at line %d of %s\n", keyword, lineno, script);
1372 char fn[256],
buf[256], *
c;
1373 int lineno = 0, x, err;
1376 if (script[0] ==
'/')
1381 if (!(f = fopen(fn,
"r"))) {
1394 if (!fgets(buf,
sizeof(buf), f)) {
1400 buf[strlen(buf) - 1] =
'\0';
1402 if ((c = strchr(buf,
';')))
1410 switch(scr->
state) {
1425 for (x = 0; x < scr->
numkeys; x++) {
1433 for (x = 0; x < scr->
numsubs; x++) {
1438 if (x == (scr->
numsubs - 1)) {
1451 #ifdef DUMP_MESSAGES 1452 static void dump_message(
char *
type,
char *vname,
unsigned char *
buf,
int buflen)
1455 printf(
"%s %s: [ ",
type, vname);
1456 for (x = 0; x < buflen; x++)
1457 printf(
"%02hhx ",
buf[x]);
1466 unsigned char buf[1024];
1478 ast_verb(3,
"User rejected download attempt\n");
1486 for (x = 0; x < scr->
numkeys; x++) {
1497 #ifdef DUMP_MESSAGES 1521 #ifdef DUMP_MESSAGES 1534 for (x = 0; x < scr->
numsubs; x++) {
1545 #ifdef DUMP_MESSAGES 1563 ast_verb(3,
"Download attempt failed\n");
1578 data =
"asterisk.adsi";
1581 ast_verb(3,
"ADSI Unavailable on CPE. Not bothering to try.\n");
1583 ast_verb(3,
"ADSI Available on CPE. Attempting Upload.\n");
1616 .requires =
"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 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]
static const struct adsi_key_cmd opcmds[]
static const struct adsi_event events[]
struct adsi_soft_key keys[62]
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
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)
Load the module.
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,...)
#define ast_strlen_zero(foo)
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 const struct adsi_event justify[]
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 const struct _map_x_s dtmfstr[]
mapping between dtmf flags and strings
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
int(* add_args)(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
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)
#define ast_calloc(num, len)
A wrapper for calloc()
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)
Module has failed to load, may be in an inconsistent state.
#define ADSI_MSG_DOWNLOAD
static int unload_module(void)
static int getjustifybyname(char *name)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
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.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
const char * ast_channel_name(const struct ast_channel *chan)
struct stasis_forward * sub
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 const struct adsi_key_cmd kcmds[]
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)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
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.
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)