[asterisk-commits] twilson: trunk r357542 - in /trunk: addons/ apps/ bridges/ channels/ funcs/ i...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 29 10:53:08 CST 2012


Author: twilson
Date: Wed Feb 29 10:52:47 2012
New Revision: 357542

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=357542
Log:
Opaquify ast_channel structs and lists

Review: https://reviewboard.asterisk.org/r/1773/

Modified:
    trunk/addons/chan_ooh323.c
    trunk/apps/app_alarmreceiver.c
    trunk/apps/app_amd.c
    trunk/apps/app_confbridge.c
    trunk/apps/app_dial.c
    trunk/apps/app_disa.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_fax.c
    trunk/apps/app_followme.c
    trunk/apps/app_macro.c
    trunk/apps/app_meetme.c
    trunk/apps/app_minivm.c
    trunk/apps/app_mixmonitor.c
    trunk/apps/app_osplookup.c
    trunk/apps/app_parkandannounce.c
    trunk/apps/app_privacy.c
    trunk/apps/app_queue.c
    trunk/apps/app_readexten.c
    trunk/apps/app_rpt.c
    trunk/apps/app_setcallerid.c
    trunk/apps/app_sms.c
    trunk/apps/app_stack.c
    trunk/apps/app_talkdetect.c
    trunk/apps/app_voicemail.c
    trunk/apps/app_while.c
    trunk/apps/app_zapateller.c
    trunk/bridges/bridge_builtin_features.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_console.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_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_usbradio.c
    trunk/channels/chan_vpb.cc
    trunk/channels/console_video.c
    trunk/channels/sig_analog.c
    trunk/channels/sig_pri.c
    trunk/channels/sig_ss7.c
    trunk/funcs/func_blacklist.c
    trunk/funcs/func_callerid.c
    trunk/funcs/func_dialplan.c
    trunk/funcs/func_strings.c
    trunk/funcs/func_timeout.c
    trunk/include/asterisk/channel.h
    trunk/include/asterisk/utils.h
    trunk/main/abstract_jb.c
    trunk/main/app.c
    trunk/main/autochan.c
    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/message.c
    trunk/main/pbx.c
    trunk/pbx/pbx_lua.c
    trunk/res/res_agi.c
    trunk/res/res_fax.c
    trunk/res/snmp/agent.c
    trunk/tests/test_substitution.c

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Wed Feb 29 10:52:47 2012
@@ -945,23 +945,23 @@
 	}
 	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);
-	}
-
-	if (ast->connected.id.name.valid && ast->connected.id.name.str) {
+		p->callerid_num = strdup(ast_channel_connected(ast)->id.number.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 */
@@ -1294,15 +1294,15 @@
 		}
 		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);
-		}
-		ooSetANI(callToken, ast->connected.id.name.str);
+				callToken, ast_channel_connected(ast)->id.name.str);
+		}
+		ooSetANI(callToken, ast_channel_connected(ast)->id.name.str);
 		break;
 
       case AST_CONTROL_T38_PARAMETERS:
@@ -4661,7 +4661,7 @@
 			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)) {
@@ -4739,7 +4739,7 @@
 				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)) {

Modified: trunk/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Wed Feb 29 10:52:47 2012
@@ -309,7 +309,7 @@
 	
 	/* Extract the caller ID location */
 	ast_copy_string(workstring,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
+		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
 		sizeof(workstring));
 	ast_shrink_phone_number(workstring);
 	if (ast_strlen_zero(workstring)) {
@@ -317,7 +317,7 @@
 	} 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();

Modified: trunk/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_amd.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Wed Feb 29 10:52:47 2012
@@ -193,8 +193,8 @@
 
 	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. */

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Wed Feb 29 10:52:47 2012
@@ -548,8 +548,8 @@
 		ast_channel_name(chan),
 		ast_channel_uniqueid(chan),
 		conf_name,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
-		S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>")
+		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<unknown>"),
+		S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, "<unknown>")
 	);
 }
 
@@ -564,8 +564,8 @@
 		ast_channel_name(chan),
 		ast_channel_uniqueid(chan),
 		conf_name,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
-		S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>")
+		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, "<unknown>"),
+		S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, "<unknown>")
 	);
 }
 
