#include "asterisk.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/translate.h"
#include "asterisk/app.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | load_module (void) |
static int | unload_module (void) |
static int | zapateller_exec (struct ast_channel *chan, void *data) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Block Telemarketers with Special Information Tone" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "a9c98e5d177805051735cb5b0b16b0a0" , .load = load_module, .unload = unload_module, } |
static char * | app = "Zapateller" |
static struct ast_module_info * | ast_module_info = &__mod_info |
static char * | descrip |
static char * | synopsis = "Block telemarketers with SIT" |
Definition in file app_zapateller.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 113 of file app_zapateller.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 113 of file app_zapateller.c.
static int load_module | ( | void | ) | [static] |
Definition at line 108 of file app_zapateller.c.
References AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, ast_register_application, and zapateller_exec().
00109 { 00110 return ((ast_register_application(app, zapateller_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS); 00111 }
static int unload_module | ( | void | ) | [static] |
Definition at line 103 of file app_zapateller.c.
References ast_unregister_application().
00104 { 00105 return ast_unregister_application(app); 00106 }
static int zapateller_exec | ( | struct ast_channel * | chan, | |
void * | data | |||
) | [static] |
Definition at line 58 of file app_zapateller.c.
References ast_channel::_state, ast_answer(), AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_safe_sleep(), AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdupa, ast_strlen_zero(), ast_tonepair(), chan, ast_channel::cid, ast_callerid::cid_num, parse(), and pbx_builtin_setvar_helper().
Referenced by load_module().
00059 { 00060 int res = 0; 00061 int i, answer = 0, nocallerid = 0; 00062 char *parse = ast_strdupa((char *)data); 00063 AST_DECLARE_APP_ARGS(args, 00064 AST_APP_ARG(options)[2]; 00065 ); 00066 00067 AST_STANDARD_APP_ARGS(args, parse); 00068 00069 for (i = 0; i < args.argc; i++) { 00070 if (!strcasecmp(args.options[i], "answer")) 00071 answer = 1; 00072 else if (!strcasecmp(args.options[i], "nocallerid")) 00073 nocallerid = 1; 00074 } 00075 00076 pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "NOTHING"); 00077 ast_stopstream(chan); 00078 if (chan->_state != AST_STATE_UP) { 00079 if (answer) { 00080 res = ast_answer(chan); 00081 pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "ANSWERED"); 00082 } 00083 if (!res) 00084 res = ast_safe_sleep(chan, 500); 00085 } 00086 00087 if (!ast_strlen_zero(chan->cid.cid_num) && nocallerid) 00088 return res; 00089 00090 if (!res) 00091 res = ast_tonepair(chan, 950, 0, 330, 0); 00092 if (!res) 00093 res = ast_tonepair(chan, 1400, 0, 330, 0); 00094 if (!res) 00095 res = ast_tonepair(chan, 1800, 0, 330, 0); 00096 if (!res) 00097 res = ast_tonepair(chan, 0, 0, 1000, 0); 00098 00099 pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "ZAPPED"); 00100 return res; 00101 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Block Telemarketers with Special Information Tone" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "a9c98e5d177805051735cb5b0b16b0a0" , .load = load_module, .unload = unload_module, } [static] |
Definition at line 113 of file app_zapateller.c.
char* app = "Zapateller" [static] |
Definition at line 40 of file app_zapateller.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 113 of file app_zapateller.c.
char* descrip [static] |
Definition at line 44 of file app_zapateller.c.
char* synopsis = "Block telemarketers with SIT" [static] |
Definition at line 42 of file app_zapateller.c.