[asterisk-commits] twilson: trunk r354968 - in /trunk: addons/ apps/ bridges/ channels/ funcs/ i...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 13 11:27:29 CST 2012
Author: twilson
Date: Mon Feb 13 11:27:06 2012
New Revision: 354968
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=354968
Log:
Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/
Modified:
trunk/addons/chan_mobile.c
trunk/addons/chan_ooh323.c
trunk/apps/app_chanspy.c
trunk/apps/app_confbridge.c
trunk/apps/app_dial.c
trunk/apps/app_directed_pickup.c
trunk/apps/app_directory.c
trunk/apps/app_dumpchan.c
trunk/apps/app_fax.c
trunk/apps/app_macro.c
trunk/apps/app_meetme.c
trunk/apps/app_minivm.c
trunk/apps/app_osplookup.c
trunk/apps/app_parkandannounce.c
trunk/apps/app_queue.c
trunk/apps/app_readexten.c
trunk/apps/app_rpt.c
trunk/apps/app_stack.c
trunk/apps/app_talkdetect.c
trunk/apps/app_verbose.c
trunk/apps/app_voicemail.c
trunk/apps/app_while.c
trunk/bridges/bridge_builtin_features.c
trunk/channels/chan_agent.c
trunk/channels/chan_alsa.c
trunk/channels/chan_dahdi.c
trunk/channels/chan_gtalk.c
trunk/channels/chan_h323.c
trunk/channels/chan_iax2.c
trunk/channels/chan_jingle.c
trunk/channels/chan_local.c
trunk/channels/chan_mgcp.c
trunk/channels/chan_misdn.c
trunk/channels/chan_nbs.c
trunk/channels/chan_oss.c
trunk/channels/chan_phone.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_unistim.c
trunk/channels/chan_vpb.cc
trunk/channels/sig_analog.c
trunk/channels/sig_pri.c
trunk/funcs/func_channel.c
trunk/funcs/func_dialplan.c
trunk/include/asterisk/channel.h
trunk/main/ccss.c
trunk/main/cdr.c
trunk/main/cel.c
trunk/main/channel.c
trunk/main/channel_internal_api.c
trunk/main/cli.c
trunk/main/dial.c
trunk/main/features.c
trunk/main/file.c
trunk/main/manager.c
trunk/main/pbx.c
trunk/pbx/pbx_dundi.c
trunk/pbx/pbx_lua.c
trunk/pbx/pbx_realtime.c
trunk/res/res_agi.c
trunk/res/res_calendar.c
trunk/res/res_fax.c
trunk/res/snmp/agent.c
trunk/tests/test_substitution.c
Modified: trunk/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_mobile.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/addons/chan_mobile.c (original)
+++ trunk/addons/chan_mobile.c Mon Feb 13 11:27:06 2012
@@ -3586,7 +3586,7 @@
return -1;
}
- strcpy(chan->exten, "sms");
+ ast_channel_exten_set(chan, "sms");
pbx_builtin_setvar_helper(chan, "SMSSRC", from_number);
pbx_builtin_setvar_helper(chan, "SMSTXT", text);
@@ -3970,7 +3970,7 @@
ast_channel_set_fd(chan, 0, pvt->sco_socket);
- ast_copy_string(chan->exten, "s", AST_MAX_EXTENSION);
+ ast_channel_exten_set(chan, "s");
if (ast_pbx_start(chan)) {
ast_log(LOG_ERROR, "[%s] unable to start pbx on incoming call\n", pvt->id);
ast_hangup(chan);
Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Mon Feb 13 11:27:06 2012
@@ -436,8 +436,8 @@
/* Notify the module monitors that use count for resource has changed*/
ast_update_use_count();
- ast_copy_string(ch->context, i->context, sizeof(ch->context));
- ast_copy_string(ch->exten, i->exten, sizeof(ch->exten));
+ ast_channel_context_set(ch, i->context);
+ ast_channel_exten_set(ch, i->exten);
ch->priority = 1;
@@ -4640,12 +4640,12 @@
p->faxdetected = 1;
ooRequestChangeMode(p->callToken, 1);
} else if ((dfr->subclass.integer == 'f') && !p->faxdetected) {
- const char *target_context = S_OR(p->owner->macrocontext, p->owner->context);
- if ((strcmp(p->owner->exten, "fax")) &&
+ 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)))) {
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", p->owner->exten);
+ pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
}
@@ -4718,12 +4718,12 @@
if ((p->faxdetect & FAXDETECT_T38) && !p->faxdetected) {
const char *target_context;
ast_debug(1, "* Detected T.38 Request\n");
- target_context = S_OR(p->owner->macrocontext, p->owner->context);
- if ((strcmp(p->owner->exten, "fax")) &&
+ 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)))) {
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", p->owner->exten);
+ pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", ast_channel_exten(p->owner));
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
}
Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Mon Feb 13 11:27:06 2012
@@ -779,10 +779,10 @@
ast_channel_lock(chan);
if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT"))) {
ast_copy_string(exitcontext, c, sizeof(exitcontext));
- } else if (!ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
+ } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_copy_string(exitcontext, ast_channel_macrocontext(chan), sizeof(exitcontext));
} else {
- ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
+ ast_copy_string(exitcontext, ast_channel_context(chan), sizeof(exitcontext));
}
ast_channel_unlock(chan);
}
@@ -1186,7 +1186,7 @@
args.context = ptr;
}
if (ast_strlen_zero(args.context))
- args.context = ast_strdupa(chan->context);
+ args.context = ast_strdupa(ast_channel_context(chan));
if (args.options) {
char *opts[OPT_ARG_ARRAY_SIZE];
Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Feb 13 11:27:06 2012
@@ -1727,15 +1727,15 @@
ast_channel_lock(bridge_channel->chan);
/*save off*/
- exten = ast_strdupa(bridge_channel->chan->exten);
- context = ast_strdupa(bridge_channel->chan->context);
+ exten = ast_strdupa(ast_channel_exten(bridge_channel->chan));
+ context = ast_strdupa(ast_channel_context(bridge_channel->chan));
priority = bridge_channel->chan->priority;
pbx = bridge_channel->chan->pbx;
bridge_channel->chan->pbx = NULL;
/*set new*/
- ast_copy_string(bridge_channel->chan->exten, menu_action->data.dialplan_args.exten, sizeof(bridge_channel->chan->exten));
- ast_copy_string(bridge_channel->chan->context, menu_action->data.dialplan_args.context, sizeof(bridge_channel->chan->context));
+ ast_channel_exten_set(bridge_channel->chan, menu_action->data.dialplan_args.exten);
+ ast_channel_context_set(bridge_channel->chan, menu_action->data.dialplan_args.context);
bridge_channel->chan->priority = menu_action->data.dialplan_args.priority;
ast_channel_unlock(bridge_channel->chan);
@@ -1746,8 +1746,8 @@
/*restore*/
ast_channel_lock(bridge_channel->chan);
- ast_copy_string(bridge_channel->chan->exten, exten, sizeof(bridge_channel->chan->exten));
- ast_copy_string(bridge_channel->chan->context, context, sizeof(bridge_channel->chan->context));
+ ast_channel_exten_set(bridge_channel->chan, exten);
+ ast_channel_context_set(bridge_channel->chan, context);
bridge_channel->chan->priority = priority;
bridge_channel->chan->pbx = pbx;
Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Mon Feb 13 11:27:06 2012
@@ -763,10 +763,10 @@
if (!ast_goto_if_exists(chan, context, rexten, pri))
return 1;
} else {
- if (!ast_goto_if_exists(chan, chan->context, rexten, pri))
+ if (!ast_goto_if_exists(chan, ast_channel_context(chan), rexten, pri))
return 1;
- else if (!ast_strlen_zero(chan->macrocontext)) {
- if (!ast_goto_if_exists(chan, chan->macrocontext, rexten, pri))
+ else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ if (!ast_goto_if_exists(chan, ast_channel_macrocontext(chan), rexten, pri))
return 1;
}
}
@@ -780,8 +780,8 @@
const char *exten;
ast_channel_lock(chan);
- context = ast_strdupa(S_OR(chan->macrocontext, chan->context));
- exten = ast_strdupa(S_OR(chan->macroexten, chan->exten));
+ context = ast_strdupa(S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)));
+ exten = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));
ast_channel_unlock(chan);
return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : "";
@@ -852,7 +852,7 @@
if (ast_strlen_zero(forward_context)) {
forward_context = NULL;
}
- snprintf(tmpchan, sizeof(tmpchan), "%s@%s", ast_channel_call_forward(c), forward_context ? forward_context : c->context);
+ snprintf(tmpchan, sizeof(tmpchan), "%s@%s", ast_channel_call_forward(c), forward_context ? forward_context : ast_channel_context(c));
ast_channel_unlock(c);
stuff = tmpchan;
tech = "Local";
@@ -912,7 +912,7 @@
ast_party_number_init(&c->redirecting.from.number);
c->redirecting.from.number.valid = 1;
c->redirecting.from.number.str =
- ast_strdup(S_OR(in->macroexten, in->exten));
+ ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in)));
}
c->dialed.transit_network_select = in->dialed.transit_network_select;
@@ -945,8 +945,8 @@
ast_channel_accountcode_set(c, ast_channel_accountcode(in));
- c->appl = "AppDial";
- c->data = "(Outgoing Line)";
+ ast_channel_appl_set(c, "AppDial");
+ ast_channel_data_set(c, "(Outgoing Line)");
/*
* We must unlock c before calling ast_channel_redirecting_macro, because
* we put c into autoservice there. That is pretty much a guaranteed
@@ -1134,7 +1134,7 @@
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
DIAL_NOFORWARDHTML);
ast_channel_dialcontext_set(c, "");
- ast_copy_string(c->exten, "", sizeof(c->exten));
+ ast_channel_exten_set(c, "");
}
continue;
}
@@ -1208,7 +1208,7 @@
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
DIAL_NOFORWARDHTML);
ast_channel_dialcontext_set(c, "");
- ast_copy_string(c->exten, "", sizeof(c->exten));
+ ast_channel_exten_set(c, "");
if (CAN_EARLY_BRIDGE(peerflags, in, peer))
/* Setup early bridge if appropriate */
ast_channel_early_bridge(in, peer);
@@ -1729,7 +1729,7 @@
}
ast_verb(3, "Privacy-- callerid is empty\n");
- snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam);
+ snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", ast_channel_exten(chan), tnam);
l = callerid;
pa->privdb_val = AST_PRIVACY_UNKNOWN;
}
@@ -1999,7 +1999,7 @@
if (ast_test_flag64(&opts, OPT_FORCECLID)) {
if (ast_strlen_zero(opt_args[OPT_ARG_FORCECLID])) {
ast_channel_lock(chan);
- forced_clid.number.str = ast_strdupa(S_OR(chan->macroexten, chan->exten));
+ forced_clid.number.str = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));
ast_channel_unlock(chan);
forced_clid_name[0] = '\0';
forced_clid.name.str = (char *) get_cid_name(forced_clid_name,
@@ -2076,7 +2076,7 @@
stored_clid.name.valid = 1;
}
ast_channel_lock(chan);
- stored_clid.number.str = ast_strdupa(S_OR(chan->macroexten, chan->exten));
+ stored_clid.number.str = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));
stored_clid.number.valid = 1;
ast_channel_unlock(chan);
}
@@ -2084,7 +2084,7 @@
if (ast_test_flag64(&opts, OPT_RESETCDR) && chan->cdr)
ast_cdr_reset(chan->cdr, NULL);
if (ast_test_flag64(&opts, OPT_PRIVACY) && ast_strlen_zero(opt_args[OPT_ARG_PRIVACY]))
- opt_args[OPT_ARG_PRIVACY] = ast_strdupa(chan->exten);
+ opt_args[OPT_ARG_PRIVACY] = ast_strdupa(ast_channel_exten(chan));
if (ast_test_flag64(&opts, OPT_PRIVACY) || ast_test_flag64(&opts, OPT_SCREENING)) {
res = setup_privacy_args(&pa, &opts, opt_args, chan);
@@ -2246,8 +2246,8 @@
ast_channel_inherit_variables(chan, tc);
ast_channel_datastore_inherit(chan, tc);
- tc->appl = "AppDial";
- tc->data = "(Outgoing Line)";
+ ast_channel_appl_set(tc, "AppDial");
+ ast_channel_data_set(tc, "(Outgoing Line)");
memset(&tc->whentohangup, 0, sizeof(tc->whentohangup));
/* Determine CallerID to store in outgoing channel. */
@@ -2328,11 +2328,11 @@
/* Inherit context and extension */
- ast_channel_dialcontext_set(tc, ast_strlen_zero(chan->macrocontext) ? chan->context : chan->macrocontext);
- if (!ast_strlen_zero(chan->macroexten))
- ast_copy_string(tc->exten, chan->macroexten, sizeof(tc->exten));
+ ast_channel_dialcontext_set(tc, ast_strlen_zero(ast_channel_macrocontext(chan)) ? ast_channel_context(chan) : ast_channel_macrocontext(chan));
+ if (!ast_strlen_zero(ast_channel_macroexten(chan)))
+ ast_channel_exten_set(tc, ast_channel_macroexten(chan));
else
- ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
+ ast_channel_exten_set(tc, ast_channel_exten(chan));
ast_channel_unlock(tc);
ast_channel_unlock(chan);
@@ -2561,8 +2561,8 @@
replace_macro_delimiter(opt_args[OPT_ARG_GOTO]);
ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
/* peer goes to the same context and extension as chan, so just copy info from chan*/
- ast_copy_string(peer->context, chan->context, sizeof(peer->context));
- ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
+ ast_channel_context_set(peer, ast_channel_context(chan));
+ ast_channel_exten_set(peer, ast_channel_exten(chan));
peer->priority = chan->priority + 2;
ast_pbx_start(peer);
hanguptree(outgoing, NULL, ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0);
@@ -2586,8 +2586,8 @@
if (theapp && !res) { /* XXX why check res here ? */
/* Set peer->exten and peer->context so that MACRO_EXTEN and MACRO_CONTEXT get set */
- ast_copy_string(peer->context, chan->context, sizeof(peer->context));
- ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
+ ast_channel_context_set(peer, ast_channel_context(chan));
+ ast_channel_exten_set(peer, ast_channel_exten(chan));
replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_MACRO]);
res = pbx_exec(peer, theapp, opt_args[OPT_ARG_CALLEE_MACRO]);
@@ -2657,8 +2657,8 @@
replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GOSUB]);
/* Set where we came from */
- ast_copy_string(peer->context, "app_dial_gosub_virtual_context", sizeof(peer->context));
- ast_copy_string(peer->exten, "s", sizeof(peer->exten));
+ ast_channel_context_set(peer, "app_dial_gosub_virtual_context");
+ ast_channel_exten_set(peer, "s");
peer->priority = 0;
gosub_argstart = strchr(opt_args[OPT_ARG_CALLEE_GOSUB], ',');
@@ -2828,21 +2828,21 @@
res = ast_bridge_call(chan, peer, &config);
}
- strcpy(peer->context, chan->context);
+ ast_channel_context_set(peer, ast_channel_context(chan));
if (ast_test_flag64(&opts, OPT_PEER_H)
- && ast_exists_extension(peer, peer->context, "h", 1,
+ && ast_exists_extension(peer, ast_channel_context(peer), "h", 1,
S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) {
int autoloopflag;
int found;
int res9;
- strcpy(peer->exten, "h");
+ ast_channel_exten_set(peer, "h");
peer->priority = 1;
autoloopflag = ast_test_flag(peer, AST_FLAG_IN_AUTOLOOP); /* save value to restore at the end */
ast_set_flag(peer, AST_FLAG_IN_AUTOLOOP);
- while ((res9 = ast_spawn_extension(peer, peer->context, peer->exten,
+ while ((res9 = ast_spawn_extension(peer, ast_channel_context(peer), ast_channel_exten(peer),
peer->priority,
S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL),
&found, 1)) == 0) {
@@ -2851,8 +2851,8 @@
if (found && res9) {
/* Something bad happened, or a hangup has been requested. */
- ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, ast_channel_name(peer));
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, ast_channel_name(peer));
+ ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", ast_channel_context(peer), ast_channel_exten(peer), peer->priority, ast_channel_name(peer));
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", ast_channel_context(peer), ast_channel_exten(peer), peer->priority, ast_channel_name(peer));
}
ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP); /* set it back the way it was */
}
@@ -2862,7 +2862,7 @@
ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
} else { /* F() */
int res;
- res = ast_goto_if_exists(peer, chan->context, chan->exten, (chan->priority) + 1);
+ res = ast_goto_if_exists(peer, ast_channel_context(chan), ast_channel_exten(chan), (chan->priority) + 1);
if (res == AST_PBX_GOTO_FAILED) {
ast_hangup(peer);
goto out;
@@ -2976,7 +2976,7 @@
while (loops) {
int continue_exec;
- chan->data = "Retrying";
+ ast_channel_data_set(chan, "Retrying");
if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan);
Modified: trunk/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_directed_pickup.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_directed_pickup.c (original)
+++ trunk/apps/app_directed_pickup.c Mon Feb 13 11:27:06 2012
@@ -288,7 +288,7 @@
return -1;
}
} else {
- if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : chan->context)) {
+ if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : ast_channel_context(chan))) {
/* Pickup successful. Stop the dialplan this channel is a zombie. */
return -1;
}
Modified: trunk/apps/app_directory.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_directory.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Mon Feb 13 11:27:06 2012
@@ -248,9 +248,9 @@
static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext)
{
- if (!ast_goto_if_exists(chan, S_OR(dialcontext, chan->context), ext, 1) ||
- (!ast_strlen_zero(chan->macrocontext) &&
- !ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) {
+ if (!ast_goto_if_exists(chan, S_OR(dialcontext, ast_channel_context(chan)), ext, 1) ||
+ (!ast_strlen_zero(ast_channel_macrocontext(chan)) &&
+ !ast_goto_if_exists(chan, ast_channel_macrocontext(chan), ext, 1))) {
return 0;
} else {
ast_log(LOG_WARNING, "Can't find extension '%s' in current context. "
@@ -292,7 +292,7 @@
if (ast_test_flag(flags, OPT_FROMVOICEMAIL)) {
/* We still want to set the exten though */
- ast_copy_string(chan->exten, item->exten, sizeof(chan->exten));
+ ast_channel_exten_set(chan, item->exten);
} else if (ast_goto_if_exists(chan, S_OR(dialcontext, item->context), item->exten, 1)) {
ast_log(LOG_WARNING,
"Can't find extension '%s' in context '%s'. "
Modified: trunk/apps/app_dumpchan.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dumpchan.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Mon Feb 13 11:27:06 2012
@@ -160,14 +160,14 @@
sec,
c->_bridge ? ast_channel_name(c->_bridge) : "<none>",
ast_bridged_channel(c) ? ast_channel_name(ast_bridged_channel(c)) : "<none>",
- c->context,
- c->exten,
+ ast_channel_context(c),
+ ast_channel_exten(c),
c->priority,
ast_print_group(cgrp, sizeof(cgrp), c->callgroup),
ast_print_group(pgrp, sizeof(pgrp), c->pickupgroup),
- c->appl ? c->appl : "(N/A)",
- c->data ? S_OR(c->data, "(Empty)") : "(None)",
- (ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
+ ast_channel_appl(c) ? ast_channel_appl(c) : "(N/A)",
+ ast_channel_data(c) ? S_OR(ast_channel_data(c), "(Empty)") : "(None)",
+ (ast_test_flag(c, AST_FLAG_BLOCKING) ? ast_channel_blockproc(c) : "(Not Blocking)"));
return 0;
}
Modified: trunk/apps/app_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_fax.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Mon Feb 13 11:27:06 2012
@@ -266,7 +266,7 @@
"TransferRate: %d\r\n"
"FileName: %s\r\n",
ast_channel_name(s->chan),
- s->chan->exten,
+ 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, ""),
Modified: trunk/apps/app_macro.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_macro.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_macro.c (original)
+++ trunk/apps/app_macro.c Mon Feb 13 11:27:06 2012
@@ -280,7 +280,7 @@
}
/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
- if (strcmp(chan->exten, "h") == 0)
+ if (strcmp(ast_channel_exten(chan), "h") == 0)
pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
if ((inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP"))) {
@@ -306,7 +306,7 @@
if (!ast_exists_extension(chan, fullmacro, "s", 1,
S_COR(chan->caller.id.number.valid, chan->caller.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, chan->exten, chan->context);
+ 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
ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
return 0;
@@ -330,11 +330,11 @@
/* Save old info */
oldpriority = chan->priority;
- ast_copy_string(oldexten, chan->exten, sizeof(oldexten));
- ast_copy_string(oldcontext, chan->context, sizeof(oldcontext));
- if (ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(chan->macrocontext, chan->context, sizeof(chan->macrocontext));
- ast_copy_string(chan->macroexten, chan->exten, sizeof(chan->macroexten));
+ ast_copy_string(oldexten, ast_channel_exten(chan), sizeof(oldexten));
+ ast_copy_string(oldcontext, ast_channel_context(chan), sizeof(oldcontext));
+ if (ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_channel_macrocontext_set(chan, ast_channel_context(chan));
+ ast_channel_macroexten_set(chan, ast_channel_exten(chan));
chan->macropriority = chan->priority;
setmacrocontext=1;
}
@@ -356,9 +356,8 @@
pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
/* Setup environment for new run */
- chan->exten[0] = 's';
- chan->exten[1] = '\0';
- ast_copy_string(chan->context, fullmacro, sizeof(chan->context));
+ ast_channel_exten_set(chan, "s");
+ ast_channel_context_set(chan, fullmacro);
chan->priority = 1;
ast_channel_lock(chan);
@@ -376,7 +375,7 @@
ast_channel_unlock(chan);
autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
- while (ast_exists_extension(chan, chan->context, chan->exten, chan->priority,
+ while (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), chan->priority,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
struct ast_context *c;
struct ast_exten *e;
@@ -389,11 +388,11 @@
ast_log(LOG_WARNING, "Failed to lock contexts list\n");
} else {
for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {
- if (!strcmp(ast_get_context_name(c), chan->context)) {
+ if (!strcmp(ast_get_context_name(c), ast_channel_context(chan))) {
if (ast_rdlock_context(c)) {
ast_log(LOG_WARNING, "Unable to lock context?\n");
} else {
- e = find_matching_priority(c, chan->exten, chan->priority,
+ e = find_matching_priority(c, ast_channel_exten(chan), chan->priority,
S_COR(chan->caller.id.number.valid, chan->caller.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));
@@ -410,7 +409,7 @@
/* Reset the macro depth, if it was changed in the last iteration */
pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
- res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority,
+ res = ast_spawn_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), chan->priority,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL),
&foundx, 1);
if (res) {
@@ -426,8 +425,8 @@
res = 0;
goto out;
default:
- ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, ast_channel_name(chan), macro);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, ast_channel_name(chan), macro);
+ ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", ast_channel_context(chan), ast_channel_exten(chan), chan->priority, ast_channel_name(chan), macro);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", ast_channel_context(chan), ast_channel_exten(chan), chan->priority, ast_channel_name(chan), macro);
goto out;
}
}
@@ -493,14 +492,14 @@
}
}
- if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
+ if (gosub_level == 0 && strcasecmp(ast_channel_context(chan), fullmacro)) {
ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", ast_channel_name(chan), macro);
break;
}
/* don't stop executing extensions when we're in "h" */
if (ast_check_hangup(chan) && !inhangup) {
- ast_debug(1, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n", chan->exten, chan->macroexten, chan->priority);
+ ast_debug(1, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n", ast_channel_exten(chan), ast_channel_macroexten(chan), chan->priority);
goto out;
}
chan->priority++;
@@ -538,23 +537,23 @@
ast_free(save_macro_priority);
if (setmacrocontext) {
- chan->macrocontext[0] = '\0';
- chan->macroexten[0] = '\0';
+ ast_channel_macrocontext_set(chan, "");
+ ast_channel_macroexten_set(chan, "");
chan->macropriority = 0;
}
- if (!strcasecmp(chan->context, fullmacro)) {
+ if (!strcasecmp(ast_channel_context(chan), fullmacro)) {
const char *offsets;
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
- ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
- ast_copy_string(chan->exten, oldexten, sizeof(chan->exten));
+ ast_channel_context_set(chan, oldcontext);
+ ast_channel_exten_set(chan, oldexten);
if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
/* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
normally if there is any problem */
if (sscanf(offsets, "%30d", &offset) == 1) {
- if (ast_exists_extension(chan, chan->context, chan->exten,
+ if (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan),
chan->priority + offset + 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
chan->priority += offset;
Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Mon Feb 13 11:27:06 2012
@@ -2592,10 +2592,10 @@
ast_channel_lock(chan);
if ((tmpvar = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) {
ast_copy_string(exitcontext, tmpvar, sizeof(exitcontext));
- } else if (!ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
+ } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_copy_string(exitcontext, ast_channel_macrocontext(chan), sizeof(exitcontext));
} else {
- ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
+ ast_copy_string(exitcontext, ast_channel_context(chan), sizeof(exitcontext));
}
ast_channel_unlock(chan);
}
Modified: trunk/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_minivm.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_minivm.c (original)
+++ trunk/apps/app_minivm.c Mon Feb 13 11:27:06 2012
@@ -1942,9 +1942,9 @@
/* "Mailbox:domain:macrocontext:exten:priority:callerchan:callerid:origdate:origtime:duration:durationstatus:accountcode" */
"%s:%s:%s:%s:%d:%s:%s:%s:%s:%d:%s:%s\n",
username,
- chan->context,
- chan->macrocontext,
- chan->exten,
+ ast_channel_context(chan),
+ ast_channel_macrocontext(chan),
+ ast_channel_exten(chan),
chan->priority,
ast_channel_name(chan),
callerid,
@@ -2308,13 +2308,13 @@
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ouseexten = 1;
}
- } else if (ast_exists_extension(chan, chan->context, "o", 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))) {
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ouseexten = 1;
}
- else if (!ast_strlen_zero(chan->macrocontext)
- && ast_exists_extension(chan, chan->macrocontext, "o", 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))) {
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ousemacro = 1;
@@ -2326,11 +2326,11 @@
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
}
- } else if (ast_exists_extension(chan, chan->context, "a", 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))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
- } else if (!ast_strlen_zero(chan->macrocontext)
- && ast_exists_extension(chan, chan->macrocontext, "a", 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))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
ausemacro = 1;
@@ -2371,24 +2371,22 @@
/* Check for a '*' here in case the caller wants to escape from voicemail to something
other than the operator -- an automated attendant or mailbox login for example */
if (res == '*') {
- chan->exten[0] = 'a';
- chan->exten[1] = '\0';
+ ast_channel_exten_set(chan, "a");
if (!ast_strlen_zero(vmu->exit)) {
- ast_copy_string(chan->context, vmu->exit, sizeof(chan->context));
- } else if (ausemacro && !ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(chan->context, chan->macrocontext, sizeof(chan->context));
+ ast_channel_context_set(chan, vmu->exit);
+ } else if (ausemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_channel_context_set(chan, ast_channel_macrocontext(chan));
}
chan->priority = 0;
pbx_builtin_setvar_helper(chan, "MVM_GREET_STATUS", "USEREXIT");
res = 0;
} else if (res == '0') { /* Check for a '0' here */
if(ouseexten || ousemacro) {
- chan->exten[0] = 'o';
- chan->exten[1] = '\0';
+ ast_channel_exten_set(chan, "o");
if (!ast_strlen_zero(vmu->exit)) {
- ast_copy_string(chan->context, vmu->exit, sizeof(chan->context));
- } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(chan->context, chan->macrocontext, sizeof(chan->context));
+ ast_channel_context_set(chan, vmu->exit);
+ } else if (ousemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_channel_context_set(chan, ast_channel_macrocontext(chan));
}
ast_play_and_wait(chan, "transfer");
chan->priority = 0;
Modified: trunk/apps/app_osplookup.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_osplookup.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_osplookup.c (original)
+++ trunk/apps/app_osplookup.c Mon Feb 13 11:27:06 2012
@@ -2296,7 +2296,7 @@
res = osp_auth(provider, &handle, source,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL),
- chan->exten, token, &timelimit);
+ ast_channel_exten(chan), token, &timelimit);
if (res > 0) {
status = AST_OSP_SUCCESS;
} else {
Modified: trunk/apps/app_parkandannounce.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_parkandannounce.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_parkandannounce.c (original)
+++ trunk/apps/app_parkandannounce.c Mon Feb 13 11:27:06 2012
@@ -141,10 +141,10 @@
ast_parseable_goto(chan, args.return_context);
}
- ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten,
+ ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", ast_channel_context(chan), ast_channel_exten(chan),
chan->priority,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""));
- if (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority,
+ if (!ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), chan->priority,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
}
Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=354968&r1=354967&r2=354968
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Feb 13 11:27:06 2012
@@ -3173,8 +3173,8 @@
if (qe->cancel_answered_elsewhere) {
ast_set_flag(tmp->chan, AST_FLAG_ANSWERED_ELSEWHERE);
}
- tmp->chan->appl = "AppQueue";
- tmp->chan->data = "(Outgoing Line)";
+ ast_channel_appl_set(tmp->chan, "AppQueue");
+ ast_channel_data_set(tmp->chan, "(Outgoing Line)");
memset(&tmp->chan->whentohangup, 0, sizeof(tmp->chan->whentohangup));
/* If the new channel has no callerid, try to guess what it should be */
@@ -3188,8 +3188,8 @@
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(S_OR(qe->chan->macroexten, qe->chan->exten))) {
- ast_set_callerid(tmp->chan, S_OR(qe->chan->macroexten, qe->chan->exten), 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;
}
@@ -3209,12 +3209,12 @@
/* Inherit context and extension */
macrocontext = pbx_builtin_getvar_helper(qe->chan, "MACRO_CONTEXT");
- ast_channel_dialcontext_set(tmp->chan, ast_strlen_zero(macrocontext) ? qe->chan->context : macrocontext);
+ ast_channel_dialcontext_set(tmp->chan, ast_strlen_zero(macrocontext) ? ast_channel_context(qe->chan) : macrocontext);
macroexten = pbx_builtin_getvar_helper(qe->chan, "MACRO_EXTEN");
if (!ast_strlen_zero(macroexten))
- ast_copy_string(tmp->chan->exten, macroexten, sizeof(tmp->chan->exten));
+ ast_channel_exten_set(tmp->chan, macroexten);
else
- ast_copy_string(tmp->chan->exten, qe->chan->exten, sizeof(tmp->chan->exten));
+ ast_channel_exten_set(tmp->chan, ast_channel_exten(qe->chan));
if (ast_cdr_isset_unanswered()) {
/* they want to see the unanswered dial attempts! */
/* set up the CDR fields on all the CDRs to give sensical information */
@@ -3222,8 +3222,8 @@
strcpy(tmp->chan->cdr->clid, qe->chan->cdr->clid);
strcpy(tmp->chan->cdr->channel, qe->chan->cdr->channel);
strcpy(tmp->chan->cdr->src, qe->chan->cdr->src);
- strcpy(tmp->chan->cdr->dst, qe->chan->exten);
- strcpy(tmp->chan->cdr->dcontext, qe->chan->context);
+ strcpy(tmp->chan->cdr->dst, ast_channel_exten(qe->chan));
+ strcpy(tmp->chan->cdr->dcontext, ast_channel_context(qe->chan));
strcpy(tmp->chan->cdr->lastapp, qe->chan->cdr->lastapp);
strcpy(tmp->chan->cdr->lastdata, qe->chan->cdr->lastdata);
tmp->chan->cdr->amaflags = qe->chan->cdr->amaflags;
@@ -3268,7 +3268,7 @@
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"),
- qe->chan->context, qe->chan->exten, qe->chan->priority, ast_channel_uniqueid(qe->chan),
+ ast_channel_context(qe->chan), ast_channel_exten(qe->chan), qe->chan->priority, ast_channel_uniqueid(qe->chan),
[... 3505 lines stripped ...]
More information about the asterisk-commits
mailing list