@@ -2008,7 +2008,7 @@
 			ast_cli(a->fd, "%-17s", participant->u_profile.name);
 			ast_cli(a->fd, "%-17s", participant->b_profile.name);
 			ast_cli(a->fd, "%-17s", participant->menu_name);
-			ast_cli(a->fd, "%-17s", S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>"));
+			ast_cli(a->fd, "%-17s", S_COR(ast_channel_caller(participant->chan)->id.number.valid, ast_channel_caller(participant->chan)->id.number.str, "<unknown>"));
 			ast_cli(a->fd, "\n");
 		}
 		ao2_unlock(bridge);
@@ -2346,8 +2346,8 @@
 			"\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");

Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Feb 29 10:52:47 2012
@@ -802,10 +802,10 @@
 		"DestUniqueID: %s\r\n"
 		"Dialstring: %s\r\n",
 		ast_channel_name(src), ast_channel_name(dst),
-		S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"),
-		S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"),
-		S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"),
-		S_COR(src->connected.id.name.valid, src->connected.id.name.str, "<unknown>"),
+		S_COR(ast_channel_caller(src)->id.number.valid, ast_channel_caller(src)->id.number.str, "<unknown>"),
+		S_COR(ast_channel_caller(src)->id.name.valid, ast_channel_caller(src)->id.name.str, "<unknown>"),
+		S_COR(ast_channel_connected(src)->id.number.valid, ast_channel_connected(src)->id.number.str, "<unknown>"),
+		S_COR(ast_channel_connected(src)->id.name.valid, ast_channel_connected(src)->id.name.str, "<unknown>"),
 		ast_channel_uniqueid(src), ast_channel_uniqueid(dst),
 		dialstring ? dialstring : "");
 }
@@ -897,33 +897,33 @@
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
 
-		ast_channel_set_redirecting(c, &original->redirecting, NULL);
+		ast_channel_set_redirecting(c, ast_channel_redirecting(original), NULL);
 		ast_channel_lock(c);
 		while (ast_channel_trylock(in)) {
 			CHANNEL_DEADLOCK_AVOIDANCE(c);
 		}
-		if (!c->redirecting.from.number.valid
-			|| ast_strlen_zero(c->redirecting.from.number.str)) {
+		if (!ast_channel_redirecting(c)->from.number.valid
+			|| ast_strlen_zero(ast_channel_redirecting(c)->from.number.str)) {
 			/*
 			 * The call was not previously redirected so it is
 			 * now redirected from this number.
 			 */
-			ast_party_number_free(&c->redirecting.from.number);
-			ast_party_number_init(&c->redirecting.from.number);
-			c->redirecting.from.number.valid = 1;
-			c->redirecting.from.number.str =
+			ast_party_number_free(&ast_channel_redirecting(c)->from.number);
+			ast_party_number_init(&ast_channel_redirecting(c)->from.number);
+			ast_channel_redirecting(c)->from.number.valid = 1;
+			ast_channel_redirecting(c)->from.number.str =
 				ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in)));
 		}
 
-		c->dialed.transit_network_select = in->dialed.transit_network_select;
+		ast_channel_dialed(c)->transit_network_select = ast_channel_dialed(in)->transit_network_select;
 
 		/* Determine CallerID to store in outgoing channel. */
-		ast_party_caller_set_init(&caller, &c->caller);
+		ast_party_caller_set_init(&caller, ast_channel_caller(c));
 		if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 			caller.id = *stored_clid;
 			ast_channel_set_caller_event(c, &caller, NULL);
