46 int ast_privacy_check(
char *dest,
char *cid)
52 char key[256], result[256];
60 snprintf(key,
sizeof(key),
"%s/%s", dest, trimcid);
61 res =
ast_db_get(
"privacy", key, result,
sizeof(result));
63 if (!strcasecmp(result,
"allow"))
64 return AST_PRIVACY_ALLOW;
65 if (!strcasecmp(result,
"deny"))
66 return AST_PRIVACY_DENY;
67 if (!strcasecmp(result,
"kill"))
68 return AST_PRIVACY_KILL;
69 if (!strcasecmp(result,
"torture"))
70 return AST_PRIVACY_TORTURE;
72 return AST_PRIVACY_UNKNOWN;
75 int ast_privacy_reset(
char *dest)
82 int ast_privacy_set(
char *dest,
char *cid,
int status)
96 if (ast_strlen_zero(trimcid)) {
100 snprintf(key,
sizeof(key),
"%s/%s", dest, trimcid);
101 if (status == AST_PRIVACY_UNKNOWN)
103 else if (status == AST_PRIVACY_ALLOW)
105 else if (status == AST_PRIVACY_DENY)
107 else if (status == AST_PRIVACY_KILL)
109 else if (status == AST_PRIVACY_TORTURE)
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Convenient Signal Processing routines.
Persistent data storage (akin to *doze registry)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
General Asterisk PBX channel definitions.
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
int ast_db_del(const char *family, const char *key)
Delete entry in astdb.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
int ast_db_put(const char *family, const char *key, const char *value)
Store value addressed by family/key.
void ast_shrink_phone_number(char *n)
Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s...
Persistent data storage (akin to *doze registry)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
int ast_db_deltree(const char *family, const char *keytree)
Delete one or more entries in astdb.
int ast_callerid_parse(char *instr, char **name, char **location)
Destructively parse inbuf into name and location (or number)