504 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
505 snprintf(buf, len,
"%d", name->
valid);
506 }
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
508 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
543 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
544 snprintf(buf, len,
"%d", number->
valid);
545 }
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
546 snprintf(buf, len,
"%d", number->
plan);
547 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
579 if (subaddress->
str) {
582 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
583 snprintf(buf, len,
"%d", subaddress->
valid);
584 }
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
585 snprintf(buf, len,
"%d", subaddress->
type);
586 }
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
620 if (argc == 1 && !strcasecmp(
"all", argv[0])) {
621 snprintf(buf, len,
"\"%s\" <%s>",
624 }
else if (!strcasecmp(
"name", argv[0])) {
626 }
else if (!strncasecmp(
"num", argv[0], 3)) {
629 }
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
632 }
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
636 }
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
639 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
679 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
680 name->
valid = atoi(value) ? 1 : 0;
681 }
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
687 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
688 char_set = atoi(val);
695 "Unknown name char-set '%s', value unchanged\n", val);
700 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
707 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
715 "Unknown name presentation '%s', value unchanged\n", val);
753 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
754 number->
valid = atoi(value) ? 1 : 0;
755 }
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
759 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
760 number->
plan = atoi(val);
763 "Unknown type-of-number/numbering-plan '%s', value unchanged\n", val);
766 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
773 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
781 "Unknown number presentation '%s', value unchanged\n", val);
817 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
818 subaddress->
valid = atoi(value) ? 1 : 0;
819 }
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
820 subaddress->
type = atoi(value) ? 2 : 0;
821 }
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
856 if (argc == 1 && !strcasecmp(
"all", argv[0])) {
866 id->number.valid = 1;
871 }
else if (!strcasecmp(
"name", argv[0])) {
873 }
else if (!strncasecmp(
"num", argv[0], 3)) {
876 }
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
879 }
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
882 }
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
886 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
896 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
904 "Unknown combined presentation '%s', value unchanged\n", val);
907 id->name.presentation = pres;
908 id->number.presentation = pres;
948 if (
args.argc == 0) {
959 if (
args.argc == 2) {
965 if (member.
argc == 1 && !strcasecmp(
"all", member.
subnames[0])) {
966 snprintf(buf, len,
"\"%s\" <%s>", name, num);
967 }
else if (member.
argc == 1 && !strcasecmp(
"name", member.
subnames[0])) {
969 }
else if (member.
argc == 1 && !strncasecmp(
"num", member.
subnames[0], 3)) {
979 if (member.
argc == 1 && !strcasecmp(
"rdnis", member.
subnames[0])) {
984 }
else if (!strcasecmp(
"dnid", member.
subnames[0])) {
985 if (member.
argc == 1) {
990 if (!strncasecmp(
"num", member.
subnames[1], 3)) {
995 if (member.
argc == 2) {
1000 }
else if (member.
argc == 3 && !strcasecmp(
"plan", member.
subnames[2])) {
1006 }
else if (!strncasecmp(
"subaddr", member.
subnames[1], 7)) {
1024 }
else if (member.
argc == 1 && !strcasecmp(
"ani2", member.
subnames[0])) {
1026 }
else if (!strcasecmp(
"ani", member.
subnames[0])) {
1027 if (member.
argc == 1) {
1042 }
else if (!strcasecmp(
"priv", member.
subnames[0])) {
1093 if (!value || !chan) {
1099 if (args.
argc == 0) {
1113 if (member.
argc == 1 && !strcasecmp(
"rdnis", member.
subnames[0])) {
1117 }
else if (!strcasecmp(
"dnid", member.
subnames[0])) {
1119 if (member.
argc == 1) {
1124 if (!strncasecmp(
"num", member.
subnames[1], 3)) {
1129 if (member.
argc == 2) {
1134 }
else if (member.
argc == 3 && !strcasecmp(
"plan", member.
subnames[2])) {
1139 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1143 "Unknown type-of-number/numbering-plan '%s', value unchanged\n", val);
1148 }
else if (!strncasecmp(
"subaddr", member.
subnames[1], 7)) {
1169 }
else if (member.
argc == 1 && !strcasecmp(
"ani2", member.
subnames[0])) {
1173 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1178 }
else if (!strcasecmp(
"ani", member.
subnames[0])) {
1180 if (member.
argc == 1) {
1197 }
else if (!strcasecmp(
"priv", member.
subnames[0])) {
1266 if (member.
argc == 1 && !strcasecmp(
"source", member.
subnames[0])) {
1268 }
else if (!strcasecmp(
"priv", member.
subnames[0])) {
1320 if (!value || !chan) {
1326 if (args.
argc == 0) {
1355 if (member.
argc == 1 && !strcasecmp(
"source", member.
subnames[0])) {
1361 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1368 ast_log(
LOG_ERROR,
"Unknown connectedline source '%s', value unchanged\n", val);
1370 connected.
source = source;
1371 set_it(chan, &connected,
NULL);
1373 }
else if (!strcasecmp(
"priv", member.
subnames[0])) {
1377 set_it(chan, &connected,
NULL);
1390 set_it(chan, &connected,
NULL);
1441 if (!strcasecmp(
"orig", member.
subnames[0])) {
1442 if (member.
argc == 2 && !strcasecmp(
"reason", member.
subnames[1])) {
1447 &ast_redirecting->
orig);
1457 }
else if (!strcasecmp(
"from", member.
subnames[0])) {
1459 &ast_redirecting->
from);
1468 }
else if (!strcasecmp(
"to", member.
subnames[0])) {
1470 &ast_redirecting->
to);
1479 }
else if (member.
argc == 1 && !strncasecmp(
"pres", member.
subnames[0], 4)) {
1487 }
else if (member.
argc == 1 && !strcasecmp(
"reason", member.
subnames[0])) {
1489 }
else if (member.
argc == 1 && !strcasecmp(
"count", member.
subnames[0])) {
1490 snprintf(buf, len,
"%d", ast_redirecting->
count);
1491 }
else if (1 < member.
argc && !strcasecmp(
"priv", member.
subnames[0])) {
1492 if (!strcasecmp(
"orig", member.
subnames[1])) {
1503 }
else if (!strcasecmp(
"from", member.
subnames[1])) {
1514 }
else if (!strcasecmp(
"to", member.
subnames[1])) {
1561 if (!value || !chan) {
1567 if (args.
argc == 0) {
1596 if (!strcasecmp(
"orig", member.
subnames[0])) {
1597 if (member.
argc == 2 && !strcasecmp(
"reason", member.
subnames[1])) {
1603 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1616 set_it(chan, &redirecting,
NULL);
1620 set_it(chan, &redirecting,
NULL);
1627 set_it(chan, &redirecting,
NULL);
1637 }
else if (!strcasecmp(
"from", member.
subnames[0])) {
1642 set_it(chan, &redirecting,
NULL);
1651 }
else if (!strcasecmp(
"to", member.
subnames[0])) {
1655 set_it(chan, &redirecting,
NULL);
1664 }
else if (member.
argc == 1 && !strncasecmp(
"pres", member.
subnames[0], 4)) {
1670 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1678 "Unknown redirecting combined presentation '%s', value unchanged\n", val);
1684 set_it(chan, &redirecting,
NULL);
1686 }
else if (member.
argc == 1 && !strcasecmp(
"reason", member.
subnames[0])) {
1692 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1705 set_it(chan, &redirecting,
NULL);
1709 set_it(chan, &redirecting,
NULL);
1711 }
else if (member.
argc == 1 && !strcasecmp(
"count", member.
subnames[0])) {
1715 if ((
'0' <= val[0]) && (val[0] <=
'9')) {
1716 redirecting.
count = atoi(val);
1717 set_it(chan, &redirecting,
NULL);
1719 ast_log(
LOG_ERROR,
"Unknown redirecting count '%s', value unchanged\n", val);
1721 }
else if (1 < member.
argc && !strcasecmp(
"priv", member.
subnames[0])) {
1722 if (!strcasecmp(
"orig", member.
subnames[1])) {
1727 set_it(chan, &redirecting,
NULL);
1736 }
else if (!strcasecmp(
"from", member.
subnames[1])) {
1741 set_it(chan, &redirecting,
NULL);
1750 }
else if (!strcasecmp(
"to", member.
subnames[1])) {
1754 set_it(chan, &redirecting,
NULL);
1781 .
name =
"CONNECTEDLINE",
1787 .
name =
"REDIRECTING",
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static enum ID_FIELD_STATUS party_subaddress_write(struct ast_party_subaddress *subaddress, int argc, char *argv[], const char *value)
Information needed to identify an endpoint in a call.
int presentation
Q.931 encoded presentation-indicator encoded field.
#define ast_channel_lock(chan)
static int unload_module(void)
Main Channel structure associated with a channel.
struct ast_party_dialed::@246 number
Dialed/Called number.
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
char * str
Subscriber phone number (Malloced)
const char * ast_named_caller_presentation(int data)
Convert caller ID pres value to text code.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
struct ast_party_id priv_to
Call is redirecting to a new party (Sent to the caller) - private representation. ...
char * str
Subscriber phone number (Malloced)
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...
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)
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...
struct ast_party_id id
Connected party ID.
static struct ast_custom_function redirecting_function
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_test_flag(p, flag)
struct ast_party_id priv_orig
Who originally redirected the call (Sent to the party the call is redirected toward) - private repres...
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
struct ast_party_name name
Subscriber name.
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
const char * ast_connected_line_source_name(int data)
Convert connected line update source value to text code.
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.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static enum ID_FIELD_STATUS party_name_write(struct ast_party_name *name, int argc, char *argv[], const char *value)
static int connectedline_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
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(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.
int ast_redirecting_reason_parse(const char *data)
Convert redirecting reason text code to value (used in config file parsing)
struct ast_party_id priv_from
Who is redirecting the call (Sent to the party the call is redirected toward) - private representatio...
int char_set
Character set the name is using.
char * str
Subscriber name (Malloced)
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
unsigned char valid
TRUE if the subaddress information is valid/present.
#define AST_DEFINE_APP_ARGS_TYPE(type, arglist)
Define a structure type to hold an application's arguments.
#define ast_strdup(str)
A wrapper for strdup()
void ast_party_connected_line_free(struct ast_party_connected_line *doomed)
Destroy the connected line information contents.
static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
char * str
Malloced subaddress string.
static struct ast_custom_function callerid_function
const char * ast_redirecting_reason_name(const struct ast_party_redirecting_reason *data)
Convert redirecting reason value to text code.
static enum ID_FIELD_STATUS party_number_write(struct ast_party_number *number, int argc, char *argv[], const char *value)
static enum ID_FIELD_STATUS party_number_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_number *number)
int code
enum AST_REDIRECTING_REASON value for redirection
unsigned char odd_even_indicator
TRUE if odd number of address signals.
const char *const subnames[]
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
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_id orig
Who originally redirected the call (Sent to the party the call is redirected toward) ...
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
static int connectedline_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
struct ast_party_id id
Caller party ID.
static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static enum ID_FIELD_STATUS party_name_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_name *name)
struct ast_party_id ani
Automatic Number Identification (ANI)
General Asterisk PBX channel definitions.
static enum ID_FIELD_STATUS party_subaddress_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_subaddress *subaddress)
struct ast_party_redirecting_reason orig_reason
Reason for the redirection by the original party.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
Data structure associated with a custom dialplan function.
Caller Party information.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_party_name_charset_parse(const char *data)
Convert ast_party_name.char_set text code to value (used in config file parsing)
struct ast_party_id priv
Private caller party ID.
#define ast_strdupa(s)
duplicate a string in memory from the stack
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.
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.
Core PBX routines and definitions.
int ast_parse_caller_presentation(const char *data)
Convert caller ID text code to value (used in config file parsing)
static const struct ast_app_option connectedline_opts[128]
static enum ID_FIELD_STATUS party_id_read(char *buf, size_t len, int argc, char *argv[], const struct ast_party_id *id)
struct ast_party_subaddress subaddress
Subscriber subaddress.
Dialed/Called Party information.
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.
int plan
Q.931 Type-Of-Number and Numbering-Plan encoded fields.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ani2
Automatic Number Identification 2 (Info Digits)
Connected Line/Party information.
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
Redirecting Line information. RDNIS (Redirecting Directory Number Information Service) Where a call d...
char * ast_trim_blanks(char *str)
Trims trailing whitespace characters from a string.
static int redirecting_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
char * str
a string value for the redirecting reason
#define ast_channel_unlock(chan)
static const struct ast_app_option redirecting_opts[128]
static int redirecting_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int source
Information about the source of an update.
Module has failed to load, may be in an inconsistent state.
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
Structure used to handle boolean flags.
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
Indicate what information in ast_party_connected_line should be set.
const char * ast_party_name_charset_str(int data)
Convert ast_party_name.char_set value to text code.
char * tag
User-set "tag".
int type
Q.931 subaddress type.
void ast_party_redirecting_free(struct ast_party_redirecting *doomed)
Destroy the redirecting information contents.
Indicate what information in ast_party_redirecting should be set.
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)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static enum ID_FIELD_STATUS party_id_write(struct ast_party_id *id, int argc, char *argv[], const char *value)
Information needed to specify a number in a call.
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_dialed_free(struct ast_party_dialed *doomed)
Destroy the dialed party contents.
unsigned char valid
TRUE if the name information is valid/present.
Information needed to specify a subaddress in a call.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Information needed to specify a name in a call.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
struct ast_party_id priv
Private connected party ID.
unsigned char valid
TRUE if the number information is valid/present.
#define ast_custom_function_register(acf)
Register a custom function.
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.
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.
#define AST_APP_ARG(name)
Define an application argument.
static int load_module(void)
static struct ast_custom_function connectedline_function
struct ast_party_number number
Subscriber phone number.