521 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
523 }
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
525 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
560 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
562 }
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
564 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
596 if (subaddress->
str) {
599 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
601 }
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
603 }
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
637 if (argc == 1 && !strcasecmp(
"all", argv[0])) {
638 snprintf(
buf,
len,
"\"%s\" <%s>",
640 S_COR(
id->number.valid,
id->number.str,
""));
641 }
else if (!strcasecmp(
"name", argv[0])) {
643 }
else if (!strncasecmp(
"num", argv[0], 3)) {
646 }
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
649 }
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
653 }
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
655 snprintf(
buf,
len,
"%d",
id->number.plan);
656 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
696 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
698 }
else if (argc == 1 && !strcasecmp(
"charset", argv[0])) {
704 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
705 char_set = atoi(
val);
712 "Unknown name char-set '%s', value unchanged\n",
val);
715 name->char_set = char_set;
717 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
724 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
732 "Unknown name presentation '%s', value unchanged\n",
val);
735 name->presentation = pres;
770 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
772 }
else if (argc == 1 && !strcasecmp(
"plan", argv[0])) {
776 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
780 "Unknown type-of-number/numbering-plan '%s', value unchanged\n",
val);
783 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
790 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
798 "Unknown number presentation '%s', value unchanged\n",
val);
801 number->presentation = pres;
834 }
else if (argc == 1 && !strcasecmp(
"valid", argv[0])) {
836 }
else if (argc == 1 && !strcasecmp(
"type", argv[0])) {
838 }
else if (argc == 1 && !strcasecmp(
"odd", argv[0])) {
873 if (argc == 1 && !strcasecmp(
"all", argv[0])) {
883 id->number.valid = 1;
885 if (!
id->number.str) {
888 }
else if (!strcasecmp(
"name", argv[0])) {
890 }
else if (!strncasecmp(
"num", argv[0], 3)) {
893 }
else if (!strncasecmp(
"subaddr", argv[0], 7)) {
896 }
else if (argc == 1 && !strcasecmp(
"tag", argv[0])) {
899 }
else if (argc == 1 && !strcasecmp(
"ton", argv[0])) {
903 }
else if (argc == 1 && !strncasecmp(
"pres", argv[0], 4)) {
913 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
921 "Unknown combined presentation '%s', value unchanged\n",
val);
924 id->name.presentation = pres;
925 id->number.presentation = pres;
965 if (
args.argc == 0) {
976 if (
args.argc == 2) {
982 if (
member.argc == 1 && !strcasecmp(
"all",
member.subnames[0])) {
984 }
else if (
member.argc == 1 && !strcasecmp(
"name",
member.subnames[0])) {
986 }
else if (
member.argc == 1 && !strncasecmp(
"num",
member.subnames[0], 3)) {
996 if (
member.argc == 1 && !strcasecmp(
"rdnis",
member.subnames[0])) {
1001 }
else if (!strcasecmp(
"dnid",
member.subnames[0])) {
1005 member.subnames[1] =
"num";
1007 if (!strncasecmp(
"num",
member.subnames[1], 3)) {
1017 }
else if (
member.argc == 3 && !strcasecmp(
"plan",
member.subnames[2])) {
1023 }
else if (!strncasecmp(
"subaddr",
member.subnames[1], 7)) {
1041 }
else if (
member.argc == 1 && !strcasecmp(
"ani2",
member.subnames[0])) {
1043 }
else if (!strcasecmp(
"ani",
member.subnames[0])) {
1047 member.subnames[1] =
"num";
1059 }
else if (!strcasecmp(
"priv",
member.subnames[0])) {
1110 if (!
value || !chan) {
1116 if (
args.argc == 0) {
1130 if (
member.argc == 1 && !strcasecmp(
"rdnis",
member.subnames[0])) {
1134 }
else if (!strcasecmp(
"dnid",
member.subnames[0])) {
1139 member.subnames[1] =
"num";
1141 if (!strncasecmp(
"num",
member.subnames[1], 3)) {
1151 }
else if (
member.argc == 3 && !strcasecmp(
"plan",
member.subnames[2])) {
1156 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1160 "Unknown type-of-number/numbering-plan '%s', value unchanged\n",
val);
1165 }
else if (!strncasecmp(
"subaddr",
member.subnames[1], 7)) {
1186 }
else if (
member.argc == 1 && !strcasecmp(
"ani2",
member.subnames[0])) {
1190 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1195 }
else if (!strcasecmp(
"ani",
member.subnames[0])) {
1200 member.subnames[1] =
"num";
1214 }
else if (!strcasecmp(
"priv",
member.subnames[0])) {
1283 if (
member.argc == 1 && !strcasecmp(
"source",
member.subnames[0])) {
1285 }
else if (!strcasecmp(
"priv",
member.subnames[0])) {
1337 if (!
value || !chan) {
1343 if (
args.argc == 0) {
1372 if (
member.argc == 1 && !strcasecmp(
"source",
member.subnames[0])) {
1378 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1390 }
else if (!strcasecmp(
"priv",
member.subnames[0])) {
1458 if (!strcasecmp(
"orig",
member.subnames[0])) {
1459 if (
member.argc == 2 && !strcasecmp(
"reason",
member.subnames[1])) {
1464 &ast_redirecting->
orig);
1474 }
else if (!strcasecmp(
"from",
member.subnames[0])) {
1476 &ast_redirecting->
from);
1485 }
else if (!strcasecmp(
"to",
member.subnames[0])) {
1487 &ast_redirecting->
to);
1496 }
else if (
member.argc == 1 && !strncasecmp(
"pres",
member.subnames[0], 4)) {
1504 }
else if (
member.argc == 1 && !strcasecmp(
"reason",
member.subnames[0])) {
1506 }
else if (
member.argc == 1 && !strcasecmp(
"count",
member.subnames[0])) {
1508 }
else if (1 <
member.argc && !strcasecmp(
"priv",
member.subnames[0])) {
1509 if (!strcasecmp(
"orig",
member.subnames[1])) {
1520 }
else if (!strcasecmp(
"from",
member.subnames[1])) {
1531 }
else if (!strcasecmp(
"to",
member.subnames[1])) {
1578 if (!
value || !chan) {
1584 if (
args.argc == 0) {
1613 if (!strcasecmp(
"orig",
member.subnames[0])) {
1614 if (
member.argc == 2 && !strcasecmp(
"reason",
member.subnames[1])) {
1620 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1634 set_it(chan, &redirecting,
NULL);
1638 set_it(chan, &redirecting,
NULL);
1645 set_it(chan, &redirecting,
NULL);
1655 }
else if (!strcasecmp(
"from",
member.subnames[0])) {
1660 set_it(chan, &redirecting,
NULL);
1669 }
else if (!strcasecmp(
"to",
member.subnames[0])) {
1673 set_it(chan, &redirecting,
NULL);
1682 }
else if (
member.argc == 1 && !strncasecmp(
"pres",
member.subnames[0], 4)) {
1688 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1696 "Unknown redirecting combined presentation '%s', value unchanged\n",
val);
1702 set_it(chan, &redirecting,
NULL);
1704 }
else if (
member.argc == 1 && !strcasecmp(
"reason",
member.subnames[0])) {
1710 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1724 set_it(chan, &redirecting,
NULL);
1728 set_it(chan, &redirecting,
NULL);
1730 }
else if (
member.argc == 1 && !strcasecmp(
"count",
member.subnames[0])) {
1734 if ((
'0' <=
val[0]) && (
val[0] <=
'9')) {
1736 set_it(chan, &redirecting,
NULL);
1740 }
else if (1 <
member.argc && !strcasecmp(
"priv",
member.subnames[0])) {
1741 if (!strcasecmp(
"orig",
member.subnames[1])) {
1746 set_it(chan, &redirecting,
NULL);
1755 }
else if (!strcasecmp(
"from",
member.subnames[1])) {
1760 set_it(chan, &redirecting,
NULL);
1769 }
else if (!strcasecmp(
"to",
member.subnames[1])) {
1773 set_it(chan, &redirecting,
NULL);
1800 .
name =
"CONNECTEDLINE",
1806 .
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 * 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_dialed::@208 number
Dialed/Called number.
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.
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)