From b430086163381dfbeab4b1ca0f00f40f45312777 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sun, 5 Aug 2001 21:56:28 +0000 Subject: [PATCH] Version 0.1.9 from FTP git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- app.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 app.c diff --git a/app.c b/app.c new file mode 100755 index 0000000000..2d2af6de9c --- /dev/null +++ b/app.c @@ -0,0 +1,43 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Channel Management + * + * Copyright (C) 1999, Mark Spencer + * + * Mark Spencer + * + * This program is free software, distributed under the terms of + * the GNU General Public License + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* set timeout to 0 for "standard" timeouts. Set timeout to -1 for + "ludicrous time" (essentially never times out) */ +int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout) +{ + int res,to,fto; + if (prompt) { + res = ast_streamfile(c, prompt, c->language); + if (res < 0) + return res; + } + fto = 6000; + to = 2000; + if (timeout > 0) fto = to = timeout; + if (timeout < 0) fto = to = 1000000000; + res = ast_readstring(c, s, maxlen, to, fto, "#"); + return res; +} +