Function to lookup the callerid number, and see if it is blacklisted.
More...
Go to the source code of this file.
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 60 of file func_blacklist.c.
61{
62 char blacklist[1];
63 int bl = 0;
64
65 if (!chan) {
67 return -1;
68 }
69
72 bl = 1;
73 }
76 bl = 1;
77 }
78
79 snprintf(
buf,
len,
"%d", bl);
80 return 0;
81}
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
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)
References ast_channel_caller(), ast_db_get(), ast_log, buf, len(), LOG_WARNING, and name.
Referenced by blacklist_read2().
◆ 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 83 of file func_blacklist.c.
84{
85
89 }
90 }
94 return res;
95 }
96 return -1;
97}
static int blacklist_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define ast_str_make_space(buf, new_len)
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
size_t attribute_pure ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
References ast_str_buffer(), ast_str_make_space, ast_str_size(), ast_str_strlen(), ast_str_update(), blacklist_read(), len(), and str.
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
◆ ast_module_info
◆ blacklist_function
Initial value:= {
.name = "BLACKLIST",
}
static int blacklist_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
Definition at line 99 of file func_blacklist.c.
99 {
100 .name = "BLACKLIST",
103};
Referenced by load_module(), and unload_module().