diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_alarmreceiver.c | 4 | ||||
-rw-r--r-- | apps/app_amd.c | 4 | ||||
-rw-r--r-- | apps/app_confbridge.c | 14 | ||||
-rw-r--r-- | apps/app_dial.c | 118 | ||||
-rw-r--r-- | apps/app_disa.c | 10 | ||||
-rw-r--r-- | apps/app_dumpchan.c | 14 | ||||
-rw-r--r-- | apps/app_fax.c | 8 | ||||
-rw-r--r-- | apps/app_followme.c | 6 | ||||
-rw-r--r-- | apps/app_macro.c | 10 | ||||
-rw-r--r-- | apps/app_meetme.c | 48 | ||||
-rw-r--r-- | apps/app_minivm.c | 28 | ||||
-rw-r--r-- | apps/app_mixmonitor.c | 2 | ||||
-rw-r--r-- | apps/app_osplookup.c | 12 | ||||
-rw-r--r-- | apps/app_parkandannounce.c | 6 | ||||
-rw-r--r-- | apps/app_privacy.c | 10 | ||||
-rw-r--r-- | apps/app_queue.c | 88 | ||||
-rw-r--r-- | apps/app_readexten.c | 6 | ||||
-rw-r--r-- | apps/app_rpt.c | 36 | ||||
-rw-r--r-- | apps/app_setcallerid.c | 4 | ||||
-rw-r--r-- | apps/app_sms.c | 2 | ||||
-rw-r--r-- | apps/app_stack.c | 12 | ||||
-rw-r--r-- | apps/app_talkdetect.c | 2 | ||||
-rw-r--r-- | apps/app_voicemail.c | 50 | ||||
-rw-r--r-- | apps/app_while.c | 4 | ||||
-rw-r--r-- | apps/app_zapateller.c | 4 |
25 files changed, 251 insertions, 251 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index c4309e065..574a59d35 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -309,7 +309,7 @@ static int write_metadata( FILE *logfile, char *signalling_type, struct ast_chan /* Extract the caller ID location */ ast_copy_string(workstring, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""), sizeof(workstring)); ast_shrink_phone_number(workstring); if (ast_strlen_zero(workstring)) { @@ -317,7 +317,7 @@ static int write_metadata( FILE *logfile, char *signalling_type, struct ast_chan } else { cl = workstring; } - cn = S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>"); + cn = S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, "<unknown>"); /* Get the current time */ t = ast_tvnow(); diff --git a/apps/app_amd.c b/apps/app_amd.c index 6aefe9ac9..597aac39c 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -193,8 +193,8 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) ast_format_clear(&readFormat); ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", ast_channel_name(chan), - S_COR(chan->caller.ani.number.valid, chan->caller.ani.number.str, "(N/A)"), - S_COR(chan->redirecting.from.number.valid, chan->redirecting.from.number.str, "(N/A)"), + S_COR(ast_channel_caller(chan)->ani.number.valid, ast_channel_caller(chan)->ani.number.str, "(N/A)"), + S_COR(ast_channel_redirecting(chan)->from.number.valid, ast_channel_redirecting(chan)->from.number.str, "(N/A)"), ast_getformatname(ast_channel_readformat(chan))); /* Lets parse the arguments. */ diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 299864022..b5b27ed2f 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -548,8 +548,8 @@ static void send_join_event(struct ast_channel *chan, const char *conf_name) ast_channel_name(chan), ast_channel_uniqueid(chan), conf_name, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>") + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, "<unknown>") ); } @@ -564,8 +564,8 @@ static void send_leave_event(struct ast_channel *chan, const char *conf_name) ast_channel_name(chan), ast_channel_uniqueid(chan), conf_name, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>") + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, "<unknown>") ); } @@ -2008,7 +2008,7 @@ static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct ast_cli(a->fd, "%-17s", participant->u_profile.name); ast_cli(a->fd, "%-17s", participant->b_profile.name); ast_cli(a->fd, "%-17s", participant->menu_name); - ast_cli(a->fd, "%-17s", S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>")); + ast_cli(a->fd, "%-17s", S_COR(ast_channel_caller(participant->chan)->id.number.valid, ast_channel_caller(participant->chan)->id.number.str, "<unknown>")); ast_cli(a->fd, "\n"); } ao2_unlock(bridge); @@ -2346,8 +2346,8 @@ static int action_confbridgelist(struct mansession *s, const struct message *m) "\r\n", id_text, bridge->name, - S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>"), - S_COR(participant->chan->caller.id.name.valid, participant->chan->caller.id.name.str, "<no name>"), + S_COR(ast_channel_caller(participant->chan)->id.number.valid, ast_channel_caller(participant->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(participant->chan)->id.name.valid, ast_channel_caller(participant->chan)->id.name.str, "<no name>"), ast_channel_name(participant->chan), ast_test_flag(&participant->u_profile, USER_OPT_ADMIN) ? "Yes" : "No", ast_test_flag(&participant->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No"); diff --git a/apps/app_dial.c b/apps/app_dial.c index 20747c0f6..d12ea9c58 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -802,10 +802,10 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst, cons "DestUniqueID: %s\r\n" "Dialstring: %s\r\n", ast_channel_name(src), ast_channel_name(dst), - S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"), - S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"), - S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"), - S_COR(src->connected.id.name.valid, src->connected.id.name.str, "<unknown>"), + S_COR(ast_channel_caller(src)->id.number.valid, ast_channel_caller(src)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(src)->id.name.valid, ast_channel_caller(src)->id.name.str, "<unknown>"), + S_COR(ast_channel_connected(src)->id.number.valid, ast_channel_connected(src)->id.number.str, "<unknown>"), + S_COR(ast_channel_connected(src)->id.name.valid, ast_channel_connected(src)->id.name.str, "<unknown>"), ast_channel_uniqueid(src), ast_channel_uniqueid(dst), dialstring ? dialstring : ""); } @@ -897,33 +897,33 @@ static void do_forward(struct chanlist *o, ast_rtp_instance_early_bridge_make_compatible(c, in); } - ast_channel_set_redirecting(c, &original->redirecting, NULL); + ast_channel_set_redirecting(c, ast_channel_redirecting(original), NULL); ast_channel_lock(c); while (ast_channel_trylock(in)) { CHANNEL_DEADLOCK_AVOIDANCE(c); } - if (!c->redirecting.from.number.valid - || ast_strlen_zero(c->redirecting.from.number.str)) { + if (!ast_channel_redirecting(c)->from.number.valid + || ast_strlen_zero(ast_channel_redirecting(c)->from.number.str)) { /* * The call was not previously redirected so it is * now redirected from this number. */ - ast_party_number_free(&c->redirecting.from.number); - ast_party_number_init(&c->redirecting.from.number); - c->redirecting.from.number.valid = 1; - c->redirecting.from.number.str = + ast_party_number_free(&ast_channel_redirecting(c)->from.number); + ast_party_number_init(&ast_channel_redirecting(c)->from.number); + ast_channel_redirecting(c)->from.number.valid = 1; + ast_channel_redirecting(c)->from.number.str = ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in))); } - c->dialed.transit_network_select = in->dialed.transit_network_select; + ast_channel_dialed(c)->transit_network_select = ast_channel_dialed(in)->transit_network_select; /* Determine CallerID to store in outgoing channel. */ - ast_party_caller_set_init(&caller, &c->caller); + ast_party_caller_set_init(&caller, ast_channel_caller(c)); if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) { caller.id = *stored_clid; ast_channel_set_caller_event(c, &caller, NULL); - } else if (ast_strlen_zero(S_COR(c->caller.id.number.valid, - c->caller.id.number.str, NULL))) { + } else if (ast_strlen_zero(S_COR(ast_channel_caller(c)->id.number.valid, + ast_channel_caller(c)->id.number.str, NULL))) { /* * The new channel has no preset CallerID number by the channel * driver. Use the dialplan extension and hint name. @@ -938,9 +938,9 @@ static void do_forward(struct chanlist *o, ast_party_connected_line_init(&connected); connected.id = *forced_clid; - ast_party_connected_line_copy(&c->connected, &connected); + ast_party_connected_line_copy(ast_channel_connected(c), &connected); } else { - ast_connected_line_copy_from_caller(&c->connected, &in->caller); + ast_connected_line_copy_from_caller(ast_channel_connected(c), ast_channel_caller(in)); } ast_channel_accountcode_set(c, ast_channel_accountcode(in)); @@ -954,7 +954,7 @@ static void do_forward(struct chanlist *o, * here. */ ast_party_redirecting_init(&redirecting); - ast_party_redirecting_copy(&redirecting, &c->redirecting); + ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(c)); ast_channel_unlock(c); if (ast_channel_redirecting_sub(c, in, &redirecting, 0) && ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) { @@ -1047,7 +1047,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) { ast_channel_lock(outgoing->chan); - ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller); + ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(outgoing->chan)); ast_channel_unlock(outgoing->chan); connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; ast_channel_update_connected_line(in, &connected_caller, NULL); @@ -1112,7 +1112,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } } else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) { ast_channel_lock(c); - ast_connected_line_copy_from_caller(&connected_caller, &c->caller); + ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(c)); ast_channel_unlock(c); connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; ast_channel_update_connected_line(in, &connected_caller, NULL); @@ -1183,7 +1183,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } } else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) { ast_channel_lock(c); - ast_connected_line_copy_from_caller(&connected_caller, &c->caller); + ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(c)); ast_channel_unlock(c); connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; ast_channel_update_connected_line(in, &connected_caller, NULL); @@ -1714,9 +1714,9 @@ static int setup_privacy_args(struct privacy_args *pa, int res; char *l; - if (chan->caller.id.number.valid - && !ast_strlen_zero(chan->caller.id.number.str)) { - l = ast_strdupa(chan->caller.id.number.str); + if (ast_channel_caller(chan)->id.number.valid + && !ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) { + l = ast_strdupa(ast_channel_caller(chan)->id.number.str); ast_shrink_phone_number(l); if (ast_test_flag64(opts, OPT_PRIVACY) ) { ast_verb(3, "Privacy DB is '%s', clid is '%s'\n", opt_args[OPT_ARG_PRIVACY], l); @@ -2044,18 +2044,18 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast if (ast_test_flag64(&opts, OPT_ORIGINAL_CLID)) { if (ast_strlen_zero(opt_args[OPT_ARG_ORIGINAL_CLID])) { ast_channel_lock(chan); - ast_party_id_set_init(&stored_clid, &chan->caller.id); - if (!ast_strlen_zero(chan->caller.id.name.str)) { - stored_clid.name.str = ast_strdupa(chan->caller.id.name.str); + ast_party_id_set_init(&stored_clid, &ast_channel_caller(chan)->id); + if (!ast_strlen_zero(ast_channel_caller(chan)->id.name.str)) { + stored_clid.name.str = ast_strdupa(ast_channel_caller(chan)->id.name.str); } - if (!ast_strlen_zero(chan->caller.id.number.str)) { - stored_clid.number.str = ast_strdupa(chan->caller.id.number.str); + if (!ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) { + stored_clid.number.str = ast_strdupa(ast_channel_caller(chan)->id.number.str); } - if (!ast_strlen_zero(chan->caller.id.subaddress.str)) { - stored_clid.subaddress.str = ast_strdupa(chan->caller.id.subaddress.str); + if (!ast_strlen_zero(ast_channel_caller(chan)->id.subaddress.str)) { + stored_clid.subaddress.str = ast_strdupa(ast_channel_caller(chan)->id.subaddress.str); } - if (!ast_strlen_zero(chan->caller.id.tag)) { - stored_clid.tag = ast_strdupa(chan->caller.id.tag); + if (!ast_strlen_zero(ast_channel_caller(chan)->id.tag)) { + stored_clid.tag = ast_strdupa(ast_channel_caller(chan)->id.tag); } ast_channel_unlock(chan); } else { @@ -2127,7 +2127,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast char *tech = strsep(&number, "/"); /* find if we already dialed this interface */ struct ast_dialed_interface *di; - AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces; + AST_LIST_HEAD(,ast_dialed_interface) *dialed_interfaces; num_dialed++; if (ast_strlen_zero(number)) { ast_log(LOG_WARNING, "Dial argument takes format (technology/[device:]number1)\n"); @@ -2157,7 +2157,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast * previously acquired connected line info could have been set * through the CONNECTED_LINE dialplan function. */ - ast_party_connected_line_copy(&tmp->connected, &chan->connected); + ast_party_connected_line_copy(&tmp->connected, ast_channel_connected(chan)); ast_channel_unlock(chan); if (datastore) @@ -2255,44 +2255,44 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast ast_channel_appl_set(tc, "AppDial"); ast_channel_data_set(tc, "(Outgoing Line)"); - memset(&tc->whentohangup, 0, sizeof(tc->whentohangup)); + memset(ast_channel_whentohangup(tc), 0, sizeof(*ast_channel_whentohangup(tc))); /* Determine CallerID to store in outgoing channel. */ - ast_party_caller_set_init(&caller, &tc->caller); + ast_party_caller_set_init(&caller, ast_channel_caller(tc)); if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) { caller.id = stored_clid; ast_channel_set_caller_event(tc, &caller, NULL); ast_set_flag64(tmp, DIAL_CALLERID_ABSENT); - } else if (ast_strlen_zero(S_COR(tc->caller.id.number.valid, - tc->caller.id.number.str, NULL))) { + } else if (ast_strlen_zero(S_COR(ast_channel_caller(tc)->id.number.valid, + ast_channel_caller(tc)->id.number.str, NULL))) { /* * The new channel has no preset CallerID number by the channel * driver. Use the dialplan extension and hint name. */ caller.id = stored_clid; if (!caller.id.name.valid - && !ast_strlen_zero(S_COR(chan->connected.id.name.valid, - chan->connected.id.name.str, NULL))) { + && !ast_strlen_zero(S_COR(ast_channel_connected(chan)->id.name.valid, + ast_channel_connected(chan)->id.name.str, NULL))) { /* * No hint name available. We have a connected name supplied by * the dialplan we can use instead. */ caller.id.name.valid = 1; - caller.id.name = chan->connected.id.name; + caller.id.name = ast_channel_connected(chan)->id.name; } ast_channel_set_caller_event(tc, &caller, NULL); ast_set_flag64(tmp, DIAL_CALLERID_ABSENT); - } else if (ast_strlen_zero(S_COR(tc->caller.id.name.valid, tc->caller.id.name.str, + } else if (ast_strlen_zero(S_COR(ast_channel_caller(tc)->id.name.valid, ast_channel_caller(tc)->id.name.str, NULL))) { /* The new channel has no preset CallerID name by the channel driver. */ - if (!ast_strlen_zero(S_COR(chan->connected.id.name.valid, - chan->connected.id.name.str, NULL))) { + if (!ast_strlen_zero(S_COR(ast_channel_connected(chan)->id.name.valid, + ast_channel_connected(chan)->id.name.str, NULL))) { /* * We have a connected name supplied by the dialplan we can * use instead. */ caller.id.name.valid = 1; - caller.id.name = chan->connected.id.name; + caller.id.name = ast_channel_connected(chan)->id.name; ast_channel_set_caller_event(tc, &caller, NULL); } } @@ -2301,16 +2301,16 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast if (ast_test_flag64(peerflags, OPT_FORCECLID) && !force_forwards_only) { struct ast_party_connected_line connected; - ast_party_connected_line_set_init(&connected, &tc->connected); + ast_party_connected_line_set_init(&connected, ast_channel_connected(tc)); connected.id = forced_clid; ast_channel_set_connected_line(tc, &connected, NULL); } else { - ast_connected_line_copy_from_caller(&tc->connected, &chan->caller); + ast_connected_line_copy_from_caller(ast_channel_connected(tc), ast_channel_caller(chan)); } - ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting); + ast_party_redirecting_copy(ast_channel_redirecting(tc), ast_channel_redirecting(chan)); - tc->dialed.transit_network_select = chan->dialed.transit_network_select; + ast_channel_dialed(tc)->transit_network_select = ast_channel_dialed(chan)->transit_network_select; if (!ast_strlen_zero(ast_channel_accountcode(chan))) { ast_channel_peeraccount_set(tc, ast_channel_accountcode(chan)); @@ -2672,8 +2672,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast if (gosub_argstart) { const char *what_is_s = "s"; *gosub_argstart = 0; - if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) && - ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) { + if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) && + ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) { what_is_s = "~~s~~"; } if (asprintf(&gosub_args, "%s,%s,1(%s)", opt_args[OPT_ARG_CALLEE_GOSUB], what_is_s, gosub_argstart + 1) < 0) { @@ -2683,8 +2683,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast *gosub_argstart = ','; } else { const char *what_is_s = "s"; - if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) && - ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) { + if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) && + ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) { what_is_s = "~~s~~"; } if (asprintf(&gosub_args, "%s,%s,1", opt_args[OPT_ARG_CALLEE_GOSUB], what_is_s) < 0) { @@ -2763,8 +2763,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast if (!res) { if (!ast_tvzero(calldurationlimit)) { - struct timeval whentohangup = calldurationlimit; - peer->whentohangup = ast_tvadd(ast_tvnow(), whentohangup); + struct timeval whentohangup = ast_tvadd(ast_tvnow(), calldurationlimit); + ast_channel_whentohangup_set(peer, &whentohangup); } if (!ast_strlen_zero(dtmfcalled)) { ast_verb(3, "Sending DTMF '%s' to the called party.\n", dtmfcalled); @@ -2839,7 +2839,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast if (ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, ast_channel_context(peer), "h", 1, - S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) { int autoloopflag; int found; int res9; @@ -2851,7 +2851,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast while ((res9 = ast_spawn_extension(peer, ast_channel_context(peer), ast_channel_exten(peer), ast_channel_priority(peer), - S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL), + S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL), &found, 1)) == 0) { ast_channel_priority_set(peer, ast_channel_priority(peer) + 1); } @@ -2908,7 +2908,7 @@ out: if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_INCOMPLETE)) { if (!ast_tvzero(calldurationlimit)) - memset(&chan->whentohangup, 0, sizeof(chan->whentohangup)); + memset(ast_channel_whentohangup(chan), 0, sizeof(*ast_channel_whentohangup(chan))); res = 0; } diff --git a/apps/app_disa.c b/apps/app_disa.c index 5de3acfa5..0432a0b61 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -314,9 +314,9 @@ static int disa_exec(struct ast_channel *chan, const char *data) if (j == '#') { /* end of extension .. maybe */ if (i == 0 && (ast_matchmore_extension(chan, args.context, "#", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)) + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)) || ast_exists_extension(chan, args.context, "#", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) ) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) ) { /* Let the # be the part of, or the entire extension */ } else { break; @@ -347,7 +347,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) /* if can do some more, do it */ if (!ast_matchmore_extension(chan, args.context, exten, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { break; } } @@ -360,7 +360,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) struct ast_flags cdr_flags = { AST_CDR_FLAG_POSTED }; if (!ast_exists_extension(chan, args.context, exten, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten); exten[0] = 'i'; exten[1] = '\0'; @@ -368,7 +368,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) } if (!recheck || ast_exists_extension(chan, args.context, exten, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_playtones_stop(chan); /* We're authenticated and have a target extension */ if (!ast_strlen_zero(args.cid)) { diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index c16318f68..42f889926 100644 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -131,12 +131,12 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) ast_channel_tech(c)->type, ast_channel_uniqueid(c), ast_channel_linkedid(c), - S_COR(c->caller.id.number.valid, c->caller.id.number.str, "(N/A)"), - S_COR(c->caller.id.name.valid, c->caller.id.name.str, "(N/A)"), - S_COR(c->connected.id.number.valid, c->connected.id.number.str, "(N/A)"), - S_COR(c->connected.id.name.valid, c->connected.id.name.str, "(N/A)"), - S_OR(c->dialed.number.str, "(N/A)"), - S_COR(c->redirecting.from.number.valid, c->redirecting.from.number.str, "(N/A)"), + S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, "(N/A)"), + S_COR(ast_channel_caller(c)->id.name.valid, ast_channel_caller(c)->id.name.str, "(N/A)"), + S_COR(ast_channel_connected(c)->id.number.valid, ast_channel_connected(c)->id.number.str, "(N/A)"), + S_COR(ast_channel_connected(c)->id.name.valid, ast_channel_connected(c)->id.name.str, "(N/A)"), + S_OR(ast_channel_dialed(c)->number.str, "(N/A)"), + S_COR(ast_channel_redirecting(c)->from.number.valid, ast_channel_redirecting(c)->from.number.str, "(N/A)"), ast_channel_parkinglot(c), ast_channel_language(c), ast_state2str(ast_channel_state(c)), @@ -154,7 +154,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) c->fds[0], ast_channel_fin(c) & ~DEBUGCHAN_FLAG, (ast_channel_fin(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "", ast_channel_fout(c) & ~DEBUGCHAN_FLAG, (ast_channel_fout(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "", - (long)c->whentohangup.tv_sec, + (long)ast_channel_whentohangup(c)->tv_sec, hour, min, sec, diff --git a/apps/app_fax.c b/apps/app_fax.c index 4d7382b5e..9d63a3c23 100644 --- a/apps/app_fax.c +++ b/apps/app_fax.c @@ -267,10 +267,10 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result) "FileName: %s\r\n", ast_channel_name(s->chan), ast_channel_exten(s->chan), - S_COR(s->chan->caller.id.number.valid, s->chan->caller.id.number.str, ""), - S_COR(s->chan->caller.id.name.valid, s->chan->caller.id.name.str, ""), - S_COR(s->chan->connected.id.number.valid, s->chan->connected.id.number.str, ""), - S_COR(s->chan->connected.id.name.valid, s->chan->connected.id.name.str, ""), + S_COR(ast_channel_caller(s->chan)->id.number.valid, ast_channel_caller(s->chan)->id.number.str, ""), + S_COR(ast_channel_caller(s->chan)->id.name.valid, ast_channel_caller(s->chan)->id.name.str, ""), + S_COR(ast_channel_connected(s->chan)->id.number.valid, ast_channel_connected(s->chan)->id.number.str, ""), + S_COR(ast_channel_connected(s->chan)->id.name.valid, ast_channel_connected(s->chan)->id.name.str, ""), far_ident, local_ident, pages_transferred, diff --git a/apps/app_followme.c b/apps/app_followme.c index dc824f573..c4d1a2d67 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -937,7 +937,7 @@ static void findmeexec(struct fm_args *tpargs) } /* We check if the extension exists, before creating the ast_channel struct */ - if (!ast_exists_extension(caller, tpargs->context, number, 1, S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL))) { + if (!ast_exists_extension(caller, tpargs->context, number, 1, S_COR(ast_channel_caller(caller)->id.number.valid, ast_channel_caller(caller)->id.number.str, NULL))) { ast_log(LOG_ERROR, "Extension '%s@%s' doesn't exist\n", number, tpargs->context); continue; } @@ -956,7 +956,7 @@ static void findmeexec(struct fm_args *tpargs) outbound = ast_request("Local", ast_channel_nativeformats(caller), caller, dialarg, &dg); if (outbound) { ast_channel_lock_both(caller, outbound); - ast_connected_line_copy_from_caller(&outbound->connected, &caller->caller); + ast_connected_line_copy_from_caller(ast_channel_connected(outbound), ast_channel_caller(caller)); ast_channel_inherit_variables(caller, outbound); ast_channel_datastore_inherit(caller, outbound); ast_channel_language_set(outbound, ast_channel_language(caller)); @@ -1266,7 +1266,7 @@ static int app_exec(struct ast_channel *chan, const char *data) targs.chan = chan; ast_copy_string(targs.namerecloc, namerecloc, sizeof(targs.namerecloc)); ast_channel_lock(chan); - ast_connected_line_copy_from_caller(&targs.connected_in, &chan->caller); + ast_connected_line_copy_from_caller(&targs.connected_in, ast_channel_caller(chan)); ast_channel_unlock(chan); findmeexec(&targs); diff --git a/apps/app_macro.c b/apps/app_macro.c index c324a36c3..cebfae7af 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -304,7 +304,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro); if (!ast_exists_extension(chan, fullmacro, "s", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { if (!ast_context_find(fullmacro)) ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n", fullmacro, macro, ast_channel_exten(chan), ast_channel_context(chan)); else @@ -376,7 +376,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP); ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP); while (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { struct ast_context *c; struct ast_exten *e; int foundx; @@ -393,7 +393,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive ast_log(LOG_WARNING, "Unable to lock context?\n"); } else { e = find_matching_priority(c, ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)); if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */ ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp)); ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata)); @@ -410,7 +410,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc); res = ast_spawn_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), &foundx, 1); if (res) { /* Something bad happened, or a hangup has been requested. */ @@ -555,7 +555,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive if (sscanf(offsets, "%30d", &offset) == 1) { if (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan) + offset + 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_channel_priority_set(chan, ast_channel_priority(chan) + offset); } } diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 5b3fa25bd..1eb10a593 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1509,8 +1509,8 @@ static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ar if (!concise) { ast_cli(a->fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n", user->user_no, - S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"), - S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"), + S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<no name>"), ast_channel_name(user->chan), ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "(Admin)" : "", ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "(Listen only)" : "", @@ -1520,8 +1520,8 @@ static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ar } else { ast_cli(a->fd, "%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n", user->user_no, - S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, ""), - S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, ""), + S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, ""), + S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, ""), ast_channel_name(user->chan), ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "1" : "", ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "1" : "", @@ -2788,10 +2788,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "ConnectedLineName: %s\r\n", ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no, - S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"), - S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"), - S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"), - S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<unknown>") + S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<unknown>"), + S_COR(ast_channel_connected(user->chan)->id.number.valid, ast_channel_connected(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_connected(user->chan)->id.name.valid, ast_channel_connected(user->chan)->id.name.str, "<unknown>") ); sent_event = 1; } @@ -3862,10 +3862,10 @@ bailoutandtrynormal: "Duration: %ld\r\n", ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no, - S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"), - S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"), - S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"), - S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<unknown>"), + S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<unknown>"), + S_COR(ast_channel_connected(user->chan)->id.number.valid, ast_channel_connected(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_connected(user->chan)->id.name.valid, ast_channel_connected(user->chan)->id.name.str, "<unknown>"), (long)(now.tv_sec - user->jointime)); } @@ -4960,10 +4960,10 @@ static int action_meetmelist(struct mansession *s, const struct message *m) idText, cnf->confno, user->user_no, - S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"), - S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"), - S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"), - S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<no name>"), + S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<no name>"), + S_COR(ast_channel_connected(user->chan)->id.number.valid, ast_channel_connected(user->chan)->id.number.str, "<unknown>"), + S_COR(ast_channel_connected(user->chan)->id.name.valid, ast_channel_connected(user->chan)->id.name.str, "<no name>"), ast_channel_name(user->chan), ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "Yes" : "No", ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "Listen only" : ast_test_flag64(&user->userflags, CONFFLAG_TALKER) ? "Talk only" : "Talk and listen", @@ -5662,16 +5662,16 @@ static int sla_ring_station(struct sla_ringing_trunk *ringing_trunk, struct sla_ caller_is_saved = 0; if (!sla.attempt_callerid) { caller_is_saved = 1; - caller = ringing_trunk->trunk->chan->caller; - ast_party_caller_init(&ringing_trunk->trunk->chan->caller); + caller = *ast_channel_caller(ringing_trunk->trunk->chan); + ast_party_caller_init(ast_channel_caller(ringing_trunk->trunk->chan)); } res = ast_dial_run(dial, ringing_trunk->trunk->chan, 1); /* Restore saved caller ID */ if (caller_is_saved) { - ast_party_caller_free(&ringing_trunk->trunk->chan->caller); - ringing_trunk->trunk->chan->caller = caller; + ast_party_caller_free(ast_channel_caller(ringing_trunk->trunk->chan)); + ast_channel_caller_set(ringing_trunk->trunk->chan, &caller); } if (res != AST_DIAL_RESULT_TRYING) { @@ -6201,16 +6201,16 @@ static void *dial_trunk(void *data) caller_is_saved = 0; if (!sla.attempt_callerid) { caller_is_saved = 1; - caller = trunk_ref->chan->caller; - ast_party_caller_init(&trunk_ref->chan->caller); + caller = *ast_channel_caller(trunk_ref->chan); + ast_party_caller_init(ast_channel_caller(trunk_ref->chan)); } dial_res = ast_dial_run(dial, trunk_ref->chan, 1); /* Restore saved caller ID */ if (caller_is_saved) { - ast_party_caller_free(&trunk_ref->chan->caller); - trunk_ref->chan->caller = caller; + ast_party_caller_free(ast_channel_caller(trunk_ref->chan)); + ast_channel_caller_set(trunk_ref->chan, &caller); } if (dial_res != AST_DIAL_RESULT_TRYING) { diff --git a/apps/app_minivm.c b/apps/app_minivm.c index bf408f81f..cd613b67d 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1746,10 +1746,10 @@ static void run_externnotify(struct ast_channel *chan, struct minivm_account *vm snprintf(arguments, sizeof(arguments), "%s %s@%s %s %s&", ast_strlen_zero(vmu->externnotify) ? global_externnotify : vmu->externnotify, vmu->username, vmu->domain, - (chan->caller.id.name.valid && chan->caller.id.name.str) - ? chan->caller.id.name.str : "", - (chan->caller.id.number.valid && chan->caller.id.number.str) - ? chan->caller.id.number.str : ""); + (ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str) + ? ast_channel_caller(chan)->id.name.str : "", + (ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str) + ? ast_channel_caller(chan)->id.number.str : ""); ast_debug(1, "Executing: %s\n", arguments); ast_safe_system(arguments); @@ -1935,8 +1935,8 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav ast_strftime(timebuf, sizeof(timebuf), "%H:%M:%S", &tm); ast_callerid_merge(callerid, sizeof(callerid), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), "Unknown"); snprintf(logbuf, sizeof(logbuf), /* "Mailbox:domain:macrocontext:exten:priority:callerchan:callerid:origdate:origtime:duration:durationstatus:accountcode" */ @@ -2141,8 +2141,8 @@ static int minivm_notify_exec(struct ast_channel *chan, const char *data) ast_channel_unlock(chan); res = notify_new_message(chan, template, vmu, filename, atoi(duration_string), format, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL)); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL)); } pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", res == 0 ? "SUCCESS" : "FAILED"); @@ -2304,18 +2304,18 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data) if (ast_test_flag(vmu, MVM_OPERATOR)) { if (!ast_strlen_zero(vmu->exit)) { if (ast_exists_extension(chan, vmu->exit, "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ouseexten = 1; } } else if (ast_exists_extension(chan, ast_channel_context(chan), "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ouseexten = 1; } else if (!ast_strlen_zero(ast_channel_macrocontext(chan)) && ast_exists_extension(chan, ast_channel_macrocontext(chan), "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ousemacro = 1; } @@ -2323,15 +2323,15 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data) if (!ast_strlen_zero(vmu->exit)) { if (ast_exists_extension(chan, vmu->exit, "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); } } else if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); } else if (!ast_strlen_zero(ast_channel_macrocontext(chan)) && ast_exists_extension(chan, ast_channel_macrocontext(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); ausemacro = 1; } diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 4515805bc..88c8f88df 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -884,7 +884,7 @@ static char *handle_cli_mixmonitor(struct ast_cli_entry *e, int cmd, struct ast_ } else if (!strcasecmp(a->argv[1], "list")) { ast_cli(a->fd, "MixMonitor ID\tFile\tReceive File\tTransmit File\n"); ast_cli(a->fd, "=========================================================================\n"); - AST_LIST_TRAVERSE(&chan->datastores, datastore, entry) { + AST_LIST_TRAVERSE(ast_channel_datastores(chan), datastore, entry) { if (datastore->info == &mixmonitor_ds_info) { char *filename = ""; char *filename_read = ""; diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 23f8838bc..ba7bb03cb 100644 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -2282,7 +2282,7 @@ static int ospauth_exec( } ast_debug(1, "OSPAuth: provider '%s'\n", provider); - headp = &chan->varshead; + headp = ast_channel_varshead(chan); AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINPEERIP")) { source = ast_var_value(current); @@ -2295,7 +2295,7 @@ static int ospauth_exec( ast_debug(1, "OSPAuth: token size '%zd'\n", strlen(token)); res = osp_auth(provider, &handle, source, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), ast_channel_exten(chan), token, &timelimit); if (res > 0) { status = AST_OSP_SUCCESS; @@ -2409,7 +2409,7 @@ static int osplookup_exec( headers.divhost = ""; headers.pciuser = ""; - headp = &chan->varshead; + headp = ast_channel_varshead(chan); AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINACTUALSRC")) { actualsrc = ast_var_value(current); @@ -2509,7 +2509,7 @@ static int osplookup_exec( } res = osp_lookup(provider, callidtypes, actualsrc, srcdev, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), args.exten, snetid, &np, &headers, cinfo, &results); if (res > 0) { status = AST_OSP_SUCCESS; @@ -2676,7 +2676,7 @@ static int ospnext_exec( results.intimelimit = OSP_DEF_TIMELIMIT; results.numdests = 0; - headp = &chan->varshead; + headp = ast_channel_varshead(chan); AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) { if (sscanf(ast_var_value(current), "%30d", &results.inhandle) != 1) { @@ -2843,7 +2843,7 @@ static int ospfinished_exec( AST_STANDARD_APP_ARGS(args, tmp); - headp = &chan->varshead; + headp = ast_channel_varshead(chan); AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) { if (sscanf(ast_var_value(current), "%30d", &inhandle) != 1) { diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c index 508c31a5b..dce000970 100644 --- a/apps/app_parkandannounce.c +++ b/apps/app_parkandannounce.c @@ -143,16 +143,16 @@ static int parkandannounce_exec(struct ast_channel *chan, const char *data) ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "")); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "")); if (!ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n"); } /* Save the CallerID because the masquerade turns chan into a ZOMBIE. */ ast_party_id_init(&caller_id); ast_channel_lock(chan); - ast_party_id_copy(&caller_id, &chan->caller.id); + ast_party_id_copy(&caller_id, &ast_channel_caller(chan)->id); ast_channel_unlock(chan); /* we are using masq_park here to protect * from touching the channel once we park it. If the channel comes out of timeout diff --git a/apps/app_privacy.c b/apps/app_privacy.c index d287c56fd..0e04df60b 100644 --- a/apps/app_privacy.c +++ b/apps/app_privacy.c @@ -103,8 +103,8 @@ static int privacy_exec(struct ast_channel *chan, const char *data) AST_APP_ARG(checkcontext); ); - if (chan->caller.id.number.valid - && !ast_strlen_zero(chan->caller.id.number.str)) { + if (ast_channel_caller(chan)->id.number.valid + && !ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) { ast_verb(3, "CallerID number present: Skipping\n"); } else { /*Answer the channel if it is not already*/ @@ -195,9 +195,9 @@ static int privacy_exec(struct ast_channel *chan, const char *data) * be passed out to other channels. This is the point of the * privacy application. */ - chan->caller.id.name.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED; - chan->caller.id.number.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED; - chan->caller.id.number.plan = 0;/* Unknown */ + ast_channel_caller(chan)->id.name.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED; + ast_channel_caller(chan)->id.number.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED; + ast_channel_caller(chan)->id.number.plan = 0;/* Unknown */ ast_set_callerid(chan, phone, "Privacy Manager", NULL); diff --git a/apps/app_queue.c b/apps/app_queue.c index f042c06de..ea2dd54e1 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2610,10 +2610,10 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result * "Count: %d\r\n" "Uniqueid: %s\r\n", ast_channel_name(qe->chan), - S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */ - S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"), - S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */ - S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"), + S_COR(ast_channel_caller(qe->chan)->id.number.valid, ast_channel_caller(qe->chan)->id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */ + S_COR(ast_channel_caller(qe->chan)->id.name.valid, ast_channel_caller(qe->chan)->id.name.str, "unknown"), + S_COR(ast_channel_connected(qe->chan)->id.number.valid, ast_channel_connected(qe->chan)->id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */ + S_COR(ast_channel_connected(qe->chan)->id.name.valid, ast_channel_connected(qe->chan)->id.name.str, "unknown"), q->name, qe->pos, q->count, ast_channel_uniqueid(qe->chan)); ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, ast_channel_name(qe->chan), qe->pos ); } @@ -2670,7 +2670,7 @@ static int valid_exit(struct queue_ent *qe, char digit) /* If the extension is bad, then reset the digits to blank */ if (!ast_canmatch_extension(qe->chan, qe->context, qe->digits, 1, - S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(qe->chan)->id.number.valid, ast_channel_caller(qe->chan)->id.number.str, NULL))) { qe->digits[0] = '\0'; return 0; } @@ -3190,30 +3190,30 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies } ast_channel_appl_set(tmp->chan, "AppQueue"); ast_channel_data_set(tmp->chan, "(Outgoing Line)"); - memset(&tmp->chan->whentohangup, 0, sizeof(tmp->chan->whentohangup)); + memset(ast_channel_whentohangup(tmp->chan), 0, sizeof(*ast_channel_whentohangup(tmp->chan))); /* If the new channel has no callerid, try to guess what it should be */ - if (!tmp->chan->caller.id.number.valid) { - if (qe->chan->connected.id.number.valid) { + if (!ast_channel_caller(tmp->chan)->id.number.valid) { + if (ast_channel_connected(qe->chan)->id.number.valid) { struct ast_party_caller caller; - ast_party_caller_set_init(&caller, &tmp->chan->caller); - caller.id = qe->chan->connected.id; - caller.ani = qe->chan->connected.ani; + ast_party_caller_set_init(&caller, ast_channel_caller(tmp->chan)); + caller.id = ast_channel_connected(qe->chan)->id; + caller.ani = ast_channel_connected(qe->chan)->ani; ast_channel_set_caller_event(tmp->chan, &caller, NULL); - } else if (!ast_strlen_zero(qe->chan->dialed.number.str)) { - ast_set_callerid(tmp->chan, qe->chan->dialed.number.str, NULL, NULL); + } else if (!ast_strlen_zero(ast_channel_dialed(qe->chan)->number.str)) { + ast_set_callerid(tmp->chan, ast_channel_dialed(qe->chan)->number.str, NULL, NULL); } else if (!ast_strlen_zero(S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)))) { ast_set_callerid(tmp->chan, S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)), NULL, NULL); } tmp->dial_callerid_absent = 1; } - ast_party_redirecting_copy(&tmp->chan->redirecting, &qe->chan->redirecting); + ast_party_redirecting_copy(ast_channel_redirecting(tmp->chan), ast_channel_redirecting(qe->chan)); - tmp->chan->dialed.transit_network_select = qe->chan->dialed.transit_network_select; + ast_channel_dialed(tmp->chan)->transit_network_select = ast_channel_dialed(qe->chan)->transit_network_select; - ast_connected_line_copy_from_caller(&tmp->chan->connected, &qe->chan->caller); + ast_connected_line_copy_from_caller(ast_channel_connected(tmp->chan), ast_channel_caller(qe->chan)); /* Inherit specially named variables from parent channel */ ast_channel_inherit_variables(qe->chan, tmp->chan); @@ -3279,10 +3279,10 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies "Uniqueid: %s\r\n" "%s", qe->parent->name, tmp->interface, tmp->member->membername, ast_channel_name(qe->chan), ast_channel_name(tmp->chan), - S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"), - S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"), - S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"), - S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"), + S_COR(ast_channel_caller(qe->chan)->id.number.valid, ast_channel_caller(qe->chan)->id.number.str, "unknown"), + S_COR(ast_channel_caller(qe->chan)->id.name.valid, ast_channel_caller(qe->chan)->id.name.str, "unknown"), + S_COR(ast_channel_connected(qe->chan)->id.number.valid, ast_channel_connected(qe->chan)->id.number.str, "unknown"), + S_COR(ast_channel_connected(qe->chan)->id.name.valid, ast_channel_connected(qe->chan)->id.name.str, "unknown"), ast_channel_context(qe->chan), ast_channel_exten(qe->chan), ast_channel_priority(qe->chan), ast_channel_uniqueid(qe->chan), qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : ""); @@ -3666,7 +3666,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte } } else if (!o->dial_callerid_absent) { ast_channel_lock(o->chan); - ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller); + ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(o->chan)); ast_channel_unlock(o->chan); connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; ast_channel_update_connected_line(in, &connected_caller, NULL); @@ -3731,24 +3731,24 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte ast_channel_accountcode_set(o->chan, ast_channel_accountcode(in)); - ast_channel_set_redirecting(o->chan, &original->redirecting, NULL); - if (!o->chan->redirecting.from.number.valid - || ast_strlen_zero(o->chan->redirecting.from.number.str)) { + ast_channel_set_redirecting(o->chan, ast_channel_redirecting(original), NULL); + if (!ast_channel_redirecting(o->chan)->from.number.valid + || ast_strlen_zero(ast_channel_redirecting(o->chan)->from.number.str)) { /* * The call was not previously redirected so it is * now redirected from this number. */ - ast_party_number_free(&o->chan->redirecting.from.number); - ast_party_number_init(&o->chan->redirecting.from.number); - o->chan->redirecting.from.number.valid = 1; - o->chan->redirecting.from.number.str = + ast_party_number_free(&ast_channel_redirecting(o->chan)->from.number); + ast_party_number_init(&ast_channel_redirecting(o->chan)->from.number); + ast_channel_redirecting(o->chan)->from.number.valid = 1; + ast_channel_redirecting(o->chan)->from.number.str = ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in))); } - o->chan->dialed.transit_network_select = in->dialed.transit_network_select; + ast_channel_dialed(o->chan)->transit_network_select = ast_channel_dialed(in)->transit_network_select; - ast_party_caller_copy(&o->chan->caller, &in->caller); - ast_party_connected_line_copy(&o->chan->connected, &original->connected); + ast_party_caller_copy(ast_channel_caller(o->chan), ast_channel_caller(in)); + ast_party_connected_line_copy(ast_channel_connected(o->chan), ast_channel_connected(original)); /* * We must unlock o->chan before calling @@ -3758,7 +3758,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte * seem a bit unusual here. */ ast_party_redirecting_init(&redirecting); - ast_party_redirecting_copy(&redirecting, &o->chan->redirecting); + ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(o->chan)); ast_channel_unlock(o->chan); if ((res = ast_channel_redirecting_sub(o->chan, in, &redirecting, 0)) && (res = ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0))) { @@ -3796,7 +3796,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte } } else if (!o->dial_callerid_absent) { ast_channel_lock(o->chan); - ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller); + ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(o->chan)); ast_channel_unlock(o->chan); connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; ast_channel_update_connected_line(in, &connected_caller, NULL); @@ -4576,7 +4576,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce while ((cur = ao2_iterator_next(&memi))) { struct callattempt *tmp = ast_calloc(1, sizeof(*tmp)); struct ast_dialed_interface *di; - AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces; + AST_LIST_HEAD(,ast_dialed_interface) *dialed_interfaces; if (!tmp) { ao2_ref(cur, -1); ao2_iterator_destroy(&memi); @@ -4650,7 +4650,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce * previously acquired connected line info could have been set * through the CONNECTED_LINE dialplan function. */ - ast_party_connected_line_copy(&tmp->connected, &qe->chan->connected); + ast_party_connected_line_copy(&tmp->connected, ast_channel_connected(qe->chan)); ast_channel_unlock(qe->chan); tmp->stillgoing = -1; @@ -5064,8 +5064,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce if (gosub_argstart) { const char *what_is_s = "s"; *gosub_argstart = 0; - if (!ast_exists_extension(peer, gosubexec, "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) && - ast_exists_extension(peer, gosubexec, "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) { + if (!ast_exists_extension(peer, gosubexec, "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) && + ast_exists_extension(peer, gosubexec, "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) { what_is_s = "~~s~~"; } if (asprintf(&gosub_args, "%s,%s,1(%s)", gosubexec, what_is_s, gosub_argstart + 1) < 0) { @@ -5075,8 +5075,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce *gosub_argstart = ','; } else { const char *what_is_s = "s"; - if (!ast_exists_extension(peer, gosubexec, "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) && - ast_exists_extension(peer, gosubexec, "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) { + if (!ast_exists_extension(peer, gosubexec, "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) && + ast_exists_extension(peer, gosubexec, "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) { what_is_s = "~~s~~"; } if (asprintf(&gosub_args, "%s,%s,1", gosubexec, what_is_s) < 0) { @@ -6135,7 +6135,7 @@ static int queue_exec(struct ast_channel *chan, const char *data) } ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ENTERQUEUE", "%s|%s|%d", S_OR(args.url, ""), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""), qe.opos); copy_rules(&qe, args.rule); qe.pr = AST_LIST_FIRST(&qe.qe_rules); @@ -7615,10 +7615,10 @@ static int manager_queues_status(struct mansession *s, const struct message *m) "%s" "\r\n", q->name, pos++, ast_channel_name(qe->chan), ast_channel_uniqueid(qe->chan), - S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"), - S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"), - S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"), - S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"), + S_COR(ast_channel_caller(qe->chan)->id.number.valid, ast_channel_caller(qe->chan)->id.number.str, "unknown"), + S_COR(ast_channel_caller(qe->chan)->id.name.valid, ast_channel_caller(qe->chan)->id.name.str, "unknown"), + S_COR(ast_channel_connected(qe->chan)->id.number.valid, ast_channel_connected(qe->chan)->id.number.str, "unknown"), + S_COR(ast_channel_connected(qe->chan)->id.name.valid, ast_channel_connected(qe->chan)->id.name.str, "unknown"), (long) (now - qe->start), idText); } } diff --git a/apps/app_readexten.c b/apps/app_readexten.c index a894ba48c..deaf83f53 100644 --- a/apps/app_readexten.c +++ b/apps/app_readexten.c @@ -230,9 +230,9 @@ static int readexten_exec(struct ast_channel *chan, const char *data) exten[x] = res; if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { if (!ast_exists_extension(chan, arglist.context, exten, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)) + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)) && res == '#') { exten[x] = '\0'; } @@ -244,7 +244,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data) break; if (ast_exists_extension(chan, arglist.context, exten, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_debug(3, "User entered valid extension '%s'\n", exten); pbx_builtin_setvar_helper(chan, arglist.variable, exten); status = "OK"; diff --git a/apps/app_rpt.c b/apps/app_rpt.c index 48e398e55..6b01c83e1 100644 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -5465,14 +5465,14 @@ struct ast_format_cap *cap = NULL; if(instr){ ast_callerid_parse(instr, &name, &loc); if(loc){ - mychannel->caller.id.number.valid = 1; - ast_free(mychannel->caller.id.number.str); - mychannel->caller.id.number.str = ast_strdup(loc); + ast_channel_caller(mychannel)->id.number.valid = 1; + ast_free(ast_channel_caller(mychannel)->id.number.str); + ast_channel_caller(mychannel)->id.number.str = ast_strdup(loc); } if(name){ - mychannel->caller.id.name.valid = 1; - ast_free(mychannel->caller.id.name.str); - mychannel->caller.id.name.str = ast_strdup(name); + ast_channel_caller(mychannel)->id.name.valid = 1; + ast_free(ast_channel_caller(mychannel)->id.name.str); + ast_channel_caller(mychannel)->id.name.str = ast_strdup(name); } ast_free(instr); } @@ -5821,9 +5821,9 @@ static int connect_link(struct rpt *myrpt, char* node, int mode, int perma) if (debug > 3) ast_log(LOG_NOTICE, "rpt (remote) initiating call to %s/%s on %s\n", deststr, tele, ast_channel_name(l->chan)); - l->chan->caller.id.number.valid = 1; - ast_free(l->chan->caller.id.number.str); - l->chan->caller.id.number.str = ast_strdup(myrpt->name); + ast_channel_caller(l->chan)->id.number.valid = 1; + ast_free(ast_channel_caller(l->chan)->id.number.str); + ast_channel_caller(l->chan)->id.number.str = ast_strdup(myrpt->name); ast_call(l->chan,tele,999); } else { @@ -10374,9 +10374,9 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l) ast_channel_data_set(l->chan, "(Remote Rx)"); ast_verb(3, "rpt (attempt_reconnect) initiating call to %s/%s on %s\n", deststr, tele, ast_channel_name(l->chan)); - l->chan->caller.id.number.valid = 1; - ast_free(l->chan->caller.id.number.str); - l->chan->caller.id.number.str = ast_strdup(myrpt->name); + ast_channel_caller(l->chan)->id.number.valid = 1; + ast_free(ast_channel_caller(l->chan)->id.number.str); + ast_channel_caller(l->chan)->id.number.str = ast_strdup(myrpt->name); ast_call(l->chan,tele,999); } @@ -13405,9 +13405,9 @@ static int rpt_exec(struct ast_channel *chan, const char *data) ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "")); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "")); if (!ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n"); } @@ -13436,7 +13436,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) char hisip[100],nodeip[100],*val, *s, *s1, *s2, *s3, *b,*b1; /* look at callerid to see what node this comes from */ - b = S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL); + b = S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL); if (!b) /* if doesn't have caller id */ { ast_log(LOG_WARNING, "Does not have callerid on %s\n",tmp); @@ -13558,7 +13558,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) return -1; } /* look at callerid to see what node this comes from */ - b = S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL); + b = S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL); if (!b) /* if doesn't have caller id */ { ast_log(LOG_WARNING, "Doesnt have callerid on %s\n",tmp); @@ -14033,7 +14033,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) ast_cli_command(nullfd,mycmd); } else ast_cli_command(nullfd,mycmd); /* look at callerid to see what node this comes from */ - b = S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL); + b = S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL); if (!b) /* if doesn't have caller id */ { b1 = "0"; @@ -14544,7 +14544,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) char mycmd[100],*b,*b1; /* look at callerid to see what node this comes from */ - b = S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL); + b = S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL); if (!b) /* if doesn't have caller id */ { b1 = "0"; diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c index cfcd2b47d..6fa3170f7 100644 --- a/apps/app_setcallerid.c +++ b/apps/app_setcallerid.c @@ -112,8 +112,8 @@ static int setcallerid_pres_exec(struct ast_channel *chan, const char *data) } /* Set the combined caller id presentation. */ - chan->caller.id.name.presentation = pres; - chan->caller.id.number.presentation = pres; + ast_channel_caller(chan)->id.name.presentation = pres; + ast_channel_caller(chan)->id.number.presentation = pres; return 0; } diff --git a/apps/app_sms.c b/apps/app_sms.c index 946677a61..d5fc353ac 100644 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -1895,7 +1895,7 @@ static int sms_exec(struct ast_channel *chan, const char *data) h.dcs = 0xF1; /* default */ ast_copy_string(h.cli, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""), sizeof(h.cli)); if (ast_strlen_zero(sms_args.queue)) { diff --git a/apps/app_stack.c b/apps/app_stack.c index 0ae2f5a74..827bb508a 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -344,7 +344,7 @@ static int return_exec(struct ast_channel *chan, const char *data) static int gosub_exec(struct ast_channel *chan, const char *data) { struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL); - AST_LIST_HEAD(, gosub_stack_frame) *oldlist; + AST_LIST_HEAD(,gosub_stack_frame) *oldlist; struct gosub_stack_frame *newframe, *lastframe; char argname[15], *tmp = ast_strdupa(data), *label, *endparen; int i, max_argc = 0; @@ -416,7 +416,7 @@ static int gosub_exec(struct ast_channel *chan, const char *data) if (!ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? ast_channel_priority(chan) + 1 : ast_channel_priority(chan), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_log(LOG_ERROR, "Attempt to reach a non-existent destination for gosub: (Context:%s, Extension:%s, Priority:%d)\n", ast_channel_context(chan), ast_channel_exten(chan), ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? ast_channel_priority(chan) + 1 : ast_channel_priority(chan)); ast_channel_context_set(chan, newframe->context); @@ -561,7 +561,7 @@ static int peek_read(struct ast_channel *chan, const char *cmd, char *data, char *buf = '\0'; ast_channel_lock(chan); - AST_LIST_TRAVERSE(&chan->varshead, variables, entries) { + AST_LIST_TRAVERSE(ast_channel_varshead(chan), variables, entries) { if (!strcmp(args.name, ast_var_name(variables)) && ++found > n) { ast_copy_string(buf, ast_var_value(variables), len); break; @@ -592,14 +592,14 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char if (sscanf(argv[3], "%30d", &priority) != 1 || priority < 1) { /* Lookup the priority label */ priority = ast_findlabel_extension(chan, argv[1], argv[2], argv[3], - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)); if (priority < 0) { ast_log(LOG_ERROR, "Priority '%s' not found in '%s@%s'\n", argv[3], argv[2], argv[1]); ast_agi_send(agi->fd, chan, "200 result=-1 Gosub label not found\n"); return RESULT_FAILURE; } } else if (!ast_exists_extension(chan, argv[1], argv[2], priority, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { ast_agi_send(agi->fd, chan, "200 result=-1 Gosub label not found\n"); return RESULT_FAILURE; } @@ -642,7 +642,7 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char struct ast_pbx *pbx = ast_channel_pbx(chan); struct ast_pbx_args args; struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL); - AST_LIST_HEAD(, gosub_stack_frame) *oldlist = stack_store->data; + AST_LIST_HEAD(,gosub_stack_frame) *oldlist = stack_store->data; struct gosub_stack_frame *cur = AST_LIST_FIRST(oldlist); cur->is_agi = 1; diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 55904d6d2..791081db5 100644 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -181,7 +181,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) t[0] = fr->subclass.integer; t[1] = '\0'; if (ast_canmatch_extension(chan, ast_channel_context(chan), t, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { /* They entered a valid extension, or might be anyhow */ res = fr->subclass.integer; ast_frfree(fr); diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index fc7417bda..8aa8bfde2 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2387,8 +2387,8 @@ static int imap_store_file(const char *dir, const char *mailboxuser, const char } make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, "INBOX", - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), fn, introfn, fmt, duration, 1, chan, NULL, 1, flag); /* read mail file to memory */ len = ftell(p); @@ -5457,8 +5457,8 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i } ast_unlock_path(todir); notify_new_message(chan, recip, NULL, recipmsgnum, duration, fmt, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), flag); return res; @@ -5796,17 +5796,17 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (ast_test_flag(vmu, VM_OPERATOR)) { if (!ast_strlen_zero(vmu->exit)) { if (ast_exists_extension(chan, vmu->exit, "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ouseexten = 1; } } else if (ast_exists_extension(chan, ast_channel_context(chan), "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ouseexten = 1; } else if (!ast_strlen_zero(ast_channel_macrocontext(chan)) && ast_exists_extension(chan, ast_channel_macrocontext(chan), "o", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1); ousemacro = 1; } @@ -5814,15 +5814,15 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (!ast_strlen_zero(vmu->exit)) { if (ast_exists_extension(chan, vmu->exit, "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); } } else if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); } else if (!ast_strlen_zero(ast_channel_macrocontext(chan)) && ast_exists_extension(chan, ast_channel_macrocontext(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1); ausemacro = 1; } @@ -5833,7 +5833,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ e[0] = *code; if (strchr(ecodes, e[0]) == NULL && ast_canmatch_extension(chan, ast_channel_context(chan), e, 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { strncat(ecodes, e, sizeof(ecodes) - strlen(ecodes) - 1); } } @@ -6013,8 +6013,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ snprintf(origtime, sizeof(origtime), "%ld", (long) time(NULL)); get_date(date, sizeof(date)); ast_callerid_merge(callerid, sizeof(callerid), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), "Unknown"); ast_store_realtime("voicemail_data", "origmailbox", ext, @@ -6036,8 +6036,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (txt) { get_date(date, sizeof(date)); ast_callerid_merge(callerid, sizeof(callerid), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), "Unknown"); fprintf(txt, ";\n" @@ -6059,8 +6059,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_channel_context(chan), ast_channel_macrocontext(chan), ast_channel_exten(chan), - S_COR(chan->redirecting.from.number.valid, - chan->redirecting.from.number.str, "unknown"), + S_COR(ast_channel_redirecting(chan)->from.number.valid, + ast_channel_redirecting(chan)->from.number.str, "unknown"), ast_channel_priority(chan), ast_channel_name(chan), callerid, @@ -6178,13 +6178,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (ast_fileexists(fn, NULL, NULL)) { #ifdef IMAP_STORAGE notify_new_message(chan, vmu, vms, msgnum, duration, fmt, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), flag); #else notify_new_message(chan, vmu, NULL, msgnum, duration, fmt, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL), - S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL), + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL), + S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL), flag); #endif } @@ -9864,8 +9864,8 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ return -1; } if (ast_strlen_zero(mailbox)) { - if (chan->caller.id.number.valid && chan->caller.id.number.str) { - ast_copy_string(mailbox, chan->caller.id.number.str, mailbox_size); + if (ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str) { + ast_copy_string(mailbox, ast_channel_caller(chan)->id.number.str, mailbox_size); } else { ast_verb(3, "Username not entered\n"); return -1; @@ -9874,7 +9874,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ /* user entered '*' */ ast_verb(4, "Mailbox begins with '*', attempting jump to extension 'a'\n"); if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { return -1; } ast_verb(4, "Jump to extension 'a' failed; setting mailbox to NULL\n"); @@ -9909,7 +9909,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ /* user entered '*' */ ast_verb(4, "Password begins with '*', attempting jump to extension 'a'\n"); if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { mailbox[0] = '*'; return -1; } diff --git a/apps/app_while.c b/apps/app_while.c index 5e8fb9bb4..d1e03f600 100644 --- a/apps/app_while.c +++ b/apps/app_while.c @@ -168,10 +168,10 @@ static int find_matching_endwhile(struct ast_channel *chan) int cur_priority = ast_channel_priority(chan) + 1, level=1; for (e = find_matching_priority(c, ast_channel_exten(chan), cur_priority, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)); + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)); e; e = find_matching_priority(c, ast_channel_exten(chan), ++cur_priority, - S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) { if (!strcasecmp(ast_get_extension_app(e), "WHILE")) { level++; } else if (!strcasecmp(ast_get_extension_app(e), "ENDWHILE")) { diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c index 775fd55a3..00166978f 100644 --- a/apps/app_zapateller.c +++ b/apps/app_zapateller.c @@ -108,8 +108,8 @@ static int zapateller_exec(struct ast_channel *chan, const char *data) } if (nocallerid /* Zap caller if no caller id. */ - && chan->caller.id.number.valid - && !ast_strlen_zero(chan->caller.id.number.str)) { + && ast_channel_caller(chan)->id.number.valid + && !ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) { /* We have caller id. */ return res; } |