aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_readfile.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 17:32:15 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 17:32:15 +0000
commit59654dd845935f73eb39c7f4549a5e9ab49216bf (patch)
treebcebff29d4ed75f38612ca9abac322a2484d2490 /apps/app_readfile.c
parenta384dc7afc86716e57cb7f92370a0018abba83c6 (diff)
Add the FILE() dialplan function and deprecate ReadFile.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89114 f38db490-d61c-443f-a65b-d21fe96a405b
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;