-		} else if (ast_strlen_zero(S_COR(c->caller.id.number.valid,
-			c->caller.id.number.str, NULL))) {
+		} else if (ast_strlen_zero(S_COR(ast_channel_caller(c)->id.number.valid,
+			ast_channel_caller(c)->id.number.str, NULL))) {
 			/*
 			 * The new channel has no preset CallerID number by the channel
 			 * driver.  Use the dialplan extension and hint name.
@@ -938,9 +938,9 @@
 
 			ast_party_connected_line_init(&connected);
 			connected.id = *forced_clid;
-			ast_party_connected_line_copy(&c->connected, &connected);
+			ast_party_connected_line_copy(ast_channel_connected(c), &connected);
 		} else {
-			ast_connected_line_copy_from_caller(&c->connected, &in->caller);
+			ast_connected_line_copy_from_caller(ast_channel_connected(c), ast_channel_caller(in));
 		}
 
 		ast_channel_accountcode_set(c, ast_channel_accountcode(in));
@@ -954,7 +954,7 @@
 		 * here.
 		 */
 		ast_party_redirecting_init(&redirecting);
-		ast_party_redirecting_copy(&redirecting, &c->redirecting);
+		ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(c));
 		ast_channel_unlock(c);
 		if (ast_channel_redirecting_sub(c, in, &redirecting, 0) &&
 			ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
@@ -1047,7 +1047,7 @@
 
 		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
 			ast_channel_lock(outgoing->chan);
-			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
+			ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(outgoing->chan));
 			ast_channel_unlock(outgoing->chan);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 			ast_channel_update_connected_line(in, &connected_caller, NULL);
@@ -1112,7 +1112,7 @@
 							}
 						} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 							ast_channel_lock(c);
-							ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
+							ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(c));
 							ast_channel_unlock(c);
 							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 							ast_channel_update_connected_line(in, &connected_caller, NULL);
@@ -1183,7 +1183,7 @@
 								}
 							} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 								ast_channel_lock(c);
-								ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
+								ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(c));
 								ast_channel_unlock(c);
 								connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 								ast_channel_update_connected_line(in, &connected_caller, NULL);
@@ -1714,9 +1714,9 @@
 	int res;
 	char *l;
 
