Function to lookup the callerid number, and see if it is blacklisted.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static const 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.
- Author
- Mark Spencer marks.nosp@m.ter@.nosp@m.digiu.nosp@m.m.co.nosp@m.m
Definition in file func_blacklist.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ blacklist_read()
static int blacklist_read |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
data, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
static |
Definition at line 57 of file func_blacklist.c.
References ast_channel_caller(), ast_db_get(), ast_log, LOG_WARNING, and name.
Referenced by blacklist_read2().
76 snprintf(
buf,
len,
"%d", bl);
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
◆ blacklist_read2()
static int blacklist_read2 |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
data, |
|
|
struct ast_str ** |
str, |
|
|
ssize_t |
len |
|
) |
| |
|
static |
Definition at line 80 of file func_blacklist.c.
References ast_str_buffer(), ast_str_make_space, ast_str_size(), ast_str_strlen(), ast_str_update(), and blacklist_read().
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
#define ast_str_make_space(buf, new_len)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int blacklist_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static |
◆ ast_module_info
◆ blacklist_function
Initial value:= {
.name = "BLACKLIST",
}
static int blacklist_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int blacklist_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
Definition at line 96 of file func_blacklist.c.