533    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  535    } 
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
 
  537    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
 
  572    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  574    } 
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
 
  576    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
 
  608        if (subaddress->
str) {
 
  611    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  613    } 
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
 
  615    } 
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
 
 
  649    if (argc == 1 && !strcasecmp(
"all", argv[0])) {
 
  650        snprintf(
buf, 
len, 
"\"%s\" <%s>",
 
  652             S_COR(
id->number.valid, 
id->number.str, 
""));
 
  653    } 
else if (!strcasecmp(
"name", argv[0])) {
 
  655    } 
else if (!strncasecmp(
"num", argv[0], 3)) {
 
  658    } 
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
 
  661    } 
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
 
  665    } 
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
 
  667        snprintf(
buf, 
len, 
"%d", 
id->number.plan);
 
  668    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
 
  708    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  710    } 
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
 
  716        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
  717            char_set = atoi(
val);
 
  724                "Unknown name char-set '%s', value unchanged\n", 
val);
 
  727            name->char_set = char_set;
 
  729    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
  736        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
  744                "Unknown name presentation '%s', value unchanged\n", 
val);
 
  747            name->presentation = pres;
 
 
  782    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  784    } 
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
 
  788        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
  792                "Unknown type-of-number/numbering-plan '%s', value unchanged\n", 
val);
 
  795    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
  802        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
  810                "Unknown number presentation '%s', value unchanged\n", 
val);
 
  813            number->presentation = pres;
 
 
  846    } 
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
 
  848    } 
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
 
  850    } 
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
 
 
  885    if (argc == 1 && !strcasecmp(
"all", argv[0])) {
 
  895        id->number.valid = 1;
 
  897        if (!
id->number.str) {
 
  900    } 
else if (!strcasecmp(
"name", argv[0])) {
 
  902    } 
else if (!strncasecmp(
"num", argv[0], 3)) {
 
  905    } 
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
 
  908    } 
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
 
  911    } 
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
 
  915    } 
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
 
  925        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
  933                "Unknown combined presentation '%s', value unchanged\n", 