-	if (chan->caller.id.number.valid
-		&& !ast_strlen_zero(chan->caller.id.number.str)) {
-		l = ast_strdupa(chan->caller.id.number.str);
+	if (ast_channel_caller(chan)->id.number.valid
+		&& !ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) {
+		l = ast_strdupa(ast_channel_caller(chan)->id.number.str);
 		ast_shrink_phone_number(l);
 		if (ast_test_flag64(opts, OPT_PRIVACY) ) {
 			ast_verb(3, "Privacy DB is '%s', clid is '%s'\n", opt_args[OPT_ARG_PRIVACY], l);
@@ -2044,18 +2044,18 @@
 	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);
-			}
-			if (!ast_strlen_zero(chan->caller.id.number.str)) {
-				stored_clid.number.str = ast_strdupa(chan->caller.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(chan->caller.id.tag)) {
-				stored_clid.tag = ast_strdupa(chan->caller.id.tag);
+			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(ast_channel_caller(chan)->id.number.str)) {
+				stored_clid.number.str = ast_strdupa(ast_channel_caller(chan)->id.number.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(ast_channel_caller(chan)->id.tag)) {
+				stored_clid.tag = ast_strdupa(ast_channel_caller(chan)->id.tag);
 			}
 			ast_channel_unlock(chan);
 		} else {
@@ -2127,7 +2127,7 @@
 		char *tech = strsep(&number, "/");
 		/* find if we already dialed this interface */
 		struct ast_dialed_interface *di;
-		AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
+		AST_LIST_HEAD(,ast_dialed_interface) *dialed_interfaces;
 		num_dialed++;
 		if (ast_strlen_zero(number)) {
 			ast_log(LOG_WARNING, "Dial argument takes format (technology/[device:]number1)\n");
@@ -2157,7 +2157,7 @@
 		 * previously acquired connected line info could have been set
 		 * through the CONNECTED_LINE dialplan function.
 		 */
-		ast_party_connected_line_copy(&tmp->connected, &chan->connected);
+		ast_party_connected_line_copy(&tmp->connected, ast_channel_connected(chan));
 		ast_channel_unlock(chan);
 
 		if (datastore)
@@ -2255,44 +2255,44 @@
 
 		ast_channel_appl_set(tc, "AppDial");
 		ast_channel_data_set(tc, "(Outgoing Line)");
-		memset(&tc->whentohangup, 0, sizeof(tc->whentohangup));
+		memset(ast_channel_whentohangup(tc), 0, sizeof(*ast_channel_whentohangup(tc)));
 
 		/* Determine CallerID to store in outgoing channel. */
-		ast_party_caller_set_init(&caller, &tc->caller);
+		ast_party_caller_set_init(&caller, ast_channel_caller(tc));
 		if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 			caller.id = stored_clid;
 			ast_channel_set_caller_event(tc, &caller, NULL);
 			ast_set_flag64(tmp, DIAL_CALLERID_ABSENT);
-		} else if (ast_strlen_zero(S_COR(tc->caller.id.number.valid,
-			tc->caller.id.number.str, NULL))) {
+		} else if (ast_strlen_zero(S_COR(ast_channel_caller(tc)->id.number.valid,
+			ast_channel_caller(tc)->id.number.str, NULL))) {
 			/*
 			 * The new channel has no preset CallerID number by the channel
 			 * driver.  Use the dialplan extension and hint name.
 			 */
 			caller.id = stored_clid;
 			if (!caller.id.name.valid
-				&& !ast_strlen_zero(S_COR(chan->connected.id.name.valid,
-					chan->connected.id.name.str, NULL))) {
+				&& !ast_strlen_zero(S_COR(ast_channel_connected(chan)->id.name.valid,
+					ast_channel_connected(chan)->id.name.str, NULL))) {
 				/*
 				 * No hint name available.  We have a connected name supplied by
 				 * the dialplan we can use instead.
 				 */
 				caller.id.name.valid = 1;
-				caller.id.name = chan->connected.id.name;
+				caller.id.name = ast_channel_connected(chan)->id.name;
 			}
 			ast_channel_set_caller_event(tc, &caller, NULL);
 			ast_set_flag64(tmp, DIAL_CALLERID_ABSENT);
-		} else if (ast_strlen_zero(S_COR(tc->caller.id.name.valid, tc->caller.id.name.str,
+		} else if (ast_strlen_zero(S_COR(ast_channel_caller(tc)->id.name.valid, ast_channel_caller(tc)->id.name.str,
 			NULL))) {
 			/* The new channel has no preset CallerID name by the channel driver. */
-			if (!ast_strlen_zero(S_COR(chan->connected.id.name.valid,
-				chan->connected.id.name.str, NULL))) {
+			if (!ast_strlen_zero(S_COR(ast_channel_connected(chan)->id.name.valid,
+				ast_channel_connected(chan)->id.name.str, NULL))) {
 				/*
 				 * We have a connected name supplied by the dialplan we can
 				 * use instead.
 				 */
 				caller.id.name.valid = 1;
-				caller.id.name = chan->connected.id.name;
+				caller.id.name = ast_channel_connected(chan)->id.name;
 				ast_channel_set_caller_event(tc, &caller, NULL);
 			}
 		}
@@ -2301,16 +2301,16 @@
 		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_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
-
-		tc->dialed.transit_network_select = chan->dialed.transit_network_select;
+			ast_connected_line_copy_from_caller(ast_channel_connected(tc), ast_channel_caller(chan));
+		}
+
+		ast_party_redirecting_copy(ast_channel_redirecting(tc), ast_channel_redirecting(chan));
+
+		ast_channel_dialed(tc)->transit_network_select = ast_channel_dialed(chan)->transit_network_select;
 
 		if (!ast_strlen_zero(ast_channel_accountcode(chan))) {
 			ast_channel_peeraccount_set(tc, ast_channel_accountcode(chan));
@@ -2672,8 +2672,8 @@
 				if (gosub_argstart) {
 					const char *what_is_s = "s";
 					*gosub_argstart = 0;
-					if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) &&
-						 ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) {
+					if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) &&
+						 ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) {
 						what_is_s = "~~s~~";
 					}
 					if (asprintf(&gosub_args, "%s,%s,1(%s)", opt_args[OPT_ARG_CALLEE_GOSUB], what_is_s, gosub_argstart + 1) < 0) {
@@ -2683,8 +2683,8 @@
 					*gosub_argstart = ',';
 				} else {
 					const char *what_is_s = "s";
-					if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL)) &&
-						 ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) {
+					if (!ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "s", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL)) &&
+						 ast_exists_extension(peer, opt_args[OPT_ARG_CALLEE_GOSUB], "~~s~~", 1, S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) {
 						what_is_s = "~~s~~";
 					}
 					if (asprintf(&gosub_args, "%s,%s,1", opt_args[OPT_ARG_CALLEE_GOSUB], what_is_s) < 0) {
@@ -2763,8 +2763,8 @@
 
 		if (!res) {
 			if (!ast_tvzero(calldurationlimit)) {
-				struct timeval whentohangup = calldurationlimit;
-				peer->whentohangup = ast_tvadd(ast_tvnow(), whentohangup);
+				struct timeval whentohangup = ast_tvadd(ast_tvnow(), calldurationlimit);
+				ast_channel_whentohangup_set(peer, &whentohangup);
 			}
 			if (!ast_strlen_zero(dtmfcalled)) {
 				ast_verb(3, "Sending DTMF '%s' to the called party.\n", dtmfcalled);
@@ -2839,7 +2839,7 @@
 
 		if (ast_test_flag64(&opts, OPT_PEER_H)
 			&& ast_exists_extension(peer, ast_channel_context(peer), "h", 1,
-				S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL))) {
+				S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL))) {
 			int autoloopflag;
 			int found;
 			int res9;
@@ -2851,7 +2851,7 @@
 
 			while ((res9 = ast_spawn_extension(peer, ast_channel_context(peer), ast_channel_exten(peer),
 				ast_channel_priority(peer),
-				S_COR(peer->caller.id.number.valid, peer->caller.id.number.str, NULL),
+				S_COR(ast_channel_caller(peer)->id.number.valid, ast_channel_caller(peer)->id.number.str, NULL),
 				&found, 1)) == 0) {
 				ast_channel_priority_set(peer, ast_channel_priority(peer) + 1);
 			}
@@ -2908,7 +2908,7 @@
 	
 	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;
 	}
 

Modified: trunk/apps/app_disa.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_disa.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Wed Feb 29 10:52:47 2012
@@ -314,9 +314,9 @@
 				if (j == '#') { /* end of extension .. maybe */
 					if (i == 0
 						&& (ast_matchmore_extension(chan, args.context, "#", 1,
-							S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))
+							S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))
 							|| ast_exists_extension(chan, args.context, "#", 1,
-								S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) ) {
+								S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) ) {
 						/* Let the # be the part of, or the entire extension */
 					} else {
 						break;
@@ -347,7 +347,7 @@
 
 			/* if can do some more, do it */
 			if (!ast_matchmore_extension(chan, args.context, exten, 1,
-				S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
+				S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
 				break;
 			}
 		}
@@ -360,7 +360,7 @@
 		struct ast_flags cdr_flags = { AST_CDR_FLAG_POSTED };
 
 		if (!ast_exists_extension(chan, args.context, exten, 1,
-			S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
+			S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
 			pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten);
 			exten[0] = 'i';
 			exten[1] = '\0';
@@ -368,7 +368,7 @@
 		}
 		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)) {

Modified: trunk/apps/app_dumpchan.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dumpchan.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Wed Feb 29 10:52:47 2012
@@ -131,12 +131,12 @@
 		ast_channel_tech(c)->type,
 		ast_channel_uniqueid(c),
 		ast_channel_linkedid(c),
-		S_COR(c->caller.id.number.valid, c->caller.id.number.str, "(N/A)"),
-		S_COR(c->caller.id.name.valid, c->caller.id.name.str, "(N/A)"),
-		S_COR(c->connected.id.number.valid, c->connected.id.number.str, "(N/A)"),
-		S_COR(c->connected.id.name.valid, c->connected.id.name.str, "(N/A)"),
-		S_OR(c->dialed.number.str, "(N/A)"),
-		S_COR(c->redirecting.from.number.valid, c->redirecting.from.number.str, "(N/A)"),
+		S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, "(N/A)"),
+		S_COR(ast_channel_caller(c)->id.name.valid, ast_channel_caller(c)->id.name.str, "(N/A)"),
+		S_COR(ast_channel_connected(c)->id.number.valid, ast_channel_connected(c)->id.number.str, "(N/A)"),
+		S_COR(ast_channel_connected(c)->id.name.valid, ast_channel_connected(c)->id.name.str, "(N/A)"),
+		S_OR(ast_channel_dialed(c)->number.str, "(N/A)"),
+		S_COR(ast_channel_redirecting(c)->from.number.valid, ast_channel_redirecting(c)->from.number.str, "(N/A)"),
 		ast_channel_parkinglot(c),
 		ast_channel_language(c),	
 		ast_state2str(ast_channel_state(c)),
