#include "asterisk.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/astdb.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | blacklist_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Look up Caller*ID name/number from blacklist database" , .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 = "068e67f60f50dd9ee86464c05884a49d" , .load = load_module, .unload = unload_module, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_custom_function | blacklist_function |
Definition in file func_blacklist.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 74 of file func_blacklist.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 74 of file func_blacklist.c.
static int blacklist_read | ( | struct ast_channel * | chan, | |
const char * | cmd, | |||
char * | data, | |||
char * | buf, | |||
size_t | len | |||
) | [static] |
Definition at line 38 of file func_blacklist.c.
References ast_db_get(), chan, ast_channel::cid, ast_callerid::cid_name, and ast_callerid::cid_num.
00039 { 00040 char blacklist[1]; 00041 int bl = 0; 00042 00043 if (chan->cid.cid_num) { 00044 if (!ast_db_get("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist))) 00045 bl = 1; 00046 } 00047 if (chan->cid.cid_name) { 00048 if (!ast_db_get("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist))) 00049 bl = 1; 00050 } 00051 00052 snprintf(buf, len, "%d", bl); 00053 return 0; 00054 }
static int load_module | ( | void | ) | [static] |
Definition at line 69 of file func_blacklist.c.
References ast_custom_function_register, and blacklist_function.
00070 { 00071 return ast_custom_function_register(&blacklist_function); 00072 }
static int unload_module | ( | void | ) | [static] |
Definition at line 64 of file func_blacklist.c.
References ast_custom_function_unregister(), and blacklist_function.
00065 { 00066 return ast_custom_function_unregister(&blacklist_function); 00067 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Look up Caller*ID name/number from blacklist database" , .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 = "068e67f60f50dd9ee86464c05884a49d" , .load = load_module, .unload = unload_module, } [static] |
Definition at line 74 of file func_blacklist.c.
const struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 74 of file func_blacklist.c.
struct ast_custom_function blacklist_function [static] |