2 * Asterisk -- A telephony toolkit for Linux.
6 * Copyright (C) 1999, Mark Spencer
8 * Mark Spencer <markster@linux-support.net>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License
22 #include <asterisk/channel.h>
23 #include <asterisk/file.h>
24 #include <asterisk/app.h>
26 /* set timeout to 0 for "standard" timeouts. Set timeout to -1 for
27 "ludicrous time" (essentially never times out) */
28 int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout)
32 res = ast_streamfile(c, prompt, c->language);
38 if (timeout > 0) fto = to = timeout;
39 if (timeout < 0) fto = to = 1000000000;
40 res = ast_readstring(c, s, maxlen, to, fto, "#");