Index: res/res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.50 diff -u -r1.50 res_agi.c --- res/res_agi.c 14 Sep 2005 20:46:50 -0000 1.50 +++ res/res_agi.c 18 Sep 2005 06:58:42 -0000 @@ -794,6 +794,7 @@ char data[1024]; int max; int timeout; + char *escape=NULL; if (argc < 3) return RESULT_SHOWUSAGE; @@ -802,10 +803,16 @@ else timeout = 0; if (argc >= 5) - max = atoi(argv[4]); + max = atoi(argv[4]); else max = 1024; - res = ast_app_getdata_full(chan, argv[2], data, max, timeout, agi->audio, agi->ctrl); + if (argc >= 6) { + escape=argv[5]; + } else + escape="#"; + + ast_log(LOG_DEBUG, "escape digits has been set to %s\n",escape); + res = ast_app_getdata_full(chan, argv[2], data, max, timeout, agi->audio, agi->ctrl, escape); if (res == 2) /* New command */ return RESULT_SUCCESS; else if (res == 1) @@ -1544,9 +1551,10 @@ " if one was pressed, or -1 on error/hangup.\n"; static char usage_getdata[] = -" Usage: GET DATA [timeout] [max digits]\n" +" Usage: GET DATA [timeout] [max digits] [escape]\n" " Stream the given file, and recieve DTMF data. Returns the digits received\n" -"from the channel at the other end.\n"; +"from the channel at the other end. It will finish accepting DTMF until the timeout \n" +"occurs or the 'escape' is entered.\n"; static char usage_setcontext[] = " Usage: SET CONTEXT \n" Index: include/asterisk/app.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/app.h,v retrieving revision 1.39 diff -u -r1.39 app.h --- include/asterisk/app.h 14 Sep 2005 17:20:24 -0000 1.39 +++ include/asterisk/app.h 18 Sep 2005 06:59:00 -0000 @@ -107,7 +107,7 @@ extern int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout); /* Full version with audiofd and controlfd. NOTE: returns '2' on ctrlfd available, not '1' like other full functions */ -extern int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd); +extern int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd, char *escape); /*! Record voice (after playing prompt if specified), waiting for silence (in ms) up to a given timeout (in s) or '#' */ int ast_app_getvoice(struct ast_channel *c, char *dest, char *dstfmt, char *prompt, int silence, int maxsec); Index: app.c =================================================================== RCS file: /usr/cvsroot/asterisk/app.c,v retrieving revision 1.76 diff -u -r1.76 app.c --- app.c 14 Sep 2005 20:46:49 -0000 1.76 +++ app.c 18 Sep 2005 06:59:06 -0000 @@ -128,7 +128,7 @@ } -int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd) +int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd, char *escape) { int res,to,fto; if (prompt) { @@ -142,7 +142,7 @@ fto = to = timeout; if (timeout < 0) fto = to = 1000000000; - res = ast_readstring_full(c, s, maxlen, to, fto, "#", audiofd, ctrlfd); + res = ast_readstring_full(c, s, maxlen, to, fto, escape, audiofd, ctrlfd); return res; }