aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_zapateller.c
diff options
context:
space:
mode:
authordhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-05 20:58:48 +0000
committerdhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-05 20:58:48 +0000
commit0ef7f62a84cbc072f474b2f507d2eb078ae25c2c (patch)
tree9bb36235c10f5d194fde26d9e88bfa04e8f4a16f /apps/app_zapateller.c
parent300442eaee26a2691722fcd134462e9ebbc51374 (diff)
added ZAPATELLERSTATUS to app_zapateller
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81601 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_zapateller.c')
-rw-r--r--apps/app_zapateller.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c
index 9c64c547d..83f9d25b3 100644
--- a/apps/app_zapateller.c
+++ b/apps/app_zapateller.c
@@ -50,10 +50,14 @@ static char *descrip =
" Zapateller(options): Generates special information tone to block\n"
"telemarketers from calling you. Options is a pipe-delimited list of\n"
"options. The following options are available:\n"
-"'answer' causes the line to be answered before playing the tone,\n"
-"'nocallerid' causes Zapateller to only play the tone if there\n"
-"is no callerid information available. Options should be separated by |\n"
-"characters\n";
+" 'answer' - causes the line to be answered before playing the tone,\n"
+" 'nocallerid' - causes Zapateller to only play the tone if there is no\n"
+" callerid information available. Options should be\n"
+" separated by | characters\n\n"
+" This application will set the following channel variable upon completion:\n"
+" ZAPATELLERSTATUS - This will contain the last action accomplished by the\n"
+" Zapateller application. Possible values include:\n"
+" NOTHING | ANSWERED | ZAPPED\n\n";
static int zapateller_exec(struct ast_channel *chan, void *data)
@@ -74,10 +78,13 @@ static int zapateller_exec(struct ast_channel *chan, void *data)
nocallerid = 1;
}
+ pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "NOTHING");
ast_stopstream(chan);
if (chan->_state != AST_STATE_UP) {
- if (answer)
+ if (answer) {
res = ast_answer(chan);
+ pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "ANSWERED");
+ }
if (!res)
res = ast_safe_sleep(chan, 500);
}
@@ -93,7 +100,8 @@ static int zapateller_exec(struct ast_channel *chan, void *data)
res = ast_tonepair(chan, 1800, 0, 330, 0);
if (!res)
res = ast_tonepair(chan, 0, 0, 1000, 0);
-
+
+ pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "ZAPPED");
return res;
}