@@ -154,7 +154,7 @@
 		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,

Modified: trunk/apps/app_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_fax.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Wed Feb 29 10:52:47 2012
@@ -267,10 +267,10 @@
 		"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,

Modified: trunk/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_followme.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Wed Feb 29 10:52:47 2012
@@ -937,7 +937,7 @@
 			}
 
 			/* We check if the extension exists, before creating the ast_channel struct */
-			if (!ast_exists_extension(caller, tpargs->context, number, 1, S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL))) {
+			if (!ast_exists_extension(caller, tpargs->context, number, 1, S_COR(ast_channel_caller(caller)->id.number.valid, ast_channel_caller(caller)->id.number.str, NULL))) {
 				ast_log(LOG_ERROR, "Extension '%s@%s' doesn't exist\n", number, tpargs->context);
 				continue;
 			}
@@ -956,7 +956,7 @@
 			outbound = ast_request("Local", ast_channel_nativeformats(caller), caller, dialarg, &dg);
 			if (outbound) {
 				ast_channel_lock_both(caller, outbound);
-				ast_connected_line_copy_from_caller(&outbound->connected, &caller->caller);
+				ast_connected_line_copy_from_caller(ast_channel_connected(outbound), ast_channel_caller(caller));
 				ast_channel_inherit_variables(caller, outbound);
 				ast_channel_datastore_inherit(caller, outbound);
 				ast_channel_language_set(outbound, ast_channel_language(caller));
@@ -1266,7 +1266,7 @@
 	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);

Modified: trunk/apps/app_macro.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_macro.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_macro.c (original)
+++ trunk/apps/app_macro.c Wed Feb 29 10:52:47 2012
@@ -304,7 +304,7 @@
 
 	snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro);
 	if (!ast_exists_extension(chan, fullmacro, "s", 1,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
+		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
 		if (!ast_context_find(fullmacro)) 
 			ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n", fullmacro, macro, ast_channel_exten(chan), ast_channel_context(chan));
 		else
@@ -376,7 +376,7 @@
 	autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
 	ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
 	while (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan),
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
+		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
 		struct ast_context *c;
 		struct ast_exten *e;
 		int foundx;
@@ -393,7 +393,7 @@
 						ast_log(LOG_WARNING, "Unable to lock context?\n");
 					} else {
 						e = find_matching_priority(c, ast_channel_exten(chan), ast_channel_priority(chan),
-							S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL));
+							S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL));
 						if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */
 							ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
 							ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
