summaryrefslogtreecommitdiff
path: root/include/asterisk/app.h
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2009-03-03 23:21:18 +0000
committerDavid Vossel <dvossel@digium.com>2009-03-03 23:21:18 +0000
commit979eb709ae4b597ca85115f2597969355f962e52 (patch)
tree2fd0a6b4707320506831b0594014dd1a8fa27e25 /include/asterisk/app.h
parent0b01444ab79f68413e6ae8bc17fd1babe10ea814 (diff)
app_read does not break from prompt loop with user terminated empty string
In app.c, ast_app_getdata is called to stream the prompts and receive DTMF input. If ast_app_getdata() receives an empty string caused by the user inputing the end of string character, in this case '#', it should break from the prompt loop and return to app_read, but instead it cycles through all the prompts. I've added a return value for this special case in ast_readstring() which uses an enum I've delcared in apps.h. This enum is now used as a return value for ast_app_getdata(). (closes issue #14279) Reported by: Marquis Patches: fix_app_read.patch uploaded by Marquis (license 32) read-ampersanmd.patch2 uploaded by dvossel (license 671) Tested by: Marquis, dvossel Review: http://reviewboard.digium.com/r/177/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/app.h')
-rw-r--r--include/asterisk/app.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 0e8e0c910..2731be032 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -209,6 +209,16 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
'silencethreshold' or use '-1' for either or both parameters for defaults. */
int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime_sec, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence_ms);
+enum ast_getdata_result {
+ AST_GETDATA_FAILED = -1,
+ AST_GETDATA_COMPLETE = 0,
+ AST_GETDATA_TIMEOUT = 1,
+ AST_GETDATA_INTERRUPTED = 2,
+ /*! indicates a user terminated empty string rather than an empty string resulting
+ * from a timeout or other factors */
+ AST_GETDATA_EMPTY_END_TERMINATED = 3,
+};
+
enum AST_LOCK_RESULT {
AST_LOCK_SUCCESS = 0,
AST_LOCK_TIMEOUT = -1,