val);
 
  936            id->name.presentation = pres;
 
  937            id->number.presentation = pres;
 
 
  977    if (
args.argc == 0) {
 
  988    if (
args.argc == 2) {
 
  994        if (
member.argc == 1 && !strcasecmp(
"all", 
member.subnames[0])) {
 
  996        } 
else if (
member.argc == 1 && !strcasecmp(
"name", 
member.subnames[0])) {
 
  998        } 
else if (
member.argc == 1 && !strncasecmp(
"num", 
member.subnames[0], 3)) {
 
 1008        if (
member.argc == 1 && !strcasecmp(
"rdnis", 
member.subnames[0])) {
 
 1013        } 
else if (!strcasecmp(
"dnid", 
member.subnames[0])) {
 
 1017                member.subnames[1] = 
"num";
 
 1019            if (!strncasecmp(
"num", 
member.subnames[1], 3)) {
 
 1029                } 
else if (
member.argc == 3 && !strcasecmp(
"plan", 
member.subnames[2])) {
 
 1035            } 
else if (!strncasecmp(
"subaddr", 
member.subnames[1], 7)) {
 
 1053        } 
else if (
member.argc == 1 && !strcasecmp(
"ani2", 
member.subnames[0])) {
 
 1057        } 
else if (!strcasecmp(
"ani", 
member.subnames[0])) {
 
 1061                member.subnames[1] = 
"num";
 
 1073        } 
else if (!strcasecmp(
"priv", 
member.subnames[0])) {
 
 
 1124    if (!
value || !chan) {
 
 1130    if (
args.argc == 0) {
 
 1144    if (
member.argc == 1 && !strcasecmp(
"rdnis", 
member.subnames[0])) {
 
 1148    } 
else if (!strcasecmp(
"dnid", 
member.subnames[0])) {
 
 1153            member.subnames[1] = 
"num";
 
 1155        if (!strncasecmp(
"num", 
member.subnames[1], 3)) {
 
 1165            } 
else if (
member.argc == 3 && !strcasecmp(
"plan", 
member.subnames[2])) {
 
 1170                if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1174                        "Unknown type-of-number/numbering-plan '%s', value unchanged\n", 
val);
 
 1179        } 
else if (!strncasecmp(
"subaddr", 
member.subnames[1], 7)) {
 
 1200    } 
else if (
member.argc == 1 && !strcasecmp(
"ani2", 
member.subnames[0])) {
 
 1204        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1209    } 
else if (!strcasecmp(
"ani", 
member.subnames[0])) {
 
 1214            member.subnames[1] = 
"num";
 
 1228    } 
else if (!strcasecmp(
"priv", 
member.subnames[0])) {
 
 
 1297    if (
member.argc == 1 && !strcasecmp(
"source", 
member.subnames[0])) {
 
 1299    } 
else if (!strcasecmp(
"priv", 
member.subnames[0])) {
 
 
 1351    if (!
value || !chan) {
 
 1357    if (
args.argc == 0) {
 
 1386    if (
member.argc == 1 && !strcasecmp(
"source", 
member.subnames[0])) {
 
 1392        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1404    } 
else if (!strcasecmp(
"priv", 
member.subnames[0])) {
 
 
 1472    if (!strcasecmp(
"orig", 
member.subnames[0])) {
 
 1473        if (
member.argc == 2 && !strcasecmp(
"reason", 
member.subnames[1])) {
 
 1478                &ast_redirecting->
orig);
 
 1488    } 
else if (!strcasecmp(
"from", 
member.subnames[0])) {
 
 1490            &ast_redirecting->
from);
 
 1499    } 
else if (!strcasecmp(
"to", 
member.subnames[0])) {
 
 1501            &ast_redirecting->
to);
 
 1510    } 
else if (
member.argc == 1 && !strncasecmp(
"pres", 
member.subnames[0], 4)) {
 
 1518    } 
else if (
member.argc == 1 && !strcasecmp(
"reason", 
member.subnames[0])) {
 
 1520    } 
else if (
member.argc == 1 && !strcasecmp(
"count", 
member.subnames[0])) {
 
 1522    } 
else if (1 < 
member.argc && !strcasecmp(
"priv", 
member.subnames[0])) {
 
 1523        if (!strcasecmp(
"orig", 
member.subnames[1])) {
 
 1534        } 
else if (!strcasecmp(
"from", 
member.subnames[1])) {
 
 1545        } 
else if (!strcasecmp(
"to", 
member.subnames[1])) {
 
 
 1592    if (!
value || !chan) {
 
 1598    if (
args.argc == 0) {
 
 1627    if (!strcasecmp(
"orig", 
member.subnames[0])) {
 
 1628        if (
member.argc == 2 && !strcasecmp(
"reason", 
member.subnames[1])) {
 
 1634            if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1648                set_it(chan, &redirecting, 
NULL);
 
 1652                set_it(chan, &redirecting, 
NULL);
 
 1659                set_it(chan, &redirecting, 
NULL);
 
 1669    } 
else if (!strcasecmp(
"from", 
member.subnames[0])) {
 
 1674            set_it(chan, &redirecting, 
NULL);
 
 1683    } 
else if (!strcasecmp(
"to", 
member.subnames[0])) {
 
 1687            set_it(chan, &redirecting, 
NULL);
 
 1696    } 
else if (
member.argc == 1 && !strncasecmp(
"pres", 
member.subnames[0], 4)) {
 
 1702        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1710                "Unknown redirecting combined presentation '%s', value unchanged\n", 
val);
 
 1716            set_it(chan, &redirecting, 
NULL);
 
 1718    } 
else if (
member.argc == 1 && !strcasecmp(
"reason", 
member.subnames[0])) {
 
 1724        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1738            set_it(chan, &redirecting, 
NULL);
 
 1742            set_it(chan, &redirecting, 
NULL);
 
 1744    } 
else if (
member.argc == 1 && !strcasecmp(
"count", 
member.subnames[0])) {
 
 1748        if ((
'0' <= 
val[0]) && (
val[0] <= 
'9')) {
 
 1750            set_it(chan, &redirecting, 
NULL);
 
 1754    } 
else if (1 < 
member.argc && !strcasecmp(
"priv", 
member.subnames[0])) {
 
 1755        if (!strcasecmp(
"orig", 
member.subnames[1])) {
 
 1760                set_it(chan, &redirecting, 
NULL);
 
 1769        } 
else if (!strcasecmp(
"from", 
member.subnames[1])) {
 
 1774                set_it(chan, &redirecting, 
NULL);
 
 1783        } 
else if (!strcasecmp(
"to", 
member.subnames[1])) {
 
 1787                set_it(chan, &redirecting, 
NULL);
 
 
 1814    .
name = 
"CONNECTEDLINE",
 
 
 1820    .
name = 
"REDIRECTING",
 
 
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
int ast_parse_caller_presentation(const char *data)
Convert caller ID text code to value (used in config file parsing)
const char * ast_redirecting_reason_name(const struct ast_party_redirecting_reason *data)
Convert redirecting reason value to text code.
const char * ast_party_name_charset_str(int data)
Convert ast_party_name.char_set value to text code.
@ AST_REDIRECTING_REASON_UNKNOWN
int ast_party_name_charset_parse(const char *data)
Convert ast_party_name.char_set text code to value (used in config file parsing)
int ast_redirecting_reason_parse(const char *data)
Convert redirecting reason text code to value (used in config file parsing)
const char * ast_connected_line_source_name(int data)
Convert connected line update source value to text code.
const char * ast_named_caller_presentation(int data)
Convert caller ID pres value to text code.
int ast_connected_line_source_parse(const char *data)
Convert connected line update source text code to value (used in config file parsing)
int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen)
const char *const subnames[]
General Asterisk PBX channel definitions.
void ast_party_dialed_set_init(struct ast_party_dialed *init, const struct ast_party_dialed *guide)
Initialize the given dialed structure using the given guide for a set update operation.
void ast_channel_set_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Set the redirecting id information in the Asterisk channel.
void ast_channel_set_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Set the connected line information in the Asterisk channel.
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
void ast_channel_set_caller_event(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel and generate an AMI event if the caller id name...
#define ast_channel_lock(chan)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
void ast_party_caller_set(struct ast_party_caller *dest, const struct ast_party_caller *src, const struct ast_set_party_caller *update)
Set the caller information based on another caller source.
void ast_channel_update_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Indicate that the connected line information has changed.
void ast_party_caller_set_init(struct ast_party_caller *init, const struct ast_party_caller *guide)
Initialize the given caller structure using the given guide for a set update operation.
void ast_party_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
void ast_party_redirecting_set_init(struct ast_party_redirecting *init, const struct ast_party_redirecting *guide)
Initialize the given redirecting id structure using the given guide for a set update operation.
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
void ast_party_dialed_set(struct ast_party_dialed *dest, const struct ast_party_dialed *src)
Set the dialed information based on another dialed source.
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
void ast_channel_update_redirecting(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update)
Indicate that the redirecting id has changed.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
void ast_party_connected_line_set_init(struct ast_party_connected_line *init, const struct ast_party_connected_line *guide)
Initialize the given connected line structure using the given guide for a set update operation.
#define ast_channel_unlock(chan)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
@ REDIRECTING_OPT_ARG_ARRAY_SIZE
static enum ID_FIELD_STATUS party_id_write(struct ast_party_id *id, int argc, char *argv[], const char *value)
static enum ID_FIELD_STATUS party_name_write(struct ast_party_name *name, int argc, char *argv[], const char *value)
static enum ID_FIELD_STATUS party_number_write(struct ast_party_number *number, int argc, char *argv[], const char *value)
static int connectedline_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
@ CONNECTED_LINE_OPT_ARG_ARRAY_SIZE
@ CONNECTED_LINE_OPT_DUMMY
@ REDIRECTING_OPT_INHIBIT
static enum ID_FIELD_STATUS party_id_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_id *id)
static int redirecting_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static enum ID_FIELD_STATUS party_subaddress_write(struct ast_party_subaddress *subaddress, int argc, char *argv[], const char *value)
static const struct ast_app_option redirecting_opts[128]
static enum ID_FIELD_STATUS party_name_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_name *name)
static enum ID_FIELD_STATUS party_subaddress_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_subaddress *subaddress)
static const struct ast_app_option connectedline_opts[128]
static enum ID_FIELD_STATUS party_number_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_number *number)
static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int load_module(void)
static struct ast_custom_function callerid_function
static int connectedline_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function connectedline_function
static int unload_module(void)
@ CONNECTED_LINE_OPT_INHIBIT
static int redirecting_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function redirecting_function
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DEFINE_APP_ARGS_TYPE(type, arglist)
Define a structure type to hold an application's arguments.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Core PBX routines and definitions.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
char * ast_trim_blanks(char *str)
Trims trailing whitespace characters from a string.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char *attribute_pure ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
Structure used to handle boolean flags.
Caller Party information.
struct ast_party_id priv
Private caller party ID.
struct ast_party_id id
Caller party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
Connected Line/Party information.
Dialed/Called Party information.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
char * str
Subscriber phone number (Malloced)
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
struct ast_party_dialed::@221 number
Dialed/Called number.
Information needed to identify an endpoint in a call.
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
Information needed to specify a name in a call.
int presentation
Q.931 encoded presentation-indicator encoded field.
Information needed to specify a number in a call.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
int code
enum AST_REDIRECTING_REASON value for redirection
char * str
a string value for the redirecting reason
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation.
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
int count
Number of times the call was redirected.
struct ast_party_id to
Call is redirecting to a new party (Sent to the caller)
struct ast_party_id orig
Who originally redirected the call (Sent to the party the call is redirected toward)
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
Information needed to specify a subaddress in a call.
unsigned char odd_even_indicator
TRUE if odd number of address signals.
unsigned char valid
TRUE if the subaddress information is valid/present.
char * str
Malloced subaddress string.
int type
Q.931 subaddress type.
Indicate what information in ast_party_connected_line should be set.
Indicate what information in ast_party_redirecting should be set.
#define ast_test_flag(p, flag)