Function to lookup the callerid number, and see if it is blacklisted. More...
#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 __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Look up Caller*ID name/number from blacklist database" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
| static struct ast_module_info * | ast_module_info = &__mod_info |
| static struct ast_custom_function | blacklist_function |
Function to lookup the callerid number, and see if it is blacklisted.
Definition in file func_blacklist.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 88 of file func_blacklist.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 88 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 55 of file func_blacklist.c.
References ast_db_get(), ast_channel::cid, ast_callerid::cid_name, and ast_callerid::cid_num.
{
char blacklist[1];
int bl = 0;
if (chan->cid.cid_num) {
if (!ast_db_get("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist)))
bl = 1;
}
if (chan->cid.cid_name) {
if (!ast_db_get("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist)))
bl = 1;
}
snprintf(buf, len, "%d", bl);
return 0;
}
| static int load_module | ( | void | ) | [static] |
Definition at line 83 of file func_blacklist.c.
References ast_custom_function_register.
{
return ast_custom_function_register(&blacklist_function);
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 78 of file func_blacklist.c.
References ast_custom_function_unregister().
{
return ast_custom_function_unregister(&blacklist_function);
}
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Look up Caller*ID name/number from blacklist database" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 88 of file func_blacklist.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 88 of file func_blacklist.c.
struct ast_custom_function blacklist_function [static] |
{
.name = "BLACKLIST",
.read = blacklist_read,
}
Definition at line 73 of file func_blacklist.c.