}
ast_mutex_lock(&p->lock);
ast_set_flag(p, H323_OUTGOING);
- if (ast->connected.id.number.valid && ast->connected.id.number.str) {
+ if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
free(p->callerid_num);
- p->callerid_num = strdup(ast->connected.id.number.str);
+ p->callerid_num = strdup(ast_channel_connected(ast)->id.number.str);
}
- if (ast->connected.id.name.valid && ast->connected.id.name.str) {
+ if (ast_channel_connected(ast)->id.name.valid && ast_channel_connected(ast)->id.name.str) {
free(p->callerid_name);
- p->callerid_name = strdup(ast->connected.id.name.str);
- } else if (ast->connected.id.number.valid && ast->connected.id.number.str) {
+ p->callerid_name = strdup(ast_channel_connected(ast)->id.name.str);
+ } else if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
free(p->callerid_name);
- p->callerid_name = strdup(ast->connected.id.number.str);
+ p->callerid_name = strdup(ast_channel_connected(ast)->id.number.str);
} else {
- ast->connected.id.name.valid = 1;
- free(ast->connected.id.name.str);
- ast->connected.id.name.str = strdup(gCallerID);
+ ast_channel_connected(ast)->id.name.valid = 1;
+ free(ast_channel_connected(ast)->id.name.str);
+ ast_channel_connected(ast)->id.name.str = strdup(gCallerID);
free(p->callerid_name);
- p->callerid_name = strdup(ast->connected.id.name.str);
+ p->callerid_name = strdup(ast_channel_connected(ast)->id.name.str);
}
/* Retrieve vars */
}
break;
case AST_CONTROL_CONNECTED_LINE:
- if (!ast->connected.id.name.valid
- || ast_strlen_zero(ast->connected.id.name.str)) {
+ if (!ast_channel_connected(ast)->id.name.valid
+ || ast_strlen_zero(ast_channel_connected(ast)->id.name.str)) {
break;
}
if (gH323Debug) {
ast_debug(1, "Sending connected line info for %s (%s)\n",
- callToken, ast->connected.id.name.str);
+ callToken, ast_channel_connected(ast)->id.name.str);
}
- ooSetANI(callToken, ast->connected.id.name.str);
+ ooSetANI(callToken, ast_channel_connected(ast)->id.name.str);
break;
case AST_CONTROL_T38_PARAMETERS:
const char *target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));
if ((strcmp(ast_channel_exten(p->owner), "fax")) &&
(ast_exists_extension(p->owner, target_context, "fax", 1,
- S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
+ S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL)))) {
ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));
if ((strcmp(ast_channel_exten(p->owner), "fax")) &&
(ast_exists_extension(p->owner, target_context, "fax", 1,
- S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
+ S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL)))) {
ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
/* 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)) {
} 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();
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. */
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>")
);
}
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>")
);
}
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);
"\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");
"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 : "");
}
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.
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));
* 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)) {
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);
}
} 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);
}
} 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);
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);
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 {
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");
* 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)
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);
}
}
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));
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) {
*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) {
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);
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;
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);
}
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;
}
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;
/* 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;
}
}
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';
}
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)) {
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)),
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,
"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,
}
/* 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;
}
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));
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);
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
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;
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));
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. */
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);
}
}
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)" : "",
} 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" : "",
"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;
}
"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));
}
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",
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) {
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) {
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);
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" */
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");
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;
}
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;
}
} 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 = "";
}
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);
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;
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);
}
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;
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) {
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) {
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
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*/
* 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);
"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 );
}
/* 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;
}
}
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);
"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)) : "");
}
} 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);
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
* 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))) {
}
} 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);
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);
* 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;
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) {
*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) {
}
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);
"%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);
}
}
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';
}
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";
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);
}
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 {
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);
}
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");
}
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);
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);
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";
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";
}
/* 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;
}
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)) {
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;
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);
*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;
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;
}
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;
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);
}
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);
}
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;
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;
}
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;
}
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);
}
}
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,
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"
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,
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
}
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;
/* 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");
/* 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;
}
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")) {
}
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;
}
/* Before we actually dial out let's inherit appropriate information. */
ast_channel_lock_both(caller, chan);
- ast_connected_line_copy_from_caller(&chan->connected, &caller->caller);
+ ast_connected_line_copy_from_caller(ast_channel_connected(chan), ast_channel_caller(caller));
ast_channel_inherit_variables(caller, chan);
ast_channel_datastore_inherit(caller, chan);
ast_channel_unlock(chan);
if (p->chan) {
loginChan = ast_strdupa(ast_channel_name(p->chan));
if (owner && owner->_bridge) {
- talkingto = S_COR(p->chan->caller.id.number.valid,
- p->chan->caller.id.number.str, "n/a");
+ talkingto = S_COR(ast_channel_caller(p->chan)->id.number.valid,
+ ast_channel_caller(p->chan)->id.number.str, "n/a");
if ((bridge = ast_bridged_channel(owner))) {
talkingtoChan = ast_strdupa(ast_channel_name(bridge));
} else {
if (strchr(data, 'c'))
changeoutgoing = 1;
}
- 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)) {
const char *tmp;
char agentvar[AST_MAX_BUF];
snprintf(agentvar, sizeof(agentvar), "%s_%s", GETAGENTBYCALLERID,
- chan->caller.id.number.str);
+ ast_channel_caller(chan)->id.number.str);
if ((tmp = pbx_builtin_getvar_helper(NULL, agentvar))) {
struct agent_pvt *p;
ast_copy_string(agent, tmp, sizeof(agent));
ast_verb(1, V_BEGIN "Call to device '%s' on console from '%s' <%s>" V_END,
dest,
- S_COR(c->caller.id.name.valid, c->caller.id.name.str, ""),
- S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""));
+ S_COR(ast_channel_caller(c)->id.name.valid, ast_channel_caller(c)->id.name.str, ""),
+ S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, ""));
console_pvt_lock(pvt);
ast_mutex_unlock(&p->lock);
ast_channel_unlock(ast);
if (ast_exists_extension(ast, target_context, "fax", 1,
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, NULL))) {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(ast));
c = args.ext;
if (!p->hidecallerid) {
- l = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL;
+ l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
} else {
l = NULL;
}
ast_mutex_unlock(&p->lock);
ast_channel_unlock(ast);
if (ast_exists_extension(ast, target_context, "fax", 1,
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, NULL))) {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(ast));
cid_num[0] = 0;
cid_name[0] = 0;
if (p->dahditrcallerid && p->owner) {
- if (p->owner->caller.id.number.valid
- && p->owner->caller.id.number.str) {
- ast_copy_string(cid_num, p->owner->caller.id.number.str,
+ if (ast_channel_caller(p->owner)->id.number.valid
+ && ast_channel_caller(p->owner)->id.number.str) {
+ ast_copy_string(cid_num, ast_channel_caller(p->owner)->id.number.str,
sizeof(cid_num));
}
- if (p->owner->caller.id.name.valid
- && p->owner->caller.id.name.str) {
- ast_copy_string(cid_name, p->owner->caller.id.name.str,
+ if (ast_channel_caller(p->owner)->id.name.valid
+ && ast_channel_caller(p->owner)->id.name.str) {
+ ast_copy_string(cid_name, ast_channel_caller(p->owner)->id.name.str,
sizeof(cid_name));
}
}
case SIG_FEATDMF_TA:
switch (p->whichwink) {
case 0:
- ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->caller.ani2,
- S_COR(p->owner->caller.ani.number.valid,
- p->owner->caller.ani.number.str, ""));
+ ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", ast_channel_caller(p->owner)->ani2,
+ S_COR(ast_channel_caller(p->owner)->ani.number.valid,
+ ast_channel_caller(p->owner)->ani.number.str, ""));
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#",
- p->owner->caller.ani2,
- S_COR(p->owner->caller.ani.number.valid,
- p->owner->caller.ani.number.str, ""));
+ ast_channel_caller(p->owner)->ani2,
+ S_COR(ast_channel_caller(p->owner)->ani.number.valid,
+ ast_channel_caller(p->owner)->ani.number.str, ""));
break;
case 1:
ast_copy_string(p->dop.dialstr, p->finaldial, sizeof(p->dop.dialstr));
if (!ast_strlen_zero(i->exten))
ast_channel_exten_set(tmp, i->exten);
if (!ast_strlen_zero(i->rdnis)) {
- tmp->redirecting.from.number.valid = 1;
- tmp->redirecting.from.number.str = ast_strdup(i->rdnis);
+ ast_channel_redirecting(tmp)->from.number.valid = 1;
+ ast_channel_redirecting(tmp)->from.number.str = ast_strdup(i->rdnis);
}
if (!ast_strlen_zero(i->dnid)) {
- tmp->dialed.number.str = ast_strdup(i->dnid);
+ ast_channel_dialed(tmp)->number.str = ast_strdup(i->dnid);
}
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
#if defined(HAVE_PRI) || defined(HAVE_SS7)
if (!ast_strlen_zero(i->cid_ani)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_ani);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_ani);
} else if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
#else
if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
- tmp->caller.id.name.presentation = i->callingpres;
- tmp->caller.id.number.presentation = i->callingpres;
- tmp->caller.id.number.plan = i->cid_ton;
- tmp->caller.ani2 = i->cid_ani2;
- tmp->caller.id.tag = ast_strdup(i->cid_tag);
+ ast_channel_caller(tmp)->id.name.presentation = i->callingpres;
+ ast_channel_caller(tmp)->id.number.presentation = i->callingpres;
+ ast_channel_caller(tmp)->id.number.plan = i->cid_ton;
+ ast_channel_caller(tmp)->ani2 = i->cid_ani2;
+ ast_channel_caller(tmp)->id.tag = ast_strdup(i->cid_tag);
/* clear the fake event in case we posted one before we had ast_channel */
i->fake_event = 0;
/* Assure there is no confmute on this channel */
}
if (ast_exists_extension(chan, ast_channel_context(chan), 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_channel_exten_set(chan, exten);
if (p->dsp) ast_dsp_digitreset(p->dsp);
res = ast_pbx_run(chan);
ast_verb(3, "Disabling Caller*ID on %s\n", ast_channel_name(chan));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
- ast_party_number_free(&chan->caller.id.number);
- ast_party_number_init(&chan->caller.id.number);
- ast_party_name_free(&chan->caller.id.name);
- ast_party_name_init(&chan->caller.id.name);
+ ast_party_number_free(&ast_channel_caller(chan)->id.number);
+ ast_party_number_init(&ast_channel_caller(chan)->id.number);
+ ast_party_name_free(&ast_channel_caller(chan)->id.name);
+ ast_party_name_init(&ast_channel_caller(chan)->id.name);
res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
goto quit;
}
} else if (!ast_canmatch_extension(chan, ast_channel_context(chan), 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))
&& !canmatch_featurecode(exten)) {
ast_debug(1, "Can't match %s from '%s' in context %s\n", exten,
- S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<Unknown Caller>"),
+ S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<Unknown Caller>"),
ast_channel_context(chan));
break;
}
tmp->callgroup = client->callgroup;
tmp->pickupgroup = client->pickupgroup;
- tmp->caller.id.name.presentation = client->callingpres;
- tmp->caller.id.number.presentation = client->callingpres;
+ ast_channel_caller(tmp)->id.name.presentation = client->callingpres;
+ ast_channel_caller(tmp)->id.number.presentation = client->callingpres;
if (!ast_strlen_zero(client->accountcode))
ast_channel_accountcode_set(tmp, client->accountcode);
if (client->amaflags)
ast_channel_exten_set(tmp, i->exten);
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
- tmp->dialed.number.str = ast_strdup(i->exten);
+ ast_channel_dialed(tmp)->number.str = ast_strdup(i->exten);
}
ast_channel_priority_set(tmp, 1);
if (i->rtp)
/* make sure null terminated */
called_addr[sizeof(called_addr) - 1] = '\0';
- if (c->connected.id.number.valid && c->connected.id.number.str) {
- ast_copy_string(pvt->options.cid_num, c->connected.id.number.str, sizeof(pvt->options.cid_num));
+ if (ast_channel_connected(c)->id.number.valid && ast_channel_connected(c)->id.number.str) {
+ ast_copy_string(pvt->options.cid_num, ast_channel_connected(c)->id.number.str, sizeof(pvt->options.cid_num));
}
- if (c->connected.id.name.valid && c->connected.id.name.str) {
- ast_copy_string(pvt->options.cid_name, c->connected.id.name.str, sizeof(pvt->options.cid_name));
+ if (ast_channel_connected(c)->id.name.valid && ast_channel_connected(c)->id.name.str) {
+ ast_copy_string(pvt->options.cid_name, ast_channel_connected(c)->id.name.str, sizeof(pvt->options.cid_name));
}
- if (c->redirecting.from.number.valid && c->redirecting.from.number.str) {
- ast_copy_string(pvt->options.cid_rdnis, c->redirecting.from.number.str, sizeof(pvt->options.cid_rdnis));
+ if (ast_channel_redirecting(c)->from.number.valid && ast_channel_redirecting(c)->from.number.str) {
+ ast_copy_string(pvt->options.cid_rdnis, ast_channel_redirecting(c)->from.number.str, sizeof(pvt->options.cid_rdnis));
}
- pvt->options.presentation = ast_party_id_presentation(&c->connected.id);
- pvt->options.type_of_number = c->connected.id.number.plan;
+ pvt->options.presentation = ast_party_id_presentation(&ast_channel_connected(c)->id);
+ pvt->options.type_of_number = ast_channel_connected(c)->id.number.plan;
if ((addr = pbx_builtin_getvar_helper(c, "PRIREDIRECTREASON"))) {
if (!strcasecmp(addr, "UNKNOWN"))
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!ast_strlen_zero(cid_num)) {
- ch->caller.ani.number.valid = 1;
- ch->caller.ani.number.str = ast_strdup(cid_num);
+ ast_channel_caller(ch)->ani.number.valid = 1;
+ ast_channel_caller(ch)->ani.number.str = ast_strdup(cid_num);
}
if (pvt->cd.redirect_reason >= 0) {
- ch->redirecting.from.number.valid = 1;
- ch->redirecting.from.number.str = ast_strdup(pvt->cd.redirect_number);
+ ast_channel_redirecting(ch)->from.number.valid = 1;
+ ast_channel_redirecting(ch)->from.number.str = ast_strdup(pvt->cd.redirect_number);
pbx_builtin_setvar_helper(ch, "PRIREDIRECTREASON", redirectingreason2str(pvt->cd.redirect_reason));
}
- ch->caller.id.name.presentation = pvt->cd.presentation;
- ch->caller.id.number.presentation = pvt->cd.presentation;
- ch->caller.id.number.plan = pvt->cd.type_of_number;
+ ast_channel_caller(ch)->id.name.presentation = pvt->cd.presentation;
+ ast_channel_caller(ch)->id.number.presentation = pvt->cd.presentation;
+ ast_channel_caller(ch)->id.number.plan = pvt->cd.type_of_number;
if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
- ch->dialed.number.str = ast_strdup(pvt->exten);
+ ast_channel_dialed(ch)->number.str = ast_strdup(pvt->exten);
}
if (pvt->cd.transfer_capability >= 0)
ast_channel_transfercapability_set(ch, pvt->cd.transfer_capability);
if (pds.port)
sin.sin_port = htons(atoi(pds.port));
- l = c->connected.id.number.valid ? c->connected.id.number.str : NULL;
- n = c->connected.id.name.valid ? c->connected.id.name.str : NULL;
+ l = ast_channel_connected(c)->id.number.valid ? ast_channel_connected(c)->id.number.str : NULL;
+ n = ast_channel_connected(c)->id.name.valid ? ast_channel_connected(c)->id.name.str : NULL;
/* Now build request */
memset(&ied, 0, sizeof(ied));
if (l) {
iax_ie_append_str(&ied, IAX_IE_CALLING_NUMBER, l);
iax_ie_append_byte(&ied, IAX_IE_CALLINGPRES,
- ast_party_id_presentation(&c->connected.id));
+ ast_party_id_presentation(&ast_channel_connected(c)->id));
} else if (n) {
iax_ie_append_byte(&ied, IAX_IE_CALLINGPRES,
- ast_party_id_presentation(&c->connected.id));
+ ast_party_id_presentation(&ast_channel_connected(c)->id));
} else {
iax_ie_append_byte(&ied, IAX_IE_CALLINGPRES, AST_PRES_NUMBER_NOT_AVAILABLE);
}
- iax_ie_append_byte(&ied, IAX_IE_CALLINGTON, c->connected.id.number.plan);
- iax_ie_append_short(&ied, IAX_IE_CALLINGTNS, c->dialed.transit_network_select);
+ iax_ie_append_byte(&ied, IAX_IE_CALLINGTON, ast_channel_connected(c)->id.number.plan);
+ iax_ie_append_short(&ied, IAX_IE_CALLINGTNS, ast_channel_dialed(c)->transit_network_select);
if (n)
iax_ie_append_str(&ied, IAX_IE_CALLING_NAME, n);
if (ast_test_flag64(iaxs[callno], IAX_SENDANI)
- && c->connected.ani.number.valid
- && c->connected.ani.number.str) {
- iax_ie_append_str(&ied, IAX_IE_CALLING_ANI, c->connected.ani.number.str);
+ && ast_channel_connected(c)->ani.number.valid
+ && ast_channel_connected(c)->ani.number.str) {
+ iax_ie_append_str(&ied, IAX_IE_CALLING_ANI, ast_channel_connected(c)->ani.number.str);
}
if (!ast_strlen_zero(ast_channel_language(c)))
iax_ie_append_str(&ied, IAX_IE_LANGUAGE, ast_channel_language(c));
- if (!ast_strlen_zero(c->dialed.number.str)) {
- iax_ie_append_str(&ied, IAX_IE_DNID, c->dialed.number.str);
+ if (!ast_strlen_zero(ast_channel_dialed(c)->number.str)) {
+ iax_ie_append_str(&ied, IAX_IE_DNID, ast_channel_dialed(c)->number.str);
}
- if (c->redirecting.from.number.valid
- && !ast_strlen_zero(c->redirecting.from.number.str)) {
- iax_ie_append_str(&ied, IAX_IE_RDNIS, c->redirecting.from.number.str);
+ if (ast_channel_redirecting(c)->from.number.valid
+ && !ast_strlen_zero(ast_channel_redirecting(c)->from.number.str)) {
+ iax_ie_append_str(&ied, IAX_IE_RDNIS, ast_channel_redirecting(c)->from.number.str);
}
if (pds.context)
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
if (!ast_strlen_zero(i->ani)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->ani);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->ani);
} else if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
- tmp->dialed.number.str = ast_strdup(i->dnid);
+ ast_channel_dialed(tmp)->number.str = ast_strdup(i->dnid);
if (!ast_strlen_zero(i->rdnis)) {
- tmp->redirecting.from.number.valid = 1;
- tmp->redirecting.from.number.str = ast_strdup(i->rdnis);
+ ast_channel_redirecting(tmp)->from.number.valid = 1;
+ ast_channel_redirecting(tmp)->from.number.str = ast_strdup(i->rdnis);
}
- tmp->caller.id.name.presentation = i->calling_pres;
- tmp->caller.id.number.presentation = i->calling_pres;
- tmp->caller.id.number.plan = i->calling_ton;
- tmp->dialed.transit_network_select = i->calling_tns;
+ ast_channel_caller(tmp)->id.name.presentation = i->calling_pres;
+ ast_channel_caller(tmp)->id.number.presentation = i->calling_pres;
+ ast_channel_caller(tmp)->id.number.plan = i->calling_ton;
+ ast_channel_dialed(tmp)->transit_network_select = i->calling_tns;
if (!ast_strlen_zero(i->language))
ast_channel_language_set(tmp, i->language);
if (!ast_strlen_zero(i->accountcode))
S_COR(connected.id.number.valid, connected.id.number.str, ""),
S_COR(connected.id.name.valid, connected.id.name.str, ""),
NULL);
- iaxs[fr->callno]->owner->caller.id.number.presentation = connected.id.number.presentation;
- iaxs[fr->callno]->owner->caller.id.name.presentation = connected.id.name.presentation;
+ ast_channel_caller(iaxs[fr->callno]->owner)->id.number.presentation = connected.id.number.presentation;
+ ast_channel_caller(iaxs[fr->callno]->owner)->id.name.presentation = connected.id.name.presentation;
}
}
ast_party_connected_line_free(&connected);
tmp->callgroup = client->callgroup;
tmp->pickupgroup = client->pickupgroup;
- tmp->caller.id.name.presentation = client->callingpres;
- tmp->caller.id.number.presentation = client->callingpres;
+ ast_channel_caller(tmp)->id.name.presentation = client->callingpres;
+ ast_channel_caller(tmp)->id.number.presentation = client->callingpres;
if (!ast_strlen_zero(client->accountcode))
ast_channel_accountcode_set(tmp, client->accountcode);
if (client->amaflags)
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID event */
if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
- tmp->dialed.number.str = ast_strdup(i->exten);
+ ast_channel_dialed(tmp)->number.str = ast_strdup(i->exten);
}
ast_channel_priority_set(tmp, 1);
if (i->rtp)
iks_insert_node(jingle, dtmf);
ast_mutex_lock(&p->lock);
- if (ast->dtmff.frametype == AST_FRAME_DTMF_BEGIN || duration == 0) {
+ if (ast_channel_dtmff(ast)->frametype == AST_FRAME_DTMF_BEGIN || duration == 0) {
iks_insert_attrib(dtmf, "action", "button-down");
- } else if (ast->dtmff.frametype == AST_FRAME_DTMF_END || duration != 0) {
+ } else if (ast_channel_dtmff(ast)->frametype == AST_FRAME_DTMF_END || duration != 0) {
iks_insert_attrib(dtmf, "action", "button-up");
}
ast_aji_send(client->connection, iq);
frames on the owner channel (because they would be transferred to the
outbound channel during the masquerade)
*/
- if (p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && AST_LIST_EMPTY(&p->owner->readq)) {
+ if (p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && AST_LIST_EMPTY(ast_channel_readq(p->owner))) {
/* Masquerade bridged channel into owner */
/* Lock everything we need, one by one, and give up if
we can't get everything. Remember, we'll get another
* thread (which is the to be masqueraded away local channel) before both local
* channels are optimized away.
*/
- if (p->owner->caller.id.name.valid || p->owner->caller.id.number.valid
- || p->owner->caller.id.subaddress.valid || p->owner->caller.ani.name.valid
- || p->owner->caller.ani.number.valid || p->owner->caller.ani.subaddress.valid) {
- struct ast_party_caller tmp;
- tmp = p->owner->caller;
- p->owner->caller = p->chan->_bridge->caller;
- p->chan->_bridge->caller = tmp;
+ if (ast_channel_caller(p->owner)->id.name.valid || ast_channel_caller(p->owner)->id.number.valid
+ || ast_channel_caller(p->owner)->id.subaddress.valid || ast_channel_caller(p->owner)->ani.name.valid
+ || ast_channel_caller(p->owner)->ani.number.valid || ast_channel_caller(p->owner)->ani.subaddress.valid) {
+ SWAP(*ast_channel_caller(p->owner), *ast_channel_caller(p->chan->_bridge));
}
- if (p->owner->redirecting.from.name.valid || p->owner->redirecting.from.number.valid
- || p->owner->redirecting.from.subaddress.valid || p->owner->redirecting.to.name.valid
- || p->owner->redirecting.to.number.valid || p->owner->redirecting.to.subaddress.valid) {
- struct ast_party_redirecting tmp;
- tmp = p->owner->redirecting;
- p->owner->redirecting = p->chan->_bridge->redirecting;
- p->chan->_bridge->redirecting = tmp;
+ if (ast_channel_redirecting(p->owner)->from.name.valid || ast_channel_redirecting(p->owner)->from.number.valid
+ || ast_channel_redirecting(p->owner)->from.subaddress.valid || ast_channel_redirecting(p->owner)->to.name.valid
+ || ast_channel_redirecting(p->owner)->to.number.valid || ast_channel_redirecting(p->owner)->to.subaddress.valid) {
+ SWAP(*ast_channel_redirecting(p->owner), *ast_channel_redirecting(p->chan->_bridge));
}
- if (p->owner->dialed.number.str || p->owner->dialed.subaddress.valid) {
- struct ast_party_dialed tmp;
- tmp = p->owner->dialed;
- p->owner->dialed = p->chan->_bridge->dialed;
- p->chan->_bridge->dialed = tmp;
+ if (ast_channel_dialed(p->owner)->number.str || ast_channel_dialed(p->owner)->subaddress.valid) {
+ SWAP(*ast_channel_dialed(p->owner), *ast_channel_dialed(p->chan->_bridge));
}
unsigned char frame_data[1024];
if (condition == AST_CONTROL_CONNECTED_LINE) {
if (isoutbound) {
- ast_connected_line_copy_to_caller(&the_other_channel->caller, &this_channel->connected);
+ ast_connected_line_copy_to_caller(ast_channel_caller(the_other_channel), ast_channel_connected(this_channel));
}
- f.datalen = ast_connected_line_build_data(frame_data, sizeof(frame_data), &this_channel->connected, NULL);
+ f.datalen = ast_connected_line_build_data(frame_data, sizeof(frame_data), ast_channel_connected(this_channel), NULL);
} else {
- f.datalen = ast_redirecting_build_data(frame_data, sizeof(frame_data), &this_channel->redirecting, NULL);
+ f.datalen = ast_redirecting_build_data(frame_data, sizeof(frame_data), ast_channel_redirecting(this_channel), NULL);
}
f.subclass.integer = condition;
f.data.ptr = frame_data;
* All these failure points just return -1. The individual strings will
* be cleared when we destroy the channel.
*/
- ast_party_redirecting_copy(&chan->redirecting, &owner->redirecting);
+ ast_party_redirecting_copy(ast_channel_redirecting(chan), ast_channel_redirecting(owner));
- ast_party_dialed_copy(&chan->dialed, &owner->dialed);
+ ast_party_dialed_copy(ast_channel_dialed(chan), ast_channel_dialed(owner));
- ast_connected_line_copy_to_caller(&chan->caller, &owner->connected);
- ast_connected_line_copy_from_caller(&chan->connected, &owner->caller);
+ ast_connected_line_copy_to_caller(ast_channel_caller(chan), ast_channel_connected(owner));
+ ast_connected_line_copy_from_caller(ast_channel_connected(chan), ast_channel_caller(owner));
ast_channel_language_set(chan, ast_channel_language(owner));
ast_channel_accountcode_set(chan, ast_channel_accountcode(owner));
/* copy the channel variables from the incoming channel to the outgoing channel */
/* Note that due to certain assumptions, they MUST be in the same order */
- AST_LIST_TRAVERSE(&owner->varshead, varptr, entries) {
+ AST_LIST_TRAVERSE(ast_channel_varshead(owner), varptr, entries) {
namelen = strlen(varptr->name);
len = sizeof(struct ast_var_t) + namelen + strlen(varptr->value) + 2;
if ((new = ast_calloc(1, len))) {
memcpy(new, varptr, len);
new->value = &(new->name[0]) + namelen + 1;
- AST_LIST_INSERT_TAIL(&chan->varshead, new, entries);
+ AST_LIST_INSERT_TAIL(ast_channel_varshead(chan), new, entries);
}
}
ast_channel_datastore_inherit(owner, chan);
ast_channel_unlock(chan);
if (!ast_exists_extension(chan, context, exten, 1,
- S_COR(owner->caller.id.number.valid, owner->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(owner)->id.number.valid, ast_channel_caller(owner)->id.number.str, NULL))) {
ast_log(LOG_NOTICE, "No such extension/context %s@%s while calling Local channel\n", exten, context);
res = -1;
chan = ast_channel_unref(chan); /* we already unlocked it, so clear it hear so the cleanup label won't touch it. */
ast_debug(3, "MGCP mgcp_call(%s)\n", ast_channel_name(ast));
sub = ast_channel_tech_pvt(ast);
p = sub->parent;
- headp = &ast->varshead;
+ headp = ast_channel_varshead(ast);
AST_LIST_TRAVERSE(headp,current,entries) {
/* Check whether there is an ALERT_INFO variable */
if (strcasecmp(ast_var_name(current),"ALERT_INFO") == 0) {
}
transmit_notify_request_with_callerid(sub, tone,
- S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, ""),
- S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""));
+ S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, ""),
+ S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, ""));
ast_setstate(ast, AST_STATE_RINGING);
if (sub->next->owner && !ast_strlen_zero(sub->next->cxident) && !ast_strlen_zero(sub->next->callid)) {
/* ncs fix! */
bridged = ast_bridged_channel(sub->next->owner);
transmit_notify_request_with_callerid(p->sub, (p->ncs ? "L/wt1" : "L/wt"),
- S_COR(bridged->caller.id.number.valid, bridged->caller.id.number.str, ""),
- S_COR(bridged->caller.id.name.valid, bridged->caller.id.name.str, ""));
+ S_COR(ast_channel_caller(bridged)->id.number.valid, ast_channel_caller(bridged)->id.number.str, ""),
+ S_COR(ast_channel_caller(bridged)->id.name.valid, ast_channel_caller(bridged)->id.name.str, ""));
}
} else {
/* set our other connection as the primary and swith over to it */
if (sub->next->owner && ast_bridged_channel(sub->next->owner)) {
bridged = ast_bridged_channel(sub->next->owner);
transmit_notify_request_with_callerid(p->sub, "L/rg",
- S_COR(bridged->caller.id.number.valid, bridged->caller.id.number.str, ""),
- S_COR(bridged->caller.id.name.valid, bridged->caller.id.name.str, ""));
+ S_COR(ast_channel_caller(bridged)->id.number.valid, ast_channel_caller(bridged)->id.number.str, ""),
+ S_COR(ast_channel_caller(bridged)->id.name.valid, ast_channel_caller(bridged)->id.name.str, ""));
}
}
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
if (!i->adsi) {
/*res = tone_zone_play_tone(p->subs[index].zfd, -1);*/
ast_indicate(chan, -1);
ast_channel_exten_set(chan, p->dtmf_buf);
- chan->dialed.number.str = ast_strdup(p->dtmf_buf);
+ ast_channel_dialed(chan)->number.str = ast_strdup(p->dtmf_buf);
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
ast_set_callerid(chan,
p->hidecallerid ? "" : p->cid_num,
p->hidecallerid ? "" : p->cid_name,
- chan->caller.ani.number.valid ? NULL : p->cid_num);
+ ast_channel_caller(chan)->ani.number.valid ? NULL : p->cid_num);
ast_setstate(chan, AST_STATE_RING);
/*dahdi_enable_ec(p);*/
if (p->dtmfmode & MGCP_DTMF_HYBRID) {
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
timeout = firstdigittimeout;
} else if (!ast_canmatch_extension(chan, ast_channel_context(chan), p->dtmf_buf, 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))
&& ((p->dtmf_buf[0] != '*') || (strlen(p->dtmf_buf) > 2))) {
ast_debug(1, "Can't match %s from '%s' in context %s\n", p->dtmf_buf,
- S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<Unknown Caller>"),
+ S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<Unknown Caller>"),
ast_channel_context(chan));
break;
}
bc->nt ? "NT" : "TE",
help->originator == ORG_AST ? "*" : "I",
ast ? ast_channel_exten(ast) : "",
- (ast && ast->caller.id.name.valid && ast->caller.id.name.str)
- ? ast->caller.id.name.str : "",
- (ast && ast->caller.id.number.valid && ast->caller.id.number.str)
- ? ast->caller.id.number.str : "",
+ (ast && ast_channel_caller(ast)->id.name.valid && ast_channel_caller(ast)->id.name.str)
+ ? ast_channel_caller(ast)->id.name.str : "",
+ (ast && ast_channel_caller(ast)->id.number.valid && ast_channel_caller(ast)->id.number.str)
+ ? ast_channel_caller(ast)->id.number.str : "",
bc->redirecting.from.name,
bc->redirecting.from.number,
bc->redirecting.to.name,
" --> hold_channel: %d\n",
help->l3id,
ast_channel_exten(ast),
- S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, ""),
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, ""),
+ S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, ""),
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, ""),
help->hold.port,
help->hold.channel
);
} else {
ast_cli(a->fd, "* Channel in unknown STATE !!! Exten:%s, Callerid:%s\n",
ast_channel_exten(ast),
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, ""));
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, ""));
}
}
}
chan_misdn_log(2, port, " --> pres: %d screen: %d\n", pres, screen);
if (pres < 0 || screen < 0) {
- chan_misdn_log(2, port, " --> pres: %x\n", ast->connected.id.number.presentation);
+ chan_misdn_log(2, port, " --> pres: %x\n", ast_channel_connected(ast)->id.number.presentation);
- bc->caller.presentation = ast_to_misdn_pres(ast->connected.id.number.presentation);
+ bc->caller.presentation = ast_to_misdn_pres(ast_channel_connected(ast)->id.number.presentation);
chan_misdn_log(2, port, " --> PRES: %s(%d)\n", misdn_to_str_pres(bc->caller.presentation), bc->caller.presentation);
- bc->caller.screening = ast_to_misdn_screen(ast->connected.id.number.presentation);
+ bc->caller.screening = ast_to_misdn_screen(ast_channel_connected(ast)->id.number.presentation);
chan_misdn_log(2, port, " --> SCREEN: %s(%d)\n", misdn_to_str_screen(bc->caller.screening), bc->caller.screening);
} else {
bc->caller.screening = screen;
update_caller.ani.number = 1;
ast_channel_lock(ast);
- ast_party_caller_set_init(&caller, &ast->caller);
+ ast_party_caller_set_init(&caller, ast_channel_caller(ast));
caller.id.number.valid = 1;
caller.id.number.str = (char *) id->number;
/* ORIGINATOR MISDN (incoming call) */
ast_copy_string(bc->connected.name,
- S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""),
+ S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, ""),
sizeof(bc->connected.name));
- if (ast->connected.id.number.valid) {
- ast_copy_string(bc->connected.number, S_OR(ast->connected.id.number.str, ""),
+ if (ast_channel_connected(ast)->id.number.valid) {
+ ast_copy_string(bc->connected.number, S_OR(ast_channel_connected(ast)->id.number.str, ""),
sizeof(bc->connected.number));
- bc->connected.presentation = ast_to_misdn_pres(ast->connected.id.number.presentation);
- bc->connected.screening = ast_to_misdn_screen(ast->connected.id.number.presentation);
- bc->connected.number_type = ast_to_misdn_ton(ast->connected.id.number.plan);
- bc->connected.number_plan = ast_to_misdn_plan(ast->connected.id.number.plan);
+ bc->connected.presentation = ast_to_misdn_pres(ast_channel_connected(ast)->id.number.presentation);
+ bc->connected.screening = ast_to_misdn_screen(ast_channel_connected(ast)->id.number.presentation);
+ bc->connected.number_type = ast_to_misdn_ton(ast_channel_connected(ast)->id.number.plan);
+ bc->connected.number_plan = ast_to_misdn_plan(ast_channel_connected(ast)->id.number.plan);
} else {
bc->connected.number[0] = '\0';
bc->connected.presentation = 0;/* Allowed */
/* ORIGINATOR Asterisk (outgoing call) */
ast_copy_string(bc->caller.name,
- S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""),
+ S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, ""),
sizeof(bc->caller.name));
- if (ast->connected.id.number.valid) {
- ast_copy_string(bc->caller.number, S_OR(ast->connected.id.number.str, ""),
+ if (ast_channel_connected(ast)->id.number.valid) {
+ ast_copy_string(bc->caller.number, S_OR(ast_channel_connected(ast)->id.number.str, ""),
sizeof(bc->caller.number));
- bc->caller.presentation = ast_to_misdn_pres(ast->connected.id.number.presentation);
- bc->caller.screening = ast_to_misdn_screen(ast->connected.id.number.presentation);
- bc->caller.number_type = ast_to_misdn_ton(ast->connected.id.number.plan);
- bc->caller.number_plan = ast_to_misdn_plan(ast->connected.id.number.plan);
+ bc->caller.presentation = ast_to_misdn_pres(ast_channel_connected(ast)->id.number.presentation);
+ bc->caller.screening = ast_to_misdn_screen(ast_channel_connected(ast)->id.number.presentation);
+ bc->caller.number_type = ast_to_misdn_ton(ast_channel_connected(ast)->id.number.plan);
+ bc->caller.number_plan = ast_to_misdn_plan(ast_channel_connected(ast)->id.number.plan);
} else {
bc->caller.number[0] = '\0';
bc->caller.presentation = 0;/* Allowed */
static void misdn_copy_redirecting_from_ast(struct misdn_bchannel *bc, struct ast_channel *ast)
{
ast_copy_string(bc->redirecting.from.name,
- S_COR(ast->redirecting.from.name.valid, ast->redirecting.from.name.str, ""),
+ S_COR(ast_channel_redirecting(ast)->from.name.valid, ast_channel_redirecting(ast)->from.name.str, ""),
sizeof(bc->redirecting.from.name));
- if (ast->redirecting.from.number.valid) {
- ast_copy_string(bc->redirecting.from.number, S_OR(ast->redirecting.from.number.str, ""),
+ if (ast_channel_redirecting(ast)->from.number.valid) {
+ ast_copy_string(bc->redirecting.from.number, S_OR(ast_channel_redirecting(ast)->from.number.str, ""),
sizeof(bc->redirecting.from.number));
- bc->redirecting.from.presentation = ast_to_misdn_pres(ast->redirecting.from.number.presentation);
- bc->redirecting.from.screening = ast_to_misdn_screen(ast->redirecting.from.number.presentation);
- bc->redirecting.from.number_type = ast_to_misdn_ton(ast->redirecting.from.number.plan);
- bc->redirecting.from.number_plan = ast_to_misdn_plan(ast->redirecting.from.number.plan);
+ bc->redirecting.from.presentation = ast_to_misdn_pres(ast_channel_redirecting(ast)->from.number.presentation);
+ bc->redirecting.from.screening = ast_to_misdn_screen(ast_channel_redirecting(ast)->from.number.presentation);
+ bc->redirecting.from.number_type = ast_to_misdn_ton(ast_channel_redirecting(ast)->from.number.plan);
+ bc->redirecting.from.number_plan = ast_to_misdn_plan(ast_channel_redirecting(ast)->from.number.plan);
} else {
bc->redirecting.from.number[0] = '\0';
bc->redirecting.from.presentation = 0;/* Allowed */
}
ast_copy_string(bc->redirecting.to.name,
- S_COR(ast->redirecting.to.name.valid, ast->redirecting.to.name.str, ""),
+ S_COR(ast_channel_redirecting(ast)->to.name.valid, ast_channel_redirecting(ast)->to.name.str, ""),
sizeof(bc->redirecting.to.name));
- if (ast->redirecting.to.number.valid) {
- ast_copy_string(bc->redirecting.to.number, S_OR(ast->redirecting.to.number.str, ""),
+ if (ast_channel_redirecting(ast)->to.number.valid) {
+ ast_copy_string(bc->redirecting.to.number, S_OR(ast_channel_redirecting(ast)->to.number.str, ""),
sizeof(bc->redirecting.to.number));
- bc->redirecting.to.presentation = ast_to_misdn_pres(ast->redirecting.to.number.presentation);
- bc->redirecting.to.screening = ast_to_misdn_screen(ast->redirecting.to.number.presentation);
- bc->redirecting.to.number_type = ast_to_misdn_ton(ast->redirecting.to.number.plan);
- bc->redirecting.to.number_plan = ast_to_misdn_plan(ast->redirecting.to.number.plan);
+ bc->redirecting.to.presentation = ast_to_misdn_pres(ast_channel_redirecting(ast)->to.number.presentation);
+ bc->redirecting.to.screening = ast_to_misdn_screen(ast_channel_redirecting(ast)->to.number.presentation);
+ bc->redirecting.to.number_type = ast_to_misdn_ton(ast_channel_redirecting(ast)->to.number.plan);
+ bc->redirecting.to.number_plan = ast_to_misdn_plan(ast_channel_redirecting(ast)->to.number.plan);
} else {
bc->redirecting.to.number[0] = '\0';
bc->redirecting.to.presentation = 0;/* Allowed */
bc->redirecting.to.number_plan = NUMPLAN_UNKNOWN;
}
- bc->redirecting.reason = ast_to_misdn_reason(ast->redirecting.reason);
- bc->redirecting.count = ast->redirecting.count;
+ bc->redirecting.reason = ast_to_misdn_reason(ast_channel_redirecting(ast)->reason);
+ bc->redirecting.count = ast_channel_redirecting(ast)->count;
}
/*!
struct ast_party_redirecting redirecting;
struct ast_set_party_redirecting update_redirecting;
- ast_party_redirecting_set_init(&redirecting, &ast->redirecting);
+ ast_party_redirecting_set_init(&redirecting, ast_channel_redirecting(ast));
memset(&update_redirecting, 0, sizeof(update_redirecting));
update_redirecting.from.number = 1;
ast_copy_string(newbc->dialed.number, args.ext, sizeof(newbc->dialed.number));
if (ast_strlen_zero(newbc->caller.name)
- && ast->connected.id.name.valid
- && !ast_strlen_zero(ast->connected.id.name.str)) {
- ast_copy_string(newbc->caller.name, ast->connected.id.name.str, sizeof(newbc->caller.name));
+ && ast_channel_connected(ast)->id.name.valid
+ && !ast_strlen_zero(ast_channel_connected(ast)->id.name.str)) {
+ ast_copy_string(newbc->caller.name, ast_channel_connected(ast)->id.name.str, sizeof(newbc->caller.name));
chan_misdn_log(3, port, " --> * set caller:\"%s\" <%s>\n", newbc->caller.name, newbc->caller.number);
}
if (ast_strlen_zero(newbc->caller.number)
- && ast->connected.id.number.valid
- && !ast_strlen_zero(ast->connected.id.number.str)) {
- ast_copy_string(newbc->caller.number, ast->connected.id.number.str, sizeof(newbc->caller.number));
+ && ast_channel_connected(ast)->id.number.valid
+ && !ast_strlen_zero(ast_channel_connected(ast)->id.number.str)) {
+ ast_copy_string(newbc->caller.number, ast_channel_connected(ast)->id.number.str, sizeof(newbc->caller.number));
chan_misdn_log(3, port, " --> * set caller:\"%s\" <%s>\n", newbc->caller.name, newbc->caller.number);
}
strncat(newbc->incoming_cid_tag, newbc->caller.number, sizeof(newbc->incoming_cid_tag) - strlen(newbc->incoming_cid_tag) - 1);
}
- ast->caller.id.tag = ast_strdup(newbc->incoming_cid_tag);
+ ast_channel_caller(ast)->id.tag = ast_strdup(newbc->incoming_cid_tag);
misdn_cfg_get(port, MISDN_CFG_LOCALDIALPLAN, &number_type, sizeof(number_type));
if (number_type < 0) {
- if (ast->connected.id.number.valid) {
- newbc->caller.number_type = ast_to_misdn_ton(ast->connected.id.number.plan);
- newbc->caller.number_plan = ast_to_misdn_plan(ast->connected.id.number.plan);
+ if (ast_channel_connected(ast)->id.number.valid) {
+ newbc->caller.number_type = ast_to_misdn_ton(ast_channel_connected(ast)->id.number.plan);
+ newbc->caller.number_plan = ast_to_misdn_plan(ast_channel_connected(ast)->id.number.plan);
} else {
newbc->caller.number_type = NUMTYPE_UNKNOWN;
newbc->caller.number_plan = NUMPLAN_ISDN;
bc->pid,
ast_channel_context(ast),
ast_channel_exten(ast),
- (ast->caller.id.name.valid && ast->caller.id.name.str)
- ? ast->caller.id.name.str : "",
- (ast->caller.id.number.valid && ast->caller.id.number.str)
- ? ast->caller.id.number.str : "",
+ (ast_channel_caller(ast)->id.name.valid && ast_channel_caller(ast)->id.name.str)
+ ? ast_channel_caller(ast)->id.name.str : "",
+ (ast_channel_caller(ast)->id.number.valid && ast_channel_caller(ast)->id.number.str)
+ ? ast_channel_caller(ast)->id.number.str : "",
misdn_get_ch_state(p));
chan_misdn_log(3, bc->port, " --> l3id:%x\n", p->l3id);
chan_misdn_log(3, bc->port, " --> cause:%d\n", bc->cause);
misdn_cfg_get(tmp->bc->port, MISDN_CFG_FAXDETECT_CONTEXT, &context_tmp, sizeof(context_tmp));
context = S_OR(context_tmp, S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast)));
if (ast_exists_extension(ast, context, "fax", 1,
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, NULL))) {
ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast_channel_name(ast), context);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast_channel_exten(ast));
chan_misdn_log(5, ch->bc->port,
"BC not active (nor bridged) dropping: %d frames addr:%x exten:%s cid:%s ch->state:%s bc_state:%d l3id:%x\n",
frame->samples, ch->bc->addr, ast_channel_exten(ast),
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, ""),
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, ""),
misdn_get_ch_state(ch), ch->bc->bc_state, ch->bc->l3_id);
}
if (!ast_strlen_zero(cid_num)) {
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(cid_num);
}
if (pipe(chlist->pipe) < 0) {
bc->pid,
ast_channel_context(ast),
ast_channel_exten(ast),
- S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, ""),
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, ""));
+ S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, ""),
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, ""));
if (ast_channel_state(ast) != AST_STATE_RESERVED) {
chan_misdn_log(3, bc->port, " --> Setting AST State to down\n");
ast_channel_name(held_ch->ast), ast_channel_name(target));
ast_party_connected_line_init(&target_colp);
- ast_party_connected_line_copy(&target_colp, &target->connected);
+ ast_party_connected_line_copy(&target_colp, ast_channel_connected(target));
ast_party_connected_line_init(&transferee_colp);
- ast_party_connected_line_copy(&transferee_colp, &held_ch->ast->connected);
+ ast_party_connected_line_copy(&transferee_colp, ast_channel_connected(held_ch->ast));
held_ch->hold.state = MISDN_HOLD_TRANSFER;
/*
"* Starting Ast context:%s dialed:%s caller:\"%s\" <%s> with 's' extension\n",
ast_channel_context(ast),
ast_channel_exten(ast),
- (ast->caller.id.name.valid && ast->caller.id.name.str)
- ? ast->caller.id.name.str : "",
- (ast->caller.id.number.valid && ast->caller.id.number.str)
- ? ast->caller.id.number.str : "");
+ (ast_channel_caller(ast)->id.name.valid && ast_channel_caller(ast)->id.name.str)
+ ? ast_channel_caller(ast)->id.name.str : "",
+ (ast_channel_caller(ast)->id.number.valid && ast_channel_caller(ast)->id.number.str)
+ ? ast_channel_caller(ast)->id.number.str : "");
ast_channel_exten_set(ast, "s");
return;
}
ast_channel_priority_set(chan, notify->priority);
- ast_free(chan->dialed.number.str);
- chan->dialed.number.str = ast_strdup(notify->exten);
+ ast_free(ast_channel_dialed(chan)->number.str);
+ ast_channel_dialed(chan)->number.str = ast_strdup(notify->exten);
if (ast_pbx_start(chan)) {
ast_log(LOG_WARNING, "Unable to start pbx channel %s!\n", ast_channel_name(chan));
bc->div_leg_3_rx_wanted = 0;
if (ch && ch->ast) {
- ch->ast->redirecting.to.number.presentation =
+ ast_channel_redirecting(ch->ast)->to.number.presentation =
bc->fac_in.u.DivertingLegInformation3.PresentationAllowedIndicator
? AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED
: AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
- ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting, NULL);
+ ast_channel_queue_redirecting_update(ch->ast, ast_channel_redirecting(ch->ast), NULL);
}
}
break;
/* Update asterisk channel caller information */
chan_misdn_log(2, bc->port, " --> TON: %s(%d)\n", misdn_to_str_ton(bc->caller.number_type), bc->caller.number_type);
chan_misdn_log(2, bc->port, " --> PLAN: %s(%d)\n", misdn_to_str_plan(bc->caller.number_plan), bc->caller.number_plan);
- chan->caller.id.number.plan = misdn_to_ast_ton(bc->caller.number_type)
+ ast_channel_caller(chan)->id.number.plan = misdn_to_ast_ton(bc->caller.number_type)
| misdn_to_ast_plan(bc->caller.number_plan);
chan_misdn_log(2, bc->port, " --> PRES: %s(%d)\n", misdn_to_str_pres(bc->caller.presentation), bc->caller.presentation);
chan_misdn_log(2, bc->port, " --> SCREEN: %s(%d)\n", misdn_to_str_screen(bc->caller.screening), bc->caller.screening);
- chan->caller.id.number.presentation = misdn_to_ast_pres(bc->caller.presentation)
+ ast_channel_caller(chan)->id.number.presentation = misdn_to_ast_pres(bc->caller.presentation)
| misdn_to_ast_screen(bc->caller.screening);
ast_set_callerid(chan, bc->caller.number, NULL, bc->caller.number);
}
ast_channel_lock(chan);
- chan->caller.id.tag = ast_strdup(bc->incoming_cid_tag);
+ ast_channel_caller(chan)->id.tag = ast_strdup(bc->incoming_cid_tag);
ast_channel_unlock(chan);
if (!ast_strlen_zero(bc->redirecting.from.number)) {
bc->div_leg_3_rx_wanted = 0;
if (ch->ast) {
- ch->ast->redirecting.to.number.presentation =
+ ast_channel_redirecting(ch->ast)->to.number.presentation =
AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
- ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting, NULL);
+ ast_channel_queue_redirecting_update(ch->ast, ast_channel_redirecting(ch->ast), NULL);
}
}
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
break;
}
misdn_copy_redirecting_to_ast(ch->ast, &bc->redirecting, bc->incoming_cid_tag);
- ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting, NULL);
+ ast_channel_queue_redirecting_update(ch->ast, ast_channel_redirecting(ch->ast), NULL);
break;
case mISDN_NOTIFY_CODE_CALL_TRANSFER_ALERTING:
/*
ast_verbose(" << Call to device '%s' dnid '%s' rdnis '%s' on console from '%s' <%s> >>\n",
dest,
- S_OR(c->dialed.number.str, ""),
- S_COR(c->redirecting.from.number.valid, c->redirecting.from.number.str, ""),
- S_COR(c->caller.id.name.valid, c->caller.id.name.str, ""),
- S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""));
+ S_OR(ast_channel_dialed(c)->number.str, ""),
+ S_COR(ast_channel_redirecting(c)->from.number.valid, ast_channel_redirecting(c)->from.number.str, ""),
+ S_COR(ast_channel_caller(c)->id.name.valid, ast_channel_caller(c)->id.name.str, ""),
+ S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, ""));
if (!ast_strlen_zero(args.flags) && strcasecmp(args.flags, "answer") == 0) {
f.subclass.integer = AST_CONTROL_ANSWER;
ast_queue_frame(c, &f);
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!ast_strlen_zero(o->cid_num)) {
- c->caller.ani.number.valid = 1;
- c->caller.ani.number.str = ast_strdup(o->cid_num);
+ ast_channel_caller(c)->ani.number.valid = 1;
+ ast_channel_caller(c)->ani.number.str = ast_strdup(o->cid_num);
}
if (!ast_strlen_zero(ext)) {
- c->dialed.number.str = ast_strdup(ext);
+ ast_channel_dialed(c)->number.str = ast_strdup(ext);
}
o->owner = c;
if (ctx == NULL) /* supply default context if needed */
ctx = ast_strdupa(ast_channel_context(o->owner));
if (!ast_exists_extension(b, ctx, ext, 1,
- S_COR(b->caller.id.number.valid, b->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(b)->id.number.valid, ast_channel_caller(b)->id.number.str, NULL))) {
ast_cli(a->fd, "No such extension exists\n");
} else {
ast_cli(a->fd, "Whee, transferring %s to %s@%s.\n", ast_channel_name(b), ext, ctx);
snprintf(cid.hour, sizeof(cid.hour), "%02d", tm.tm_hour);
snprintf(cid.min, sizeof(cid.min), "%02d", tm.tm_min);
/* the standard format of ast->callerid is: "name" <number>, but not always complete */
- if (!ast->connected.id.name.valid
- || ast_strlen_zero(ast->connected.id.name.str)) {
+ if (!ast_channel_connected(ast)->id.name.valid
+ || ast_strlen_zero(ast_channel_connected(ast)->id.name.str)) {
strcpy(cid.name, DEFAULT_CALLER_ID);
} else {
- ast_copy_string(cid.name, ast->connected.id.name.str, sizeof(cid.name));
+ ast_copy_string(cid.name, ast_channel_connected(ast)->id.name.str, sizeof(cid.name));
}
- if (ast->connected.id.number.valid && ast->connected.id.number.str) {
- ast_copy_string(cid.number, ast->connected.id.number.str, sizeof(cid.number));
+ if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
+ ast_copy_string(cid.number, ast_channel_connected(ast)->id.number.str, sizeof(cid.number));
}
p = ast_channel_tech_pvt(ast);
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
i->owner = tmp;
}
/* Check whether there is vxml_url, distinctive ring variables */
- headp=&ast->varshead;
+ headp=ast_channel_varshead(ast);
AST_LIST_TRAVERSE(headp, current, entries) {
/* Check whether there is a VXML_URL variable */
if (!p->options->vxml_url && !strcasecmp(ast_var_name(current), "VXML_URL")) {
ast_channel_hangupcause_set(ast, AST_CAUSE_USER_BUSY);
return res;
}
- p->callingpres = ast_party_id_presentation(&ast->caller.id);
+ p->callingpres = ast_party_id_presentation(&ast_channel_caller(ast)->id);
ast_rtp_instance_available_formats(p->rtp, p->caps, p->prefcaps, p->jointcaps);
p->jointnoncodeccapability = p->noncodeccapability;
ast_channel_lock(tmp);
sip_pvt_lock(i);
ast_channel_cc_params_init(tmp, i->cc_params);
- tmp->caller.id.tag = ast_strdup(i->cid_tag);
+ ast_channel_caller(tmp)->id.tag = ast_strdup(i->cid_tag);
ast_channel_tech_set(tmp, (ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INFO || ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_SHORTINFO) ? &sip_tech_info : &sip_tech);
tmp->callgroup = i->callgroup;
tmp->pickupgroup = i->pickupgroup;
- tmp->caller.id.name.presentation = i->callingpres;
- tmp->caller.id.number.presentation = i->callingpres;
+ ast_channel_caller(tmp)->id.name.presentation = i->callingpres;
+ ast_channel_caller(tmp)->id.number.presentation = i->callingpres;
if (!ast_strlen_zero(i->parkinglot)) {
ast_channel_parkinglot_set(tmp, i->parkinglot);
}
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID event */
if (!ast_strlen_zero(i->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(i->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
if (!ast_strlen_zero(i->rdnis)) {
- tmp->redirecting.from.number.valid = 1;
- tmp->redirecting.from.number.str = ast_strdup(i->rdnis);
+ ast_channel_redirecting(tmp)->from.number.valid = 1;
+ ast_channel_redirecting(tmp)->from.number.str = ast_strdup(i->rdnis);
}
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
- tmp->dialed.number.str = ast_strdup(i->exten);
+ ast_channel_dialed(tmp)->number.str = ast_strdup(i->exten);
}
ast_channel_priority_set(tmp, 1);
sip_pvt_unlock(p);
ast_channel_unlock(ast);
if (ast_exists_extension(ast, target_context, "fax", 1,
- S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, NULL))) {
ast_channel_lock(ast);
sip_pvt_lock(p);
ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(ast));
const char *target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));
ast_channel_unlock(p->owner);
if (ast_exists_extension(p->owner, target_context, "fax", 1,
- S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL))) {
ast_verb(2, "Redirecting '%s' to fax extension due to peer T.38 re-INVITE\n", ast_channel_name(p->owner));
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
return 0;
}
- if (p->owner && p->owner->connected.id.number.valid
- && p->owner->connected.id.number.str) {
- lid_num = p->owner->connected.id.number.str;
+ if (p->owner && ast_channel_connected(p->owner)->id.number.valid
+ && ast_channel_connected(p->owner)->id.number.str) {
+ lid_num = ast_channel_connected(p->owner)->id.number.str;
}
- if (p->owner && p->owner->connected.id.name.valid
- && p->owner->connected.id.name.str) {
- lid_name = p->owner->connected.id.name.str;
+ if (p->owner && ast_channel_connected(p->owner)->id.name.valid
+ && ast_channel_connected(p->owner)->id.name.str) {
+ lid_name = ast_channel_connected(p->owner)->id.name.str;
}
- lid_pres = (p->owner) ? ast_party_id_presentation(&p->owner->connected.id) : AST_PRES_NUMBER_NOT_AVAILABLE;
+ lid_pres = (p->owner) ? ast_party_id_presentation(&ast_channel_connected(p->owner)->id) : AST_PRES_NUMBER_NOT_AVAILABLE;
if (ast_strlen_zero(lid_num))
return 0;
d = S_OR(p->fromdomain, ast_sockaddr_stringify_host_remote(&p->ourip));
if (p->owner) {
- if ((ast_party_id_presentation(&p->owner->connected.id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
- l = p->owner->connected.id.number.valid ? p->owner->connected.id.number.str : NULL;
- n = p->owner->connected.id.name.valid ? p->owner->connected.id.name.str : NULL;
+ if ((ast_party_id_presentation(&ast_channel_connected(p->owner)->id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
+ l = ast_channel_connected(p->owner)->id.number.valid ? ast_channel_connected(p->owner)->id.number.str : NULL;
+ n = ast_channel_connected(p->owner)->id.name.valid ? ast_channel_connected(p->owner)->id.name.str : NULL;
} else {
/* Even if we are using RPID, we shouldn't leak information in the From if the user wants
* their callerid restricted */
return;
}
- diverting_number = pvt->owner->redirecting.from.number.str;
- if (!pvt->owner->redirecting.from.number.valid
+ diverting_number = ast_channel_redirecting(pvt->owner)->from.number.str;
+ if (!ast_channel_redirecting(pvt->owner)->from.number.valid
|| ast_strlen_zero(diverting_number)) {
return;
}
- reason = sip_reason_code_to_str(pvt->owner->redirecting.reason);
+ reason = sip_reason_code_to_str(ast_channel_redirecting(pvt->owner)->reason);
/* We at least have a number to place in the Diversion header, which is enough */
- diverting_name = pvt->owner->redirecting.from.name.str;
- if (!pvt->owner->redirecting.from.name.valid
+ diverting_name = ast_channel_redirecting(pvt->owner)->from.name.str;
+ if (!ast_channel_redirecting(pvt->owner)->from.name.valid
|| ast_strlen_zero(diverting_name)) {
snprintf(header_text, sizeof(header_text), "<sip:%s@%s>;reason=%s", diverting_number,
ast_sockaddr_stringify_host_remote(&pvt->ourip), reason);
ast_channel_lock(chan);
- headp = &chan->varshead;
+ headp = ast_channel_varshead(chan);
if (!headp) {
ast_log(LOG_WARNING, "No Headp for the channel...ooops!\n");
int need;
ast_channel_lock(caller);
- cid_num = S_COR(caller->caller.id.number.valid,
- caller->caller.id.number.str, "");
+ cid_num = S_COR(ast_channel_caller(caller)->id.number.valid,
+ ast_channel_caller(caller)->id.number.str, "");
need = strlen(cid_num) + strlen(p->fromdomain) + sizeof("sip:@");
local_target = alloca(need);
snprintf(local_target, need, "sip:%s@%s", cid_num, p->fromdomain);
- local_display = ast_strdupa(S_COR(caller->caller.id.name.valid,
- caller->caller.id.name.str, ""));
+ local_display = ast_strdupa(S_COR(ast_channel_caller(caller)->id.name.valid,
+ ast_channel_caller(caller)->id.name.str, ""));
ast_channel_unlock(caller);
caller = ast_channel_unref(caller);
}
if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) {
return;
}
- if (!p->owner->connected.id.number.valid
- || ast_strlen_zero(p->owner->connected.id.number.str)) {
+ if (!ast_channel_connected(p->owner)->id.number.valid
+ || ast_strlen_zero(ast_channel_connected(p->owner)->id.number.str)) {
return;
}
append_history(p, "ConnectedLine", "%s party is now %s <%s>",
ast_test_flag(&p->flags[0], SIP_OUTGOING) ? "Calling" : "Called",
- S_COR(p->owner->connected.id.name.valid, p->owner->connected.id.name.str, ""),
- S_COR(p->owner->connected.id.number.valid, p->owner->connected.id.number.str, ""));
+ S_COR(ast_channel_connected(p->owner)->id.name.valid, ast_channel_connected(p->owner)->id.name.str, ""),
+ S_COR(ast_channel_connected(p->owner)->id.number.valid, ast_channel_connected(p->owner)->id.number.str, ""));
if (ast_channel_state(p->owner) == AST_STATE_UP || ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
struct sip_request req;
if (p->owner) {
ast_set_callerid(p->owner, cid_num, cid_name, NULL);
- p->owner->caller.id.name.presentation = callingpres;
- p->owner->caller.id.number.presentation = callingpres;
+ ast_channel_caller(p->owner)->id.name.presentation = callingpres;
+ ast_channel_caller(p->owner)->id.number.presentation = callingpres;
}
}
if (p->owner) {
ast_set_callerid(p->owner, cid_num, cid_name, NULL);
- p->owner->caller.id.name.presentation = callingpres;
- p->owner->caller.id.number.presentation = callingpres;
+ ast_channel_caller(p->owner)->id.name.presentation = callingpres;
+ ast_channel_caller(p->owner)->id.number.presentation = callingpres;
}
return 1;
ast_party_connected_line_init(&connected_to_transferee);
ast_party_connected_line_init(&connected_to_target);
/* No need to lock current->chan1 here since it was locked in sipsock_read */
- ast_party_connected_line_copy(&connected_to_transferee, ¤t->chan1->connected);
+ ast_party_connected_line_copy(&connected_to_transferee, ast_channel_connected(current->chan1));
/* No need to lock target.chan1 here since it was locked in get_sip_pvt_byid_locked */
- ast_party_connected_line_copy(&connected_to_target, &target.chan1->connected);
+ ast_party_connected_line_copy(&connected_to_target, ast_channel_connected(target.chan1));
connected_to_target.source = connected_to_transferee.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
res = attempt_transfer(current, &target);
if (res) {
}
ast_channel_lock(chan);
- headp=&chan->varshead;
+ headp=ast_channel_varshead(chan);
AST_LIST_TRAVERSE_SAFE_BEGIN (headp, newvariable, entries) {
if (strncasecmp(ast_var_name(newvariable), "SIPADDHEADER", strlen("SIPADDHEADER")) == 0) {
if (removeall || (!strncasecmp(ast_var_value(newvariable),inbuf,strlen(inbuf)))) {
d = l->device;
if (sub->calldirection == SKINNY_INCOMING) {
- fromname = S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, "");
- fromnum = S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, "");
- toname = S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, "");
- tonum = S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, "");
+ fromname = S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, "");
+ fromnum = S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, "");
+ toname = S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, "");
+ tonum = S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, "");
} else if (sub->calldirection == SKINNY_OUTGOING) {
- fromname = S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, "");
- fromnum = S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, "");
- toname = S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, l->lastnumberdialed);
- tonum = S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, l->lastnumberdialed);
+ fromname = S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, "");
+ fromnum = S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, "");
+ toname = S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, l->lastnumberdialed);
+ tonum = S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, l->lastnumberdialed);
} else {
ast_verb(1, "Error sending Callinfo to %s(%d) - No call direction in sub\n", d->name, l->instance);
return;
d = l->device;
if (sub->calldirection == SKINNY_INCOMING) {
- fromname = S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, "");
- fromnum = S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, "");
- toname = S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, "");
- tonum = S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, "");
+ fromname = S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, "");
+ fromnum = S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, "");
+ toname = S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, "");
+ tonum = S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, "");
} else if (sub->calldirection == SKINNY_OUTGOING) {
- fromname = S_COR(ast->caller.id.name.valid, ast->caller.id.name.str, "");
- fromnum = S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, "");
- toname = S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, l->lastnumberdialed);
- tonum = S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, l->lastnumberdialed);
+ fromname = S_COR(ast_channel_caller(ast)->id.name.valid, ast_channel_caller(ast)->id.name.str, "");
+ fromnum = S_COR(ast_channel_caller(ast)->id.number.valid, ast_channel_caller(ast)->id.number.str, "");
+ toname = S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, l->lastnumberdialed);
+ tonum = S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, l->lastnumberdialed);
} else {
ast_verb(1, "Error sending Callinfo to %s(%d) - No call direction in sub\n", d->name, l->instance);
return;
struct skinny_line *l = sub->line;
struct skinny_device *d = l->device;
- if (!c->caller.id.number.valid
- || ast_strlen_zero(c->caller.id.number.str)
- || !c->connected.id.number.valid
- || ast_strlen_zero(c->connected.id.number.str))
+ if (!ast_channel_caller(c)->id.number.valid
+ || ast_strlen_zero(ast_channel_caller(c)->id.number.str)
+ || !ast_channel_connected(c)->id.number.valid
+ || ast_strlen_zero(ast_channel_connected(c)->id.number.str))
return;
if (skinnydebug) {
ast_set_callerid(c,
l->hidecallerid ? "" : l->cid_num,
l->hidecallerid ? "" : l->cid_name,
- c->caller.ani.number.valid ? NULL : l->cid_num);
+ ast_channel_caller(c)->ani.number.valid ? NULL : l->cid_num);
#if 1 /* XXX This code is probably not necessary */
- ast_party_number_free(&c->connected.id.number);
- ast_party_number_init(&c->connected.id.number);
- c->connected.id.number.valid = 1;
- c->connected.id.number.str = ast_strdup(ast_channel_exten(c));
- ast_party_name_free(&c->connected.id.name);
- ast_party_name_init(&c->connected.id.name);
+ ast_party_number_free(&ast_channel_connected(c)->id.number);
+ ast_party_number_init(&ast_channel_connected(c)->id.number);
+ ast_channel_connected(c)->id.number.valid = 1;
+ ast_channel_connected(c)->id.number.str = ast_strdup(ast_channel_exten(c));
+ ast_party_name_free(&ast_channel_connected(c)->id.name);
+ ast_party_name_init(&ast_channel_connected(c)->id.name);
#endif
ast_setstate(c, AST_STATE_RING);
if (!sub->rtp) {
}
return NULL;
} else if (!ast_canmatch_extension(c, ast_channel_context(c), sub->exten, 1,
- S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))
+ S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, NULL))
&& ((sub->exten[0] != '*') || (!ast_strlen_zero(sub->exten) > 2))) {
ast_log(LOG_WARNING, "Can't match [%s] from '%s' in context %s\n", sub->exten,
- S_COR(c->caller.id.number.valid, c->caller.id.number.str, "<Unknown Caller>"),
+ S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, "<Unknown Caller>"),
ast_channel_context(c));
if (d->hookstate == SKINNY_OFFHOOK) {
transmit_start_tone(d, SKINNY_REORDER, l->instance, sub->callid);
return -1;
}
- AST_LIST_TRAVERSE(&ast->varshead, current, entries) {
+ AST_LIST_TRAVERSE(ast_channel_varshead(ast), current, entries) {
if (!(strcasecmp(ast_var_name(current),"SKINNY_AUTOANSWER"))) {
if (d->hookstate == SKINNY_ONHOOK && !sub->aa_sched) {
char buf[24];
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!ast_strlen_zero(l->cid_num)) {
- tmp->caller.ani.number.valid = 1;
- tmp->caller.ani.number.str = ast_strdup(l->cid_num);
+ ast_channel_caller(tmp)->ani.number.valid = 1;
+ ast_channel_caller(tmp)->ani.number.str = ast_strdup(l->cid_num);
}
ast_channel_priority_set(tmp, 1);
Sendicon(TEXT_LINE0, FAV_ICON_NONE, session);
if (sub->owner) {
- if (sub->owner->connected.id.number.valid
- && sub->owner->connected.id.number.str) {
+ if (ast_channel_connected(sub->owner)->id.number.valid
+ && ast_channel_connected(sub->owner)->id.number.str) {
if (session->device->height == 1) {
- send_text(TEXT_LINE0, TEXT_NORMAL, session, sub->owner->connected.id.number.str);
+ send_text(TEXT_LINE0, TEXT_NORMAL, session, ast_channel_connected(sub->owner)->id.number.str);
} else {
- send_text(TEXT_LINE1, TEXT_NORMAL, session, sub->owner->connected.id.number.str);
+ send_text(TEXT_LINE1, TEXT_NORMAL, session, ast_channel_connected(sub->owner)->id.number.str);
}
- change_callerid(session, 0, sub->owner->connected.id.number.str);
+ change_callerid(session, 0, ast_channel_connected(sub->owner)->id.number.str);
} else {
if (session->device->height == 1) {
send_text(TEXT_LINE0, TEXT_NORMAL, session, DEFAULTCALLERID);
}
change_callerid(session, 0, DEFAULTCALLERID);
}
- if (sub->owner->connected.id.name.valid
- && sub->owner->connected.id.name.str) {
- send_text(TEXT_LINE0, TEXT_NORMAL, session, sub->owner->connected.id.name.str);
- change_callerid(session, 1, sub->owner->connected.id.name.str);
+ if (ast_channel_connected(sub->owner)->id.name.valid
+ && ast_channel_connected(sub->owner)->id.name.str) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, session, ast_channel_connected(sub->owner)->id.name.str);
+ change_callerid(session, 1, ast_channel_connected(sub->owner)->id.name.str);
} else {
send_text(TEXT_LINE0, TEXT_NORMAL, session, DEFAULTCALLERNAME);
change_callerid(session, 1, DEFAULTCALLERNAME);
instr = ast_strdup(l->cid_num);
if (instr) {
ast_callerid_parse(instr, &name, &loc);
- tmp->caller.id.number.valid = 1;
- ast_free(tmp->caller.id.number.str);
- tmp->caller.id.number.str = ast_strdup(loc);
- tmp->caller.id.name.valid = 1;
- ast_free(tmp->caller.id.name.str);
- tmp->caller.id.name.str = ast_strdup(name);
+ ast_channel_caller(tmp)->id.number.valid = 1;
+ ast_free(ast_channel_caller(tmp)->id.number.str);
+ ast_channel_caller(tmp)->id.number.str = ast_strdup(loc);
+ ast_channel_caller(tmp)->id.name.valid = 1;
+ ast_free(ast_channel_caller(tmp)->id.name.str);
+ ast_channel_caller(tmp)->id.name.str = ast_strdup(name);
ast_free(instr);
}
}
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!ast_strlen_zero(o->cid_num)) {
- c->caller.ani.number.valid = 1;
- c->caller.ani.number.str = ast_strdup(o->cid_num);
+ ast_channel_caller(c)->ani.number.valid = 1;
+ ast_channel_caller(c)->ani.number.str = ast_strdup(o->cid_num);
}
if (!ast_strlen_zero(ext)) {
- c->dialed.number.str = ast_strdup(ext);
+ ast_channel_dialed(c)->number.str = ast_strdup(ext);
}
o->owner = c;
strcpy(p->cid_name, cli_struct->cn);
}
ast_verb(4, "CID record - got [%s] [%s]\n",
- S_COR(owner->caller.id.number.valid, owner->caller.id.number.str, ""),
- S_COR(owner->caller.id.name.valid, owner->caller.id.name.str, ""));
+ S_COR(ast_channel_caller(owner)->id.number.valid, ast_channel_caller(owner)->id.number.str, ""),
+ S_COR(ast_channel_caller(owner)->id.name.valid, ast_channel_caller(owner)->id.name.str, ""));
snprintf(p->callerid, sizeof(p->callerid), "%s %s", cli_struct->cldn, cli_struct->cn);
} else {
ast_log(LOG_ERROR, "CID record - No caller id avalable on %s \n", p->dev);
} else {
ast_log(LOG_ERROR, "%s: Failed to create Caller ID struct\n", p->dev);
}
- ast_party_number_free(&owner->caller.id.number);
- ast_party_number_init(&owner->caller.id.number);
- ast_party_name_free(&owner->caller.id.name);
- ast_party_name_init(&owner->caller.id.name);
+ ast_party_number_free(&ast_channel_caller(owner)->id.number);
+ ast_party_number_init(&ast_channel_caller(owner)->id.number);
+ ast_party_name_free(&ast_channel_caller(owner)->id.name);
+ ast_party_name_init(&ast_channel_caller(owner)->id.name);
if (number)
ast_shrink_phone_number(number);
ast_set_callerid(owner,
number, name,
- owner->caller.ani.number.valid ? NULL : number);
+ ast_channel_caller(owner)->ani.number.valid ? NULL : number);
if (!ast_strlen_zero(name)){
snprintf(p->callerid, sizeof(p->callerid), "%s %s", number, name);
} else {
const char *target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));
if (ast_exists_extension(p->owner, target_context, "fax", 1,
- S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL))) {
+ S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL))) {
ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(p->owner));
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
ast_channel_lock(chan);
/* AST_LIST_INSERT_TAIL is only good for one frame, cannot use here */
- if (chan->readq.first == NULL) {
- chan->readq.first = f;
+ if (ast_channel_readq(chan).first == NULL) {
+ ast_channel_readq(chan).first = f;
} else {
- chan->readq.last->frame_list.next = f;
+ ast_channel_readq(chan).last->frame_list.next = f;
}
- chan->readq.last = p;
+ ast_channel_readq(chan).last = p;
/*
* more or less same as ast_queue_frame, but extra
* write on the alertpipe to signal frames.
* The three-way party we're about to transfer is on hold if he
* is not in a three way conference.
*/
- if (ast_channel_transfer_masquerade(owner_real, &owner_real->connected, 0,
- bridge_3way, &owner_3way->connected, !inthreeway)) {
+ if (ast_channel_transfer_masquerade(owner_real, ast_channel_connected(owner_real), 0,
+ bridge_3way, ast_channel_connected(owner_3way), !inthreeway)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
ast_channel_name(bridge_3way), ast_channel_name(owner_real));
return -1;
* The three-way party we're about to transfer is on hold if he
* is not in a three way conference.
*/
- if (ast_channel_transfer_masquerade(owner_3way, &owner_3way->connected,
- !inthreeway, bridge_real, &owner_real->connected, 0)) {
+ if (ast_channel_transfer_masquerade(owner_3way, ast_channel_connected(owner_3way),
+ !inthreeway, bridge_real, ast_channel_connected(owner_real), 0)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
ast_channel_name(bridge_real), ast_channel_name(owner_3way));
return -1;
char dest[256]; /* must be same length as p->dialdest */
ast_debug(1, "CALLING CID_NAME: %s CID_NUM:: %s\n",
- S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""),
- S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, ""));
+ S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, ""),
+ S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, ""));
ast_copy_string(dest, rdest, sizeof(dest));
ast_copy_string(p->dialdest, rdest, sizeof(p->dialdest));
analog_set_dialing(p, 1);
} else {
/* Call waiting call */
- if (ast->connected.id.number.valid && ast->connected.id.number.str) {
- ast_copy_string(p->callwait_num, ast->connected.id.number.str, sizeof(p->callwait_num));
+ if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
+ ast_copy_string(p->callwait_num, ast_channel_connected(ast)->id.number.str, sizeof(p->callwait_num));
} else {
p->callwait_num[0] = '\0';
}
- if (ast->connected.id.name.valid && ast->connected.id.name.str) {
- ast_copy_string(p->callwait_name, ast->connected.id.name.str, sizeof(p->callwait_name));
+ if (ast_channel_connected(ast)->id.name.valid && ast_channel_connected(ast)->id.name.str) {
+ ast_copy_string(p->callwait_name, ast_channel_connected(ast)->id.name.str, sizeof(p->callwait_name));
} else {
p->callwait_name[0] = '\0';
}
}
}
- n = ast->connected.id.name.valid ? ast->connected.id.name.str : NULL;
- l = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL;
+ n = ast_channel_connected(ast)->id.name.valid ? ast_channel_connected(ast)->id.name.str : NULL;
+ l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
if (l) {
ast_copy_string(p->lastcid_num, l, sizeof(p->lastcid_num));
} else {
switch (mysig) {
case ANALOG_SIG_FEATD:
- l = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL;
+ l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
if (l) {
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "T*%s*%s*", l, c);
} else {
}
break;
case ANALOG_SIG_FEATDMF:
- l = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL;
+ l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
if (l) {
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*00%s#*%s#", l, c);
} else {
analog_dsp_set_digitmode(p, ANALOG_DIGITMODE_DTMF);
if (ast_exists_extension(chan, ast_channel_context(chan), exten, 1,
- chan->caller.id.number.valid ? chan->caller.id.number.str : NULL)) {
+ ast_channel_caller(chan)->id.number.valid ? ast_channel_caller(chan)->id.number.str : NULL)) {
ast_channel_exten_set(chan, exten);
analog_dsp_reset_and_flush_digits(p);
res = ast_pbx_run(chan);
ast_verb(3, "Disabling Caller*ID on %s\n", ast_channel_name(chan));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
- ast_party_number_free(&chan->caller.id.number);
- ast_party_number_init(&chan->caller.id.number);
- ast_party_name_free(&chan->caller.id.name);
- ast_party_name_init(&chan->caller.id.name);
+ ast_party_number_free(&ast_channel_caller(chan)->id.number);
+ ast_party_number_init(&ast_channel_caller(chan)->id.number);
+ ast_party_name_free(&ast_channel_caller(chan)->id.name);
+ ast_party_name_init(&ast_channel_caller(chan)->id.name);
res = analog_play_tone(p, idx, ANALOG_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
goto quit;
}
} else if (!ast_canmatch_extension(chan, ast_channel_context(chan), exten, 1,
- chan->caller.id.number.valid ? chan->caller.id.number.str : NULL)
+ ast_channel_caller(chan)->id.number.valid ? ast_channel_caller(chan)->id.number.str : NULL)
&& !analog_canmatch_featurecode(exten)) {
ast_debug(1, "Can't match %s from '%s' in context %s\n", exten,
- chan->caller.id.number.valid && chan->caller.id.number.str
- ? chan->caller.id.number.str : "<Unknown Caller>",
+ ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str
+ ? ast_channel_caller(chan)->id.number.str : "<Unknown Caller>",
ast_channel_context(chan));
break;
}
cid_num[0] = '\0';
cid_name[0] = '\0';
if (p->dahditrcallerid && p->owner) {
- if (p->owner->caller.id.number.valid
- && p->owner->caller.id.number.str) {
- ast_copy_string(cid_num, p->owner->caller.id.number.str,
+ if (ast_channel_caller(p->owner)->id.number.valid
+ && ast_channel_caller(p->owner)->id.number.str) {
+ ast_copy_string(cid_num, ast_channel_caller(p->owner)->id.number.str,
sizeof(cid_num));
}
- if (p->owner->caller.id.name.valid
- && p->owner->caller.id.name.str) {
- ast_copy_string(cid_name, p->owner->caller.id.name.str,
+ if (ast_channel_caller(p->owner)->id.name.valid
+ && ast_channel_caller(p->owner)->id.name.str) {
+ ast_copy_string(cid_name, ast_channel_caller(p->owner)->id.name.str,
sizeof(cid_name));
}
}
case ANALOG_SIG_FEATDMF_TA:
switch (p->whichwink) {
case 0:
- ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->caller.ani2,
- S_COR(p->owner->caller.ani.number.valid,
- p->owner->caller.ani.number.str, ""));
+ ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", ast_channel_caller(p->owner)->ani2,
+ S_COR(ast_channel_caller(p->owner)->ani.number.valid,
+ ast_channel_caller(p->owner)->ani.number.str, ""));
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#",
- p->owner->caller.ani2,
- S_COR(p->owner->caller.ani.number.valid,
- p->owner->caller.ani.number.str, ""));
+ ast_channel_caller(p->owner)->ani2,
+ S_COR(ast_channel_caller(p->owner)->ani.number.valid,
+ ast_channel_caller(p->owner)->ani.number.str, ""));
break;
case 1:
ast_copy_string(p->dop.dialstr, p->finaldial, sizeof(p->dop.dialstr));
/*! \todo XXX Original called data can be put in a channel data store that is inherited. */
memset(&pri_redirecting, 0, sizeof(pri_redirecting));
- sig_pri_party_id_from_ast(&pri_redirecting.from, &ast->redirecting.from);
- sig_pri_party_id_from_ast(&pri_redirecting.to, &ast->redirecting.to);
- pri_redirecting.count = ast->redirecting.count;
- pri_redirecting.reason = ast_to_pri_reason(ast->redirecting.reason);
+ sig_pri_party_id_from_ast(&pri_redirecting.from, &ast_channel_redirecting(ast)->from);
+ sig_pri_party_id_from_ast(&pri_redirecting.to, &ast_channel_redirecting(ast)->to);
+ pri_redirecting.count = ast_channel_redirecting(ast)->count;
+ pri_redirecting.reason = ast_to_pri_reason(ast_channel_redirecting(ast)->reason);
pri_redirecting_update(pvt->pri->pri, pvt->call, &pri_redirecting);
}
exten[0] = 's';
exten[1] = '\0';
} else {
- ast_free(chan->dialed.number.str);
- chan->dialed.number.str = ast_strdup(exten);
+ ast_free(ast_channel_dialed(chan)->number.str);
+ ast_channel_dialed(chan)->number.str = ast_strdup(exten);
if (p->pri->append_msn_to_user_tag && p->pri->nodetype != PRI_NETWORK) {
/*
*/
snprintf(p->user_tag, sizeof(p->user_tag), "%s_%s", p->pri->initial_user_tag,
exten);
- ast_free(chan->caller.id.tag);
- chan->caller.id.tag = ast_strdup(p->user_tag);
+ ast_free(ast_channel_caller(chan)->id.tag);
+ ast_channel_caller(chan)->id.tag = ast_strdup(p->user_tag);
}
}
sig_pri_play_tone(p, -1);
ast_str_append(&msg, 0, "Channel: %s\r\n", ast_channel_name(owner));
ast_str_append(&msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(owner));
- sig_pri_event_party_id(&msg, "CallerID", &owner->connected.id);
+ sig_pri_event_party_id(&msg, "CallerID", &ast_channel_connected(owner)->id);
} else {
/*
* Since we no longer have an owner channel,
ast_mutex_unlock(&pri->lock);
retval = ast_channel_transfer_masquerade(
call_2->ast,
- &call_2->ast->connected,
+ ast_channel_connected(call_2->ast),
call_2->held,
transferee,
- &call_1->ast->connected,
+ ast_channel_connected(call_1->ast),
call_1->held);
/* Reacquire the pri->lock to hold off completion of the transfer masquerade. */
pri->pvts[chanpos]->cid_subaddr[0] = '\0';
#if defined(HAVE_PRI_SUBADDR)
if (ast_connected.id.subaddress.valid) {
- ast_party_subaddress_set(&owner->caller.id.subaddress,
+ ast_party_subaddress_set(&ast_channel_caller(owner)->id.subaddress,
&ast_connected.id.subaddress);
if (ast_connected.id.subaddress.str) {
ast_copy_string(pri->pvts[chanpos]->cid_subaddr,
ast_party_id_presentation(&ast_connected.id);
sig_pri_set_caller_id(pri->pvts[chanpos]);
- ast_party_caller_set_init(&ast_caller, &owner->caller);
+ ast_party_caller_set_init(&ast_caller, ast_channel_caller(owner));
ast_caller.id = ast_connected.id;
ast_caller.ani = ast_connected.id;
ast_channel_set_caller_event(owner, &ast_caller, NULL);
owner = pri->pvts[chanpos]->owner;
if (owner) {
sig_pri_redirecting_convert(&ast_redirecting, &subcmd->u.redirecting,
- &owner->redirecting, pri);
+ ast_channel_redirecting(owner), pri);
ast_redirecting.from.tag = ast_strdup(pri->pvts[chanpos]->user_tag);
ast_redirecting.to.tag = ast_strdup(pri->pvts[chanpos]->user_tag);
break;
}
sig_pri_redirecting_convert(&ast_redirecting, &pri_deflection,
- &owner->redirecting, pri);
+ ast_channel_redirecting(owner), pri);
ast_redirecting.from.tag = ast_strdup(pri->pvts[chanpos]->user_tag);
ast_redirecting.to.tag = ast_strdup(pri->pvts[chanpos]->user_tag);
ast_channel_set_redirecting(owner, &ast_redirecting, NULL);
/* Set Calling Subaddress */
sig_pri_lock_owner(pri, chanpos);
sig_pri_set_subaddress(
- &pri->pvts[chanpos]->owner->caller.id.subaddress,
+ &ast_channel_caller(pri->pvts[chanpos]->owner)->id.subaddress,
&e->ring.calling.subaddress);
if (!e->ring.calling.subaddress.type
&& !ast_strlen_zero(
/* Set Called Subaddress */
sig_pri_lock_owner(pri, chanpos);
sig_pri_set_subaddress(
- &pri->pvts[chanpos]->owner->dialed.subaddress,
+ &ast_channel_dialed(pri->pvts[chanpos]->owner)->subaddress,
&e->ring.called_subaddress);
if (!e->ring.called_subaddress.type
&& !ast_strlen_zero(
/* Set Calling Subaddress */
sig_pri_lock_owner(pri, chanpos);
sig_pri_set_subaddress(
- &pri->pvts[chanpos]->owner->caller.id.subaddress,
+ &ast_channel_caller(pri->pvts[chanpos]->owner)->id.subaddress,
&e->ring.calling.subaddress);
if (!e->ring.calling.subaddress.type
&& !ast_strlen_zero(
/* Set Called Subaddress */
sig_pri_lock_owner(pri, chanpos);
sig_pri_set_subaddress(
- &pri->pvts[chanpos]->owner->dialed.subaddress,
+ &ast_channel_dialed(pri->pvts[chanpos]->owner)->subaddress,
&e->ring.called_subaddress);
if (!e->ring.called_subaddress.type
&& !ast_strlen_zero(
char *opt_args[OPT_ARG_ARRAY_SIZE];
ast_debug(1, "CALLER NAME: %s NUM: %s\n",
- S_COR(ast->connected.id.name.valid, ast->connected.id.name.str, ""),
- S_COR(ast->connected.id.number.valid, ast->connected.id.number.str, ""));
+ S_COR(ast_channel_connected(ast)->id.name.valid, ast_channel_connected(ast)->id.name.str, ""),
+ S_COR(ast_channel_connected(ast)->id.number.valid, ast_channel_connected(ast)->id.number.str, ""));
if (!p->pri) {
ast_log(LOG_ERROR, "Could not find pri on channel %d\n", p->channel);
l = NULL;
n = NULL;
if (!p->hidecallerid) {
- if (ast->connected.id.number.valid) {
+ if (ast_channel_connected(ast)->id.number.valid) {
/* If we get to the end of this loop without breaking, there's no
* calleridnum. This is done instead of testing for "unknown" or
* the thousands of other ways that the calleridnum could be
* invalid. */
- for (l = ast->connected.id.number.str; l && *l; l++) {
+ for (l = ast_channel_connected(ast)->id.number.str; l && *l; l++) {
if (strchr("0123456789", *l)) {
- l = ast->connected.id.number.str;
+ l = ast_channel_connected(ast)->id.number.str;
break;
}
}
l = NULL;
}
if (!p->hidecalleridname) {
- n = ast->connected.id.name.valid ? ast->connected.id.name.str : NULL;
+ n = ast_channel_connected(ast)->id.name.valid ? ast_channel_connected(ast)->id.name.str : NULL;
}
}
snprintf(p->user_tag, sizeof(p->user_tag), "%s_%s", p->pri->initial_user_tag,
p->pri->nodetype == PRI_NETWORK
? c + p->stripmsd + dp_strip
- : S_COR(ast->connected.id.number.valid,
- ast->connected.id.number.str, ""));
+ : S_COR(ast_channel_connected(ast)->id.number.valid,
+ ast_channel_connected(ast)->id.number.str, ""));
} else {
ast_copy_string(p->user_tag, p->pri->initial_user_tag, sizeof(p->user_tag));
}
* Replace the caller id tag from the channel creation
* with the actual tag value.
*/
- ast_free(ast->caller.id.tag);
- ast->caller.id.tag = ast_strdup(p->user_tag);
+ ast_free(ast_channel_caller(ast)->id.tag);
+ ast_channel_caller(ast)->id.tag = ast_strdup(p->user_tag);
ldp_strip = 0;
prilocaldialplan = p->pri->localdialplan - 1;
}
} else if (prilocaldialplan == -1) {
/* Use the numbering plan passed in. */
- prilocaldialplan = ast->connected.id.number.plan;
+ prilocaldialplan = ast_channel_connected(ast)->id.number.plan;
}
if (l != NULL) {
while (*l > '9' && *l != '*' && *l != '#') {
}
}
pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
- p->use_callingpres ? ast->connected.id.number.presentation : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
+ p->use_callingpres ? ast_channel_connected(ast)->id.number.presentation : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
#if defined(HAVE_PRI_SUBADDR)
- if (ast->connected.id.subaddress.valid) {
+ if (ast_channel_connected(ast)->id.subaddress.valid) {
struct pri_party_subaddress subaddress;
memset(&subaddress, 0, sizeof(subaddress));
- sig_pri_party_subaddress_from_ast(&subaddress, &ast->connected.id.subaddress);
+ sig_pri_party_subaddress_from_ast(&subaddress, &ast_channel_connected(ast)->id.subaddress);
pri_sr_set_caller_subaddress(sr, &subaddress);
}
#endif /* defined(HAVE_PRI_SUBADDR) */
pri_grab(p, p->pri);
memset(&connected, 0, sizeof(connected));
- sig_pri_party_id_from_ast(&connected.id, &chan->connected.id);
+ sig_pri_party_id_from_ast(&connected.id, &ast_channel_connected(chan)->id);
/* Determine the connected line numbering plan to actually use. */
switch (p->pri->cpndialplan) {
}
if (!p->hidecallerid) {
- l = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL;
+ l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
} else {
l = NULL;
}
}
}
isup_set_calling(p->ss7call, l ? (l + calling_nai_strip) : NULL, ss7_calling_nai,
- p->use_callingpres ? cid_pres2ss7pres(ast->connected.id.number.presentation) : (l ? SS7_PRESENTATION_ALLOWED : SS7_PRESENTATION_RESTRICTED),
- p->use_callingpres ? cid_pres2ss7screen(ast->connected.id.number.presentation) : SS7_SCREENING_USER_PROVIDED);
+ p->use_callingpres ? cid_pres2ss7pres(ast_channel_connected(ast)->id.number.presentation) : (l ? SS7_PRESENTATION_ALLOWED : SS7_PRESENTATION_RESTRICTED),
+ p->use_callingpres ? cid_pres2ss7screen(ast_channel_connected(ast)->id.number.presentation) : SS7_SCREENING_USER_PROVIDED);
- isup_set_oli(p->ss7call, ast->connected.ani2);
+ isup_set_oli(p->ss7call, ast_channel_connected(ast)->ani2);
isup_init_call(p->ss7->ss7, p->ss7call, p->cic, p->dpc);
/* Set the charge number if it is set */
char blacklist[1];
int bl = 0;
- if (chan->caller.id.number.valid && chan->caller.id.number.str) {
- if (!ast_db_get("blacklist", chan->caller.id.number.str, blacklist, sizeof (blacklist)))
+ if (ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str) {
+ if (!ast_db_get("blacklist", ast_channel_caller(chan)->id.number.str, blacklist, sizeof (blacklist)))
bl = 1;
}
- if (chan->caller.id.name.valid && chan->caller.id.name.str) {
- if (!ast_db_get("blacklist", chan->caller.id.name.str, blacklist, sizeof (blacklist)))
+ if (ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str) {
+ if (!ast_db_get("blacklist", ast_channel_caller(chan)->id.name.str, blacklist, sizeof (blacklist)))
bl = 1;
}
" Use CALLERID(name-pres) or CALLERID(num-pres) instead.\n");
}
ast_copy_string(buf,
- ast_named_caller_presentation(ast_party_id_presentation(&chan->caller.id)), len);
+ ast_named_caller_presentation(ast_party_id_presentation(&ast_channel_caller(chan)->id)), len);
return 0;
}
if (pres < 0) {
ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show function CALLERPRES')\n", value);
} else {
- 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;
}
ast_channel_lock(chan);
if (member.argc == 1 && !strcasecmp("rdnis", member.argv[0])) {
- if (chan->redirecting.from.number.valid
- && chan->redirecting.from.number.str) {
- ast_copy_string(buf, chan->redirecting.from.number.str, len);
+ if (ast_channel_redirecting(chan)->from.number.valid
+ && ast_channel_redirecting(chan)->from.number.str) {
+ ast_copy_string(buf, ast_channel_redirecting(chan)->from.number.str, len);
}
} else if (!strcasecmp("dnid", member.argv[0])) {
if (member.argc == 1) {
*/
if (member.argc == 2) {
/* dnid-num */
- if (chan->dialed.number.str) {
- ast_copy_string(buf, chan->dialed.number.str, len);
+ if (ast_channel_dialed(chan)->number.str) {
+ ast_copy_string(buf, ast_channel_dialed(chan)->number.str, len);
}
} else if (member.argc == 3 && !strcasecmp("plan", member.argv[2])) {
/* dnid-num-plan */
- snprintf(buf, len, "%d", chan->dialed.number.plan);
+ snprintf(buf, len, "%d", ast_channel_dialed(chan)->number.plan);
} else {
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
}
* dnid-subaddr...
*/
status = party_subaddress_read(buf, len, member.argc - 2, member.argv + 2,
- &chan->dialed.subaddress);
+ &ast_channel_dialed(chan)->subaddress);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
}
} else if (member.argc == 1 && !strcasecmp("ani2", member.argv[0])) {
- snprintf(buf, len, "%d", chan->caller.ani2);
+ snprintf(buf, len, "%d", ast_channel_caller(chan)->ani2);
} else if (!strcasecmp("ani", member.argv[0])) {
if (member.argc == 1) {
/* Setup as if user had given ani-num instead. */
member.argv[1] = "num";
}
status = party_id_read(buf, len, member.argc - 1, member.argv + 1,
- &chan->caller.ani);
+ &ast_channel_caller(chan)->ani);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
break;
}
} else {
- status = party_id_read(buf, len, member.argc, member.argv, &chan->caller.id);
+ status = party_id_read(buf, len, member.argc, member.argv, &ast_channel_caller(chan)->id);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
ast_channel_lock(chan);
if (member.argc == 1 && !strcasecmp("rdnis", member.argv[0])) {
- chan->redirecting.from.number.valid = 1;
- ast_free(chan->redirecting.from.number.str);
- chan->redirecting.from.number.str = ast_strdup(value);
+ ast_channel_redirecting(chan)->from.number.valid = 1;
+ ast_free(ast_channel_redirecting(chan)->from.number.str);
+ ast_channel_redirecting(chan)->from.number.str = ast_strdup(value);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
} else if (!strcasecmp("dnid", member.argv[0])) {
- ast_party_dialed_set_init(&dialed, &chan->dialed);
+ ast_party_dialed_set_init(&dialed, ast_channel_dialed(chan));
if (member.argc == 1) {
/* Setup as if user had given dnid-num instead. */
member.argc = 2;
/* dnid-num */
dialed.number.str = ast_strdup(value);
ast_trim_blanks(dialed.number.str);
- ast_party_dialed_set(&chan->dialed, &dialed);
+ ast_party_dialed_set(ast_channel_dialed(chan), &dialed);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
ast_trim_blanks(val);
if (('0' <= val[0]) && (val[0] <= '9')) {
- chan->dialed.number.plan = atoi(val);
+ ast_channel_dialed(chan)->number.plan = atoi(val);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
member.argv + 2, value);
switch (status) {
case ID_FIELD_VALID:
- ast_party_dialed_set(&chan->dialed, &dialed);
+ ast_party_dialed_set(ast_channel_dialed(chan), &dialed);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
ast_trim_blanks(val);
if (('0' <= val[0]) && (val[0] <= '9')) {
- chan->caller.ani2 = atoi(val);
+ ast_channel_caller(chan)->ani2 = atoi(val);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
ast_log(LOG_ERROR, "Unknown callerid ani2 '%s', value unchanged\n", val);
}
} else if (!strcasecmp("ani", member.argv[0])) {
- ast_party_caller_set_init(&caller, &chan->caller);
+ ast_party_caller_set_init(&caller, ast_channel_caller(chan));
if (member.argc == 1) {
/* Setup as if user had given ani-num instead. */
member.argc = 2;
status = party_id_write(&caller.ani, member.argc - 1, member.argv + 1, value);
switch (status) {
case ID_FIELD_VALID:
- ast_party_caller_set(&chan->caller, &caller, NULL);
+ ast_party_caller_set(ast_channel_caller(chan), &caller, NULL);
if (ast_channel_cdr(chan)) {
ast_cdr_setcid(ast_channel_cdr(chan), chan);
}
}
ast_party_caller_free(&caller);
} else {
- ast_party_caller_set_init(&caller, &chan->caller);
+ ast_party_caller_set_init(&caller, ast_channel_caller(chan));
status = party_id_write(&caller.id, member.argc, member.argv, value);
switch (status) {
case ID_FIELD_VALID:
ast_channel_lock(chan);
if (member.argc == 1 && !strcasecmp("source", member.argv[0])) {
- ast_copy_string(buf, ast_connected_line_source_name(chan->connected.source), len);
+ ast_copy_string(buf, ast_connected_line_source_name(ast_channel_connected(chan)->source), len);
} else {
- status = party_id_read(buf, len, member.argc, member.argv, &chan->connected.id);
+ status = party_id_read(buf, len, member.argc, member.argv, &ast_channel_connected(chan)->id);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
}
ast_channel_lock(chan);
- ast_party_connected_line_set_init(&connected, &chan->connected);
+ ast_party_connected_line_set_init(&connected, ast_channel_connected(chan));
ast_channel_unlock(chan);
value = ast_skip_blanks(value);
if (!strcasecmp("from", member.argv[0])) {
status = party_id_read(buf, len, member.argc - 1, member.argv + 1,
- &chan->redirecting.from);
+ &ast_channel_redirecting(chan)->from);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
}
} else if (!strcasecmp("to", member.argv[0])) {
status = party_id_read(buf, len, member.argc - 1, member.argv + 1,
- &chan->redirecting.to);
+ &ast_channel_redirecting(chan)->to);
switch (status) {
case ID_FIELD_VALID:
case ID_FIELD_INVALID:
*/
ast_copy_string(buf,
ast_named_caller_presentation(
- ast_party_id_presentation(&chan->redirecting.from)), len);
+ ast_party_id_presentation(&ast_channel_redirecting(chan)->from)), len);
} else if (member.argc == 1 && !strcasecmp("reason", member.argv[0])) {
- ast_copy_string(buf, ast_redirecting_reason_name(chan->redirecting.reason), len);
+ ast_copy_string(buf, ast_redirecting_reason_name(ast_channel_redirecting(chan)->reason), len);
} else if (member.argc == 1 && !strcasecmp("count", member.argv[0])) {
- snprintf(buf, len, "%d", chan->redirecting.count);
+ snprintf(buf, len, "%d", ast_channel_redirecting(chan)->count);
} else {
ast_log(LOG_ERROR, "Unknown redirecting data type '%s'.\n", data);
}
}
ast_channel_lock(chan);
- ast_party_redirecting_set_init(&redirecting, &chan->redirecting);
+ ast_party_redirecting_set_init(&redirecting, ast_channel_redirecting(chan));
ast_channel_unlock(chan);
value = ast_skip_blanks(value);
if (sscanf(args.priority, "%30d", &priority_num) == 1 && priority_num > 0) {
int res;
res = ast_exists_extension(chan, args.context, args.exten, priority_num,
- 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 (res)
strcpy(buf, "1");
} else {
int res;
res = ast_findlabel_extension(chan, args.context, args.exten, args.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 (res > 0)
strcpy(buf, "1");
}
} else if (!ast_strlen_zero(args.exten)) {
int res;
res = ast_exists_extension(chan, args.context, args.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));
if (res)
strcpy(buf, "1");
} else if (!ast_strlen_zero(args.context)) {
}
if (ast_exists_extension(chan, args.context, args.extension, priority_int,
- 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_copy_string(buffer, "1", buflen);
} else {
ast_copy_string(buffer, "0", buflen);
{
struct ast_var_t *var;
int len = strlen(prefix);
- AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->varshead, var, entries) {
+ AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_varshead(chan), var, entries) {
if (strncasecmp(prefix, ast_var_name(var), len) == 0) {
AST_LIST_REMOVE_CURRENT(entries);
ast_free(var);
ast_str_set(&prefix, -1, HASH_PREFIX, data);
memset(buf, 0, len);
- AST_LIST_TRAVERSE(&chan->varshead, newvar, entries) {
+ AST_LIST_TRAVERSE(ast_channel_varshead(chan), newvar, entries) {
if (strncasecmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
/* Copy everything after the prefix */
strncat(buf, ast_var_name(newvar) + ast_str_strlen(prefix), len - strlen(buf) - 1);
ast_str_set(&prefix, -1, HASH_PREFIX, data);
- AST_LIST_TRAVERSE(&chan->varshead, newvar, entries) {
+ AST_LIST_TRAVERSE(ast_channel_varshead(chan), newvar, entries) {
if (strncasecmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
/* Copy everything after the prefix */
ast_str_append(buf, len, "%s", ast_var_name(newvar) + ast_str_strlen(prefix));
for (i = 0; i < ARRAY_LEN(test_args); i++) {
struct ast_var_t *var = ast_var_assign("FIELDS", test_args[i].fields);
- AST_LIST_INSERT_HEAD(&chan->varshead, var, entries);
+ AST_LIST_INSERT_HEAD(ast_channel_varshead(chan), var, entries);
snprintf(expression, sizeof(expression), "${FIELDNUM(%s,%s,%s)}", var->name, test_args[i].delim, test_args[i].field);
ast_str_substitute_variables(&str, 0, chan, expression);
- AST_LIST_REMOVE(&chan->varshead, var, entries);
+ AST_LIST_REMOVE(ast_channel_varshead(chan), var, entries);
ast_var_delete(var);
if (strcasecmp(ast_str_buffer(str), test_args[i].expected)) {
char tmp[512], tmp2[512] = "";
struct ast_var_t *var = ast_var_assign("test_string", test_strings[i][0]);
- AST_LIST_INSERT_HEAD(&chan->varshead, var, entries);
+ AST_LIST_INSERT_HEAD(ast_channel_varshead(chan), var, entries);
if (test_strings[i][3]) {
snprintf(tmp, sizeof(tmp), "${STRREPLACE(%s,%s,%s,%s)}", "test_string", test_strings[i][1], test_strings[i][2], test_strings[i][3]);
switch (*data) {
case 'a':
case 'A':
- if (ast_tvzero(chan->whentohangup)) {
+ if (ast_tvzero(*ast_channel_whentohangup(chan))) {
ast_copy_string(buf, "0", len);
} else {
myt = ast_tvnow();
- snprintf(buf, len, "%.3f", ast_tvdiff_ms(chan->whentohangup, myt) / 1000.0);
+ snprintf(buf, len, "%.3f", ast_tvdiff_ms(*ast_channel_whentohangup(chan), myt) / 1000.0);
}
break;
case 'a':
case 'A':
ast_channel_setwhentohangup_tv(chan, when);
- if (!ast_tvzero(chan->whentohangup)) {
+ if (!ast_tvzero(*ast_channel_whentohangup(chan))) {
when = ast_tvadd(when, ast_tvnow());
ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
ast_localtime(&when, &myt, NULL));
T38_STATE_NEGOTIATED, /*!< T38 established */
};
+AST_LIST_HEAD_NOLOCK(ast_datastore_list, ast_datastore);
+AST_LIST_HEAD_NOLOCK(ast_autochan_list, ast_autochan);
+AST_LIST_HEAD_NOLOCK(ast_readq_list, ast_frame);
+
/*!
* \page AstChannel ast_channel locking and reference tracking
*
AST_STRING_FIELD(__do_not_use_dialcontext); /*!< Dial: Extension context that we were called from */
);
- struct timeval whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */
+ struct timeval __do_not_use_whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */
pthread_t blocker; /*!< If anyone is blocking, this is them */
/*!
* \note Set on incoming channels to indicate the originally dialed party.
* \note Dialed Number Identifier (DNID)
*/
- struct ast_party_dialed dialed;
+ struct ast_party_dialed __do_not_use_dialed;
/*!
* \brief Channel Caller ID information.
* \note The caller id information is the caller id of this
* channel when it is used to initiate a call.
*/
- struct ast_party_caller caller;
+ struct ast_party_caller __do_not_use_caller;
/*!
* \brief Channel Connected Line ID information.
* \note The connected line information identifies the channel
* connected/bridged to this channel.
*/
- struct ast_party_connected_line connected;
+ struct ast_party_connected_line __do_not_use_connected;
/*! \brief Redirecting/Diversion information */
- struct ast_party_redirecting redirecting;
+ struct ast_party_redirecting __do_not_use_redirecting;
- struct ast_frame dtmff; /*!< DTMF frame */
- struct varshead varshead; /*!< A linked list for channel variables. See \ref AstChanVar */
+ struct ast_frame __do_not_use_dtmff; /*!< DTMF frame */
+ struct varshead __do_not_use_varshead; /*!< A linked list for channel variables. See \ref AstChanVar */
ast_group_t callgroup; /*!< Call group for call pickups */
ast_group_t pickupgroup; /*!< Pickup group - which calls groups can be picked up? */
- AST_LIST_HEAD_NOLOCK(, ast_frame) readq;
- struct ast_jb jb; /*!< The jitterbuffer state */
- struct timeval dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */
- AST_LIST_HEAD_NOLOCK(datastores, ast_datastore) datastores; /*!< Data stores on the channel */
- AST_LIST_HEAD_NOLOCK(autochans, ast_autochan) autochans; /*!< Autochans on the channel */
-
+ struct ast_readq_list __do_not_use_readq;
+ struct ast_jb __do_not_use_jb; /*!< The jitterbuffer state */
+ struct timeval __do_not_use_dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */
+ struct ast_datastore_list __do_not_use_datastores; /*!< Data stores on the channel */
+ struct ast_autochan_list __do_not_use_autochans; /*!< Autochans on the channel */
unsigned long __do_not_use_insmpl; /*!< Track the read/written samples for monitor use */
unsigned long __do_not_use_outsmpl; /*!< Track the read/written samples for monitor use */
struct ast_format *ast_channel_readformat(struct ast_channel *chan);
struct ast_format *ast_channel_writeformat(struct ast_channel *chan);
+/* Other struct getters */
+struct ast_frame *ast_channel_dtmff(struct ast_channel *chan);
+struct ast_jb *ast_channel_jb(struct ast_channel *chan);
+struct ast_party_caller *ast_channel_caller(struct ast_channel *chan);
+struct ast_party_connected_line *ast_channel_connected(struct ast_channel *chan);
+struct ast_party_dialed *ast_channel_dialed(struct ast_channel *chan);
+struct ast_party_redirecting *ast_channel_redirecting(struct ast_channel *chan);
+struct timeval *ast_channel_dtmf_tv(struct ast_channel *chan);
+struct timeval *ast_channel_whentohangup(struct ast_channel *chan);
+struct varshead *ast_channel_varshead(struct ast_channel *chan);
+
+/* Other struct setters */
+void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value);
+void ast_channel_connected_set(struct ast_channel *chan, struct ast_party_connected_line *value);
+void ast_channel_dialed_set(struct ast_channel *chan, struct ast_party_dialed *value);
+void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redirecting *value);
+void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value);
+void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value);
+
+/* List getters */
+struct ast_datastore_list *ast_channel_datastores(struct ast_channel *chan);
+struct ast_autochan_list *ast_channel_autochans(struct ast_channel *chan);
+struct ast_readq_list *ast_channel_readq(struct ast_channel *chan);
#endif /* _ASTERISK_CHANNEL_H */
#undef MAX
#define MAX(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a < __b) ? __b : __a);})
+#define SWAP(a,b) do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+
/*!
* \brief Encode data in base64
* \param dst the destination buffer