36 #include "asterisk/lock.h"
88 static char *
app =
"PrivacyManager";
108 ast_verb(3,
"CallerID number present: Skipping\n");
122 if (sscanf(
args.maxretries,
"%30d", &x) == 1 && x > 0) {
129 if (sscanf(
args.minlength,
"%30d", &x) == 1 && x > 0) {
146 for (retries = 0; retries <
maxretries; retries++) {
155 res =
ast_readstring(chan, phone,
sizeof(phone) - 1, 3200, 5000,
"#");
163 if (strlen(phone) >= minlength ) {
186 if ((retries < maxretries) && res >= 0) {
204 ast_verb(3,
"Changed Caller*ID number to '%s'\n", phone);
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
int presentation
Q.931 encoded presentation-indicator encoded field.
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
Set caller ID number, name and ANI and generate AMI event.
Main Channel structure associated with a channel.
char * str
Subscriber phone number (Malloced)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
Asterisk main include file. File version handling, generic pbx functions.
struct ast_party_caller caller
Channel Caller ID information.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Support for translation of data formats. translate.c.
struct ast_party_name name
Subscriber name.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Configuration File Parser.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
#define ast_verb(level,...)
struct ast_party_id id
Caller party ID.
General Asterisk channel definitions for image handling.
General Asterisk PBX channel definitions.
static int privacy_exec(struct ast_channel *chan, const char *data)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
Core PBX routines and definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int load_module(void)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
enum ast_channel_state _state
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static void parse(struct mgcp_request *req)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
static int unload_module(void)
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
int ast_answer(struct ast_channel *chan)
Answer a channel.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
const char * data
Description of a tone.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders)
Reads multiple digits.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
unsigned char valid
TRUE if the number information is valid/present.
const ast_string_field language
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
struct ast_party_number number
Subscriber phone number.