summaryrefslogtreecommitdiff
path: root/apps/app_readfile.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-11-08 17:32:15 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-11-08 17:32:15 +0000
commit3a70afbc3e1fa0eef6e8e0e1e707a6ddfe44ed34 (patch)
treebcebff29d4ed75f38612ca9abac322a2484d2490 /apps/app_readfile.c
parent86e5e39198a3009126863e5127a6166afdba3f0d (diff)
Add the FILE() dialplan function and deprecate ReadFile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_readfile.c')
-rw-r--r--apps/app_readfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_readfile.c b/apps/app_readfile.c
index f20e028b0..d1bedcbce 100644
--- a/apps/app_readfile.c
+++ b/apps/app_readfile.c
@@ -58,6 +58,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
int res=0;
char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL;
int len=0;
+ static int deprecation_warning = 0;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "ReadFile require an argument!\n");
@@ -70,6 +71,9 @@ static int readfile_exec(struct ast_channel *chan, void *data)
file = strsep(&s, ",");
length = s;
+ if (deprecation_warning++ % 10 == 0)
+ ast_log(LOG_WARNING, "ReadFile has been deprecated in favor of Set(%s=${FILE(%s,0,%s)})\n", varname, file, length);
+
if (!varname || !file) {
ast_log(LOG_ERROR, "No file or variable specified!\n");
return -1;