@@ -410,7 +410,7 @@
 		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
 
 		res = ast_spawn_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan),
-			S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL),
+			S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),
 			&foundx, 1);
 		if (res) {
 			/* Something bad happened, or a hangup has been requested. */
@@ -555,7 +555,7 @@
 			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);
 				}
 			}

Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=357542&r1=357541&r2=357542
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Feb 29 10:52:47 2012
@@ -1509,8 +1509,8 @@
 			if (!concise) {
 				ast_cli(a->fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
 					user->user_no,
-					S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
-					S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"),
+					S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"),
+					S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<no name>"),
 					ast_channel_name(user->chan),
 					ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "(Admin)" : "",
 					ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "(Listen only)" : "",
@@ -1520,8 +1520,8 @@
 			} else {
 				ast_cli(a->fd, "%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
 					user->user_no,
-					S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, ""),
-					S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, ""),
+					S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, ""),
+					S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, ""),
 					ast_channel_name(user->chan),
 					ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "1" : "",
 					ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "1" : "",
@@ -2788,10 +2788,10 @@
 			"ConnectedLineName: %s\r\n",
 			ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno,
 			user->user_no,
-			S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
-			S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"),
-			S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"),
-			S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<unknown>")
+			S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"),
+			S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<unknown>"),
+			S_COR(ast_channel_connected(user->chan)->id.number.valid, ast_channel_connected(user->chan)->id.number.str, "<unknown>"),
+			S_COR(ast_channel_connected(user->chan)->id.name.valid, ast_channel_connected(user->chan)->id.name.str, "<unknown>")
 			);
 		sent_event = 1;
 	}
@@ -3862,10 +3862,10 @@
 				"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>"),

[... 5682 lines stripped ...]



More information about the asterisk-commits mailing list