[asterisk-commits] twilson: trunk r356042 - in /trunk: addons/ apps/ bridges/ cdr/ channels/ cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 20 17:43:59 CST 2012


Author: twilson
Date: Mon Feb 20 17:43:27 2012
New Revision: 356042

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356042
Log:
ast_channel opaquification of pointers and integral types

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

Modified:
    trunk/addons/chan_mobile.c
    trunk/addons/chan_ooh323.c
    trunk/apps/app_alarmreceiver.c
    trunk/apps/app_authenticate.c
    trunk/apps/app_cdr.c
    trunk/apps/app_chanisavail.c
    trunk/apps/app_channelredirect.c
    trunk/apps/app_chanspy.c
    trunk/apps/app_confbridge.c
    trunk/apps/app_dahdibarge.c
    trunk/apps/app_dahdiras.c
    trunk/apps/app_dial.c
    trunk/apps/app_dictate.c
    trunk/apps/app_directory.c
    trunk/apps/app_disa.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_echo.c
    trunk/apps/app_externalivr.c
    trunk/apps/app_fax.c
    trunk/apps/app_festival.c
    trunk/apps/app_flash.c
    trunk/apps/app_followme.c
    trunk/apps/app_forkcdr.c
    trunk/apps/app_ices.c
    trunk/apps/app_ivrdemo.c
    trunk/apps/app_macro.c
    trunk/apps/app_meetme.c
    trunk/apps/app_milliwatt.c
    trunk/apps/app_minivm.c
    trunk/apps/app_osplookup.c
    trunk/apps/app_parkandannounce.c
    trunk/apps/app_playback.c
    trunk/apps/app_playtones.c
    trunk/apps/app_privacy.c
    trunk/apps/app_queue.c
    trunk/apps/app_read.c
    trunk/apps/app_readexten.c
    trunk/apps/app_record.c
    trunk/apps/app_rpt.c
    trunk/apps/app_sayunixtime.c
    trunk/apps/app_sendtext.c
    trunk/apps/app_sms.c
    trunk/apps/app_softhangup.c
    trunk/apps/app_speech_utils.c
    trunk/apps/app_stack.c
    trunk/apps/app_talkdetect.c
    trunk/apps/app_test.c
    trunk/apps/app_transfer.c
    trunk/apps/app_verbose.c
    trunk/apps/app_voicemail.c
    trunk/apps/app_waitforsilence.c
    trunk/apps/app_while.c
    trunk/apps/app_zapateller.c
    trunk/bridges/bridge_builtin_features.c
    trunk/bridges/bridge_multiplexed.c
    trunk/bridges/bridge_simple.c
    trunk/cdr/cdr_custom.c
    trunk/cdr/cdr_manager.c
    trunk/cdr/cdr_sqlite3_custom.c
    trunk/cdr/cdr_syslog.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_alsa.c
    trunk/channels/chan_bridge.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_multicast_rtp.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_usbradio.c
    trunk/channels/chan_vpb.cc
    trunk/channels/sig_analog.c
    trunk/channels/sig_pri.c
    trunk/channels/sig_ss7.c
    trunk/channels/sip/dialplan_functions.c
    trunk/funcs/func_callerid.c
    trunk/funcs/func_cdr.c
    trunk/funcs/func_channel.c
    trunk/funcs/func_jitterbuffer.c
    trunk/funcs/func_timeout.c
    trunk/include/asterisk/channel.h
    trunk/include/asterisk/sched.h
    trunk/main/abstract_jb.c
    trunk/main/app.c
    trunk/main/audiohook.c
    trunk/main/bridging.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/devicestate.c
    trunk/main/dial.c
    trunk/main/features.c
    trunk/main/file.c
    trunk/main/framehook.c
    trunk/main/image.c
    trunk/main/manager.c
    trunk/main/message.c
    trunk/main/pbx.c
    trunk/main/rtp_engine.c
    trunk/main/udptl.c
    trunk/pbx/pbx_lua.c
    trunk/pbx/pbx_realtime.c
    trunk/res/res_adsi.c
    trunk/res/res_agi.c
    trunk/res/res_calendar.c
    trunk/res/res_fax.c
    trunk/res/res_monitor.c
    trunk/res/res_musiconhold.c
    trunk/res/res_rtp_asterisk.c
    trunk/res/snmp/agent.c

Modified: trunk/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_mobile.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/addons/chan_mobile.c (original)
+++ trunk/addons/chan_mobile.c Mon Feb 20 17:43:27 2012
@@ -843,16 +843,16 @@
 		goto e_return;
 	}
 
-	chn->tech = &mbl_tech;
-	ast_format_cap_add(chn->nativeformats, &prefformat);
+	ast_channel_tech_set(chn, &mbl_tech);
+	ast_format_cap_add(ast_channel_nativeformats(chn), &prefformat);
 	ast_format_copy(&chn->rawreadformat, &prefformat);
 	ast_format_copy(&chn->rawwriteformat, &prefformat);
 	ast_format_copy(&chn->writeformat, &prefformat);
 	ast_format_copy(&chn->readformat, &prefformat);
-	chn->tech_pvt = pvt;
+	ast_channel_tech_pvt_set(chn, pvt);
 
 	if (state == AST_STATE_RING)
-		chn->rings = 1;
+		ast_channel_rings_set(chn, 1);
 
 	ast_channel_language_set(chn, "en");
 	pvt->owner = chn;
@@ -947,7 +947,7 @@
 
 	dest_dev = ast_strdupa(dest);
 
-	pvt = ast->tech_pvt;
+	pvt = ast_channel_tech_pvt(ast);
 
 	if (pvt->type == MBL_TYPE_PHONE) {
 		dest_num = strchr(dest_dev, '/');
@@ -958,7 +958,7 @@
 		*dest_num++ = 0x00;
 	}
 
-	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
+	if ((ast_channel_state(ast) != AST_STATE_DOWN) && (ast_channel_state(ast) != AST_STATE_RESERVED)) {
 		ast_log(LOG_WARNING, "mbl_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
 		return -1;
 	}
@@ -1001,11 +1001,11 @@
 
 	struct mbl_pvt *pvt;
 
-	if (!ast->tech_pvt) {
+	if (!ast_channel_tech_pvt(ast)) {
 		ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
 		return 0;
 	}
-	pvt = ast->tech_pvt;
+	pvt = ast_channel_tech_pvt(ast);
 
 	ast_debug(1, "[%s] hanging up device\n", pvt->id);
 
@@ -1024,7 +1024,7 @@
 	pvt->incoming = 0;
 	pvt->needring = 0;
 	pvt->owner = NULL;
-	ast->tech_pvt = NULL;
+	ast_channel_tech_pvt_set(ast, NULL);
 
 	ast_mutex_unlock(&pvt->lock);
 
@@ -1039,7 +1039,7 @@
 
 	struct mbl_pvt *pvt;
 
-	pvt = ast->tech_pvt;
+	pvt = ast_channel_tech_pvt(ast);
 
 	if (pvt->type == MBL_TYPE_HEADSET)
 		return 0;
@@ -1058,7 +1058,7 @@
 
 static int mbl_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
 {
-	struct mbl_pvt *pvt = ast->tech_pvt;
+	struct mbl_pvt *pvt = ast_channel_tech_pvt(ast);
 
 	if (pvt->type == MBL_TYPE_HEADSET)
 		return 0;
@@ -1080,7 +1080,7 @@
 static struct ast_frame *mbl_read(struct ast_channel *ast)
 {
 
-	struct mbl_pvt *pvt = ast->tech_pvt;
+	struct mbl_pvt *pvt = ast_channel_tech_pvt(ast);
 	struct ast_frame *fr = &ast_null_frame;
 	int r;
 
@@ -1134,7 +1134,7 @@
 static int mbl_write(struct ast_channel *ast, struct ast_frame *frame)
 {
 
-	struct mbl_pvt *pvt = ast->tech_pvt;
+	struct mbl_pvt *pvt = ast_channel_tech_pvt(ast);
 	struct ast_frame *f;
 
 	ast_debug(3, "*** mbl_write\n");
@@ -1162,7 +1162,7 @@
 static int mbl_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 
-	struct mbl_pvt *pvt = newchan->tech_pvt;
+	struct mbl_pvt *pvt = ast_channel_tech_pvt(newchan);
 
 	if (!pvt) {
 		ast_debug(1, "fixup failed, no pvt on newchan\n");

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Mon Feb 20 17:43:27 2012
@@ -382,26 +382,26 @@
 
 	if (ch) {
 		ast_channel_lock(ch);
-		ch->tech = &ooh323_tech;
+		ast_channel_tech_set(ch, &ooh323_tech);
 
 		if (cap)
 			ast_best_codec(cap, &tmpfmt);
 		if (!tmpfmt.id)
 			ast_codec_pref_index(&i->prefs, 0, &tmpfmt);
 
-		ast_format_cap_add(ch->nativeformats, &tmpfmt);
+		ast_format_cap_add(ast_channel_nativeformats(ch), &tmpfmt);
 		ast_format_copy(&ch->rawwriteformat, &tmpfmt);
 		ast_format_copy(&ch->rawreadformat, &tmpfmt);
 
 		ast_jb_configure(ch, &global_jbconf);
 
 		if (state == AST_STATE_RING)
-			ch->rings = 1;
-
-		ch->adsicpe = AST_ADSI_UNAVAILABLE;
+			ast_channel_rings_set(ch, 1);
+
+		ast_channel_adsicpe_set(ch, AST_ADSI_UNAVAILABLE);
 		ast_set_write_format(ch, &tmpfmt);
 		ast_set_read_format(ch, &tmpfmt);
-		ch->tech_pvt = i;
+		ast_channel_tech_pvt_set(ch, i);
 		i->owner = ch;
 		ast_module_ref(myself);
 
@@ -439,7 +439,7 @@
 		ast_channel_context_set(ch, i->context);
 		ast_channel_exten_set(ch, i->exten);
 
-		ch->priority = 1;
+		ast_channel_priority_set(ch, 1);
 
       		if(!ast_test_flag(i, H323_OUTGOING)) {
 		
@@ -464,7 +464,7 @@
 			ast_channel_accountcode_set(ch, i->accountcode);
 		
 		if (i->amaflags)
-			ch->amaflags = i->amaflags;
+			ast_channel_amaflags_set(ch, i->amaflags);
 
 		ast_setstate(ch, state);
 		if (state != AST_STATE_DOWN) {
@@ -860,7 +860,7 @@
 static int ooh323_digit_begin(struct ast_channel *chan, char digit)
 {
 	char dtmf[2];
-	struct ooh323_pvt *p = (struct ooh323_pvt *) chan->tech_pvt;
+	struct ooh323_pvt *p = (struct ooh323_pvt *) ast_channel_tech_pvt(chan);
 	int res = 0;
 	
 	if (gH323Debug)
@@ -893,7 +893,7 @@
 
 static int ooh323_digit_end(struct ast_channel *chan, char digit, unsigned int duration)
 {
-	struct ooh323_pvt *p = (struct ooh323_pvt *) chan->tech_pvt;
+	struct ooh323_pvt *p = (struct ooh323_pvt *) ast_channel_tech_pvt(chan);
 	int res = 0;
 
 	if (gH323Debug)
@@ -922,7 +922,7 @@
 
 static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout)
 {
-	struct ooh323_pvt *p = ast->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(ast);
 	char destination[256];
    	int res=0, i;
 	const char *val = NULL;
@@ -938,7 +938,7 @@
 		ast_verb(0, "---   ooh323_call- %s\n", dest);
 
 
-   	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
+   	if ((ast_channel_state(ast) != AST_STATE_DOWN) && (ast_channel_state(ast) != AST_STATE_RESERVED)) {
 		ast_log(LOG_WARNING, "ooh323_call called on %s, neither down nor "
 								"reserved\n", ast_channel_name(ast));
 		return -1;
@@ -994,7 +994,7 @@
 
 	destination[sizeof(destination)-1]='\0';
 
-	opts.transfercap = ast->transfercapability;
+	opts.transfercap = ast_channel_transfercapability(ast);
 	opts.fastStart = p->faststart;
 	opts.tunneling = p->h245tunneling;
 
@@ -1019,7 +1019,7 @@
 
 static int ooh323_hangup(struct ast_channel *ast)
 {
-	struct ooh323_pvt *p = ast->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(ast);
    	int q931cause = AST_CAUSE_NORMAL_CLEARING;
 
 	if (gH323Debug)
@@ -1028,8 +1028,8 @@
 	if (p) {
 		ast_mutex_lock(&p->lock);
 
-        if (ast->hangupcause) {
-                q931cause = ast->hangupcause;
+        if (ast_channel_hangupcause(ast)) {
+                q931cause = ast_channel_hangupcause(ast);
         } else {
                 const char *cause = pbx_builtin_getvar_helper(ast, "DIALSTATUS");
                 if (cause) {
@@ -1051,7 +1051,7 @@
 
 		if (gH323Debug)
 			ast_verb(0, "    hanging %s with cause: %d\n", p->username, q931cause);
-		ast->tech_pvt = NULL; 
+		ast_channel_tech_pvt_set(ast, NULL); 
 		if (!ast_test_flag(p, H323_ALREADYGONE)) {
          		ooHangCall(p->callToken, 
 				ooh323_convert_hangupcause_asteriskToH323(q931cause), q931cause);
@@ -1061,7 +1061,7 @@
 			ast_set_flag(p, H323_NEEDDESTROY);
 		/* detach channel here */
 		if (p->owner) {
-			p->owner->tech_pvt = NULL;
+			ast_channel_tech_pvt_set(p->owner, NULL);
 			p->owner = NULL;
 			ast_module_unref(myself);
 		}
@@ -1086,7 +1086,7 @@
 
 static int ooh323_answer(struct ast_channel *ast)
 {
-	struct ooh323_pvt *p = ast->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(ast);
 	char *callToken = (char *)NULL;
 
 	if (gH323Debug)
@@ -1096,7 +1096,7 @@
 
 		ast_mutex_lock(&p->lock);
 		callToken = (p->callToken ? strdup(p->callToken) : NULL);
-		if (ast->_state != AST_STATE_UP) {
+		if (ast_channel_state(ast) != AST_STATE_UP) {
 			ast_channel_lock(ast);
 			if (!p->alertsent) {
 	    			if (gH323Debug) {
@@ -1129,7 +1129,7 @@
 {
 	struct ast_frame *fr;
 	static struct ast_frame null_frame = { AST_FRAME_NULL, };
-	struct ooh323_pvt *p = ast->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(ast);
 
 	if (!p) return &null_frame;
 
@@ -1145,7 +1145,7 @@
 
 static int ooh323_write(struct ast_channel *ast, struct ast_frame *f)
 {
-	struct ooh323_pvt *p = ast->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(ast);
 	int res = 0;
 	char buf[256];
 
@@ -1171,12 +1171,12 @@
 			}
 
 
-			if (!(ast_format_cap_iscompatible(ast->nativeformats, &f->subclass.format))) {
-				if (!(ast_format_cap_is_empty(ast->nativeformats))) {
+			if (!(ast_format_cap_iscompatible(ast_channel_nativeformats(ast), &f->subclass.format))) {
+				if (!(ast_format_cap_is_empty(ast_channel_nativeformats(ast)))) {
 					ast_log(LOG_WARNING,
 							"Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
 							ast_getformatname(&f->subclass.format),
-							ast_getformatname_multiple(buf, sizeof(buf), ast->nativeformats),
+							ast_getformatname_multiple(buf, sizeof(buf), ast_channel_nativeformats(ast)),
 							ast_getformatname(&ast->readformat),
 							ast_getformatname(&ast->writeformat));
 
@@ -1212,7 +1212,7 @@
 static int ooh323_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
 {
 
-	struct ooh323_pvt *p = (struct ooh323_pvt *) ast->tech_pvt;
+	struct ooh323_pvt *p = (struct ooh323_pvt *) ast_channel_tech_pvt(ast);
 	char *callToken = (char *)NULL;
 	int res = -1;
 
@@ -1256,7 +1256,7 @@
 		ast_moh_stop(ast);
 		break;
 	case AST_CONTROL_PROGRESS:
-		if (ast->_state != AST_STATE_UP) {
+		if (ast_channel_state(ast) != AST_STATE_UP) {
 	    		if (!p->progsent) {
 	     			if (gH323Debug) {
 					ast_debug(1, "Sending manual progress for %s, res = %d\n", callToken,
@@ -1269,7 +1269,7 @@
 		}
 	    break;
       case AST_CONTROL_RINGING:
-		if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
+		if (ast_channel_state(ast) == AST_STATE_RING || ast_channel_state(ast) == AST_STATE_RINGING) {
 			if (!p->alertsent) {
 				if (gH323Debug) {
 					ast_debug(1, "Sending manual ringback for %s, res = %d\n",
@@ -1391,7 +1391,7 @@
 static int ooh323_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
 {
 
-	struct ooh323_pvt *p = (struct ooh323_pvt *) ast->tech_pvt;
+	struct ooh323_pvt *p = (struct ooh323_pvt *) ast_channel_tech_pvt(ast);
 	int res = -1;
 	enum ast_t38_state state = T38_STATE_UNAVAILABLE;
 	char* cp;
@@ -1452,7 +1452,7 @@
 
 static int ooh323_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
-	struct ooh323_pvt *p = newchan->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(newchan);
 
 	if (!p) return -1;
 
@@ -1513,7 +1513,7 @@
 		if (gH323Debug)
 	  		ast_verb(0, "Writeformat before update %s/%s\n", 
 			  ast_getformatname(&p->owner->writeformat),
-			  ast_getformatname_multiple(formats, sizeof(formats), p->owner->nativeformats));
+			  ast_getformatname_multiple(formats, sizeof(formats), ast_channel_nativeformats(p->owner)));
 		if (txframes)
 			ast_codec_pref_setsize(&p->prefs, fmt, txframes);
 		ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &p->prefs);
@@ -1526,7 +1526,7 @@
 				 p->rtp, p->dtmfcodec, "audio", "cisco-telephone-event", 0);
 		}
 
-		ast_format_cap_set(p->owner->nativeformats, fmt);
+		ast_format_cap_set(ast_channel_nativeformats(p->owner), fmt);
 	  	ast_set_write_format(p->owner, &p->owner->writeformat);
 	  	ast_set_read_format(p->owner, &p->owner->readformat);
 		ast_channel_unlock(p->owner);
@@ -1572,7 +1572,7 @@
 		if (gH323Debug)
 	  		ast_verb(0, "Readformat before update %s\n", 
 				  ast_getformatname(&p->owner->readformat));
-		ast_format_cap_set(p->owner->nativeformats, fmt);
+		ast_format_cap_set(ast_channel_nativeformats(p->owner), fmt);
 	  	ast_set_read_format(p->owner, &p->owner->readformat);
 		ast_channel_unlock(p->owner);
    	} else
@@ -1628,7 +1628,7 @@
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
-	if (c->_state != AST_STATE_UP)
+	if (ast_channel_state(c) != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
 
 	ast_queue_control(c, AST_CONTROL_RINGING);
@@ -1684,7 +1684,7 @@
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
-	if (c->_state != AST_STATE_UP)
+	if (ast_channel_state(c) != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
 
 	ast_queue_control(c, AST_CONTROL_PROGRESS);
@@ -2154,14 +2154,14 @@
 		if (!ast_test_flag(p, H323_ALREADYGONE)) { 
 
 			ast_set_flag(p, H323_ALREADYGONE);
-			p->owner->hangupcause = call->q931cause;
+			ast_channel_hangupcause_set(p->owner, call->q931cause);
 			p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 			ast_queue_hangup_with_cause(p->owner,call->q931cause);
 		}
    	}
 
    	if(p->owner) {
-    		p->owner->tech_pvt = NULL;
+    		ast_channel_tech_pvt_set(p->owner, NULL);
 		ast_channel_unlock(p->owner);
     		p->owner = NULL;
 		ast_module_unref(myself);
@@ -3419,7 +3419,7 @@
 /*! \brief OOH323 Dialplan function - reads ooh323 settings */
 static int function_ooh323_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
-	struct ooh323_pvt *p = chan->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(chan);
 
 	ast_channel_lock(chan);
 	if (!p) {
@@ -3427,8 +3427,8 @@
 		return -1;
 	}
 
-	if (strcmp(chan->tech->type, "OOH323")) {
-		ast_log(LOG_ERROR, "This function is only supported on OOH323 channels, Channel is %s\n", chan->tech->type);
+	if (strcmp(ast_channel_tech(chan)->type, "OOH323")) {
+		ast_log(LOG_ERROR, "This function is only supported on OOH323 channels, Channel is %s\n", ast_channel_tech(chan)->type);
 		ast_channel_unlock(chan);
 		return -1;
 	}
@@ -3464,7 +3464,7 @@
 /*! \brief OOH323 Dialplan function - writes ooh323 settings */
 static int function_ooh323_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
 {
-	struct ooh323_pvt *p = chan->tech_pvt;
+	struct ooh323_pvt *p = ast_channel_tech_pvt(chan);
 	int res = -1;
 
 	ast_channel_lock(chan);
@@ -3473,8 +3473,8 @@
 		return -1;
 	}
 
-	if (strcmp(chan->tech->type, "OOH323")) {
-		ast_log(LOG_ERROR, "This function is only supported on OOH323 channels, Channel is %s\n", chan->tech->type);
+	if (strcmp(ast_channel_tech(chan)->type, "OOH323")) {
+		ast_log(LOG_ERROR, "This function is only supported on OOH323 channels, Channel is %s\n", ast_channel_tech(chan)->type);
 		ast_channel_unlock(chan);
 		return -1;
 	}
@@ -3857,7 +3857,7 @@
 				DEADLOCK_AVOIDANCE(&cur->lock);
          		}           
 			ast_debug(1, "Detaching from %s\n", ast_channel_name(cur->owner));
-			cur->owner->tech_pvt = NULL;
+			ast_channel_tech_pvt_set(cur->owner, NULL);
 			ast_channel_unlock(cur->owner);
 			cur->owner = NULL;
 			ast_module_unref(myself);
@@ -4092,7 +4092,7 @@
 	struct ooh323_pvt *p = NULL;
 	enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_LOCAL;
 
-	if (!(p = (struct ooh323_pvt *) chan->tech_pvt))
+	if (!(p = (struct ooh323_pvt *) ast_channel_tech_pvt(chan)))
 		return AST_RTP_GLUE_RESULT_FORBID;
 
 	if (!(p->rtp)) {
@@ -4115,7 +4115,7 @@
 	struct ooh323_pvt *p = NULL;
 	enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_LOCAL;
 
-	if (!(p = (struct ooh323_pvt *) chan->tech_pvt))
+	if (!(p = (struct ooh323_pvt *) ast_channel_tech_pvt(chan)))
 		return AST_RTP_GLUE_RESULT_FORBID;
 
 	if (!(p->rtp)) {
@@ -4200,7 +4200,7 @@
 		ast_log(LOG_WARNING, "Unknown format.\n");
 		return -1;
 	}
-	p = (struct ooh323_pvt *) chan->tech_pvt;
+	p = (struct ooh323_pvt *) ast_channel_tech_pvt(chan);
 	if (!p) {
 		ast_log(LOG_ERROR, "No Private Structure, this is bad\n");
 		return -1;
@@ -4415,7 +4415,7 @@
 	struct ooh323_pvt *p;
 	struct ast_udptl *udptl = NULL;
 
-	p = chan->tech_pvt;
+	p = ast_channel_tech_pvt(chan);
 	if (!p)
 		return NULL;
 
@@ -4430,7 +4430,7 @@
 {
 	struct ooh323_pvt *p;
 
-	p = chan->tech_pvt;
+	p = ast_channel_tech_pvt(chan);
 	if (!p)
 		return -1;
 	ast_mutex_lock(&p->lock);
@@ -4589,7 +4589,7 @@
 	struct ast_frame *f;
 	struct ast_frame *dfr = NULL;
 	static struct ast_frame null_frame = { AST_FRAME_NULL, };
-	switch (ast->fdno) {
+	switch (ast_channel_fdno(ast)) {
 	case 0:
 		f = ast_rtp_instance_read(p->rtp, 0);	/* RTP Audio */
 		break;
@@ -4616,9 +4616,9 @@
 
 	if (f && p->owner && !p->faxmode && (f->frametype == AST_FRAME_VOICE)) {
 		/* We already hold the channel lock */
-		if (!(ast_format_cap_iscompatible(p->owner->nativeformats, &f->subclass.format))) {
+		if (!(ast_format_cap_iscompatible(ast_channel_nativeformats(p->owner), &f->subclass.format))) {
 			ast_debug(1, "Oooh, voice format changed to %s\n", ast_getformatname(&f->subclass.format));
-			ast_format_cap_set(p->owner->nativeformats, &f->subclass.format);
+			ast_format_cap_set(ast_channel_nativeformats(p->owner), &f->subclass.format);
 			ast_set_read_format(p->owner, &p->owner->readformat);
 			ast_set_write_format(p->owner, &p->owner->writeformat);
 		}

Modified: trunk/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Mon Feb 20 17:43:27 2012
@@ -266,7 +266,7 @@
 		/* If they hung up, leave */
 		if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) {
 			if (f->data.uint32) {
-				chan->hangupcause = f->data.uint32;
+				ast_channel_hangupcause_set(chan, f->data.uint32);
 			}
 			ast_frfree(f);
 			res = -1;
@@ -597,7 +597,7 @@
 
 	/* Answer the channel if it is not already */
 	ast_verb(4, "AlarmReceiver: Answering channel\n");
-	if (chan->_state != AST_STATE_UP) {
+	if (ast_channel_state(chan) != AST_STATE_UP) {
 		if ((res = ast_answer(chan)))
 			return -1;
 	}

Modified: trunk/apps/app_authenticate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_authenticate.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_authenticate.c (original)
+++ trunk/apps/app_authenticate.c Mon Feb 20 17:43:27 2012
@@ -133,7 +133,7 @@
 		return -1;
 	}
 
-	if (chan->_state != AST_STATE_UP) {
+	if (ast_channel_state(chan) != AST_STATE_UP) {
 		if ((res = ast_answer(chan)))
 			return -1;
 	}

Modified: trunk/apps/app_cdr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_cdr.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_cdr.c (original)
+++ trunk/apps/app_cdr.c Mon Feb 20 17:43:27 2012
@@ -52,8 +52,8 @@
 
 static int nocdr_exec(struct ast_channel *chan, const char *data)
 {
-	if (chan->cdr)
-		ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
+	if (ast_channel_cdr(chan))
+		ast_set_flag(ast_channel_cdr(chan), AST_CDR_FLAG_POST_DISABLED);
 
 	return 0;
 }

Modified: trunk/apps/app_chanisavail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanisavail.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_chanisavail.c (original)
+++ trunk/apps/app_chanisavail.c Mon Feb 20 17:43:27 2012
@@ -169,7 +169,7 @@
 			}
 			snprintf(tmp, sizeof(tmp), "%d", status);
 			ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
-			if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, chan, number, &status))) {
+			if ((inuse <= 1) && (tempchan = ast_request(tech, ast_channel_nativeformats(chan), chan, number, &status))) {
 					ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", ast_channel_name(tempchan));
 					
 					snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);

Modified: trunk/apps/app_channelredirect.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_channelredirect.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_channelredirect.c (original)
+++ trunk/apps/app_channelredirect.c Mon Feb 20 17:43:27 2012
@@ -96,7 +96,7 @@
 		return 0;
 	}
 
-	if (chan2->pbx) {
+	if (ast_channel_pbx(chan2)) {
 		ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
 	}
 

Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Mon Feb 20 17:43:27 2012
@@ -787,7 +787,7 @@
 		ast_channel_unlock(chan);
 	}
 
-	if (chan->_state != AST_STATE_UP)
+	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
 
 	ast_set_flag(chan, AST_FLAG_SPYING); /* so nobody can spy on us while we are spying */

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Feb 20 17:43:27 2012
@@ -378,8 +378,8 @@
 		return NULL;
 	}
 	ast_format_set(&fmt, AST_FORMAT_SLINEAR, 0);
-	tmp->tech = &record_tech;
-	ast_format_cap_add_all(tmp->nativeformats);
+	ast_channel_tech_set(tmp, &record_tech);
+	ast_format_cap_add_all(ast_channel_nativeformats(tmp));
 	ast_format_copy(&tmp->writeformat, &fmt);
 	ast_format_copy(&tmp->rawwriteformat, &fmt);
 	ast_format_copy(&tmp->readformat, &fmt);
@@ -873,7 +873,7 @@
 	ast_mutex_destroy(&conference_bridge->playback_lock);
 
 	if (conference_bridge->playback_chan) {
-		struct ast_channel *underlying_channel = conference_bridge->playback_chan->tech->bridged_channel(conference_bridge->playback_chan, NULL);
+		struct ast_channel *underlying_channel = ast_channel_tech(conference_bridge->playback_chan)->bridged_channel(conference_bridge->playback_chan, NULL);
 		if (underlying_channel) {
 			ast_hangup(underlying_channel);
 		}
@@ -1159,10 +1159,10 @@
 			ast_mutex_unlock(&conference_bridge->playback_lock);
 			return -1;
 		}
-		underlying_channel = conference_bridge->playback_chan->tech->bridged_channel(conference_bridge->playback_chan, NULL);
+		underlying_channel = ast_channel_tech(conference_bridge->playback_chan)->bridged_channel(conference_bridge->playback_chan, NULL);
 	} else {
 		/* Channel was already available so we just need to add it back into the bridge */
-		underlying_channel = conference_bridge->playback_chan->tech->bridged_channel(conference_bridge->playback_chan, NULL);
+		underlying_channel = ast_channel_tech(conference_bridge->playback_chan)->bridged_channel(conference_bridge->playback_chan, NULL);
 		ast_bridge_impart(conference_bridge->bridge, underlying_channel, NULL, NULL, 0);
 	}
 
@@ -1333,7 +1333,7 @@
 	);
 	ast_bridge_features_init(&conference_bridge_user.features);
 
-	if (chan->_state != AST_STATE_UP) {
+	if (ast_channel_state(chan) != AST_STATE_UP) {
 		ast_answer(chan);
 	}
 
@@ -1729,14 +1729,14 @@
 	/*save off*/
 	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;
+	priority = ast_channel_priority(bridge_channel->chan);
+	pbx = ast_channel_pbx(bridge_channel->chan);
+	ast_channel_pbx_set(bridge_channel->chan, NULL);
 
 	/*set new*/
 	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_priority_set(bridge_channel->chan, menu_action->data.dialplan_args.priority);
 
 	ast_channel_unlock(bridge_channel->chan);
 
@@ -1748,8 +1748,8 @@
 
 	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;
+	ast_channel_priority_set(bridge_channel->chan, priority);
+	ast_channel_pbx_set(bridge_channel->chan, pbx);
 
 	ast_channel_unlock(bridge_channel->chan);
 

Modified: trunk/apps/app_dahdibarge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dahdibarge.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_dahdibarge.c (original)
+++ trunk/apps/app_dahdibarge.c Mon Feb 20 17:43:27 2012
@@ -127,7 +127,7 @@
 		goto outrun;
 	}
 	ast_indicate(chan, -1);
-	retrydahdi = strcasecmp(chan->tech->type, "DAHDI");
+	retrydahdi = strcasecmp(ast_channel_tech(chan)->type, "DAHDI");
 dahdiretry:
 	origfd = chan->fds[0];
 	if (retrydahdi) {
@@ -277,7 +277,7 @@
 		}
 	}
 	
-	if (chan->_state != AST_STATE_UP)
+	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
 
 	while(!confno && (++retrycnt < 4)) {

Modified: trunk/apps/app_dahdiras.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dahdiras.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_dahdiras.c (original)
+++ trunk/apps/app_dahdiras.c Mon Feb 20 17:43:27 2012
@@ -200,9 +200,9 @@
 	args = ast_strdupa(data);
 	
 	/* Answer the channel if it's not up */
-	if (chan->_state != AST_STATE_UP)
+	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
-	if (strcasecmp(chan->tech->type, "DAHDI")) {
+	if (strcasecmp(ast_channel_tech(chan)->type, "DAHDI")) {
 		/* If it's not a DAHDI channel, we're done.  Wait a couple of
 		   seconds and then hangup... */
 		ast_verb(2, "Channel %s is not a DAHDI channel\n", ast_channel_name(chan));

Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=356042&r1=356041&r2=356042
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Mon Feb 20 17:43:27 2012
@@ -658,8 +658,8 @@
 	OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \
 	OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK |  \
 	OPT_CALLER_PARK | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB) && \
-	!chan->audiohooks && !peer->audiohooks && \
-	ast_framehook_list_is_empty(chan->framehooks) && ast_framehook_list_is_empty(peer->framehooks))
+	!ast_channel_audiohooks(chan) && !ast_channel_audiohooks(peer) && \
+	ast_framehook_list_is_empty(ast_channel_framehooks(chan)) && ast_framehook_list_is_empty(ast_channel_framehooks(peer)))
 
 /*
  * The list of active channels
@@ -695,7 +695,7 @@
 				/* The flag is used for local channel inheritance and stuff */
 				ast_set_flag(outgoing->chan, AST_FLAG_ANSWERED_ELSEWHERE);
 				/* This is for the channel drivers */
-				outgoing->chan->hangupcause = AST_CAUSE_ANSWERED_ELSEWHERE;
+				ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 			}
 			ast_hangup(outgoing->chan);
 		}
@@ -719,7 +719,7 @@
 
 static void handle_cause(int cause, struct cause_args *num)
 {
-	struct ast_cdr *cdr = num->chan->cdr;
+	struct ast_cdr *cdr = ast_channel_cdr(num->chan);
 
 	switch(cause) {
 	case AST_CAUSE_BUSY:
@@ -869,7 +869,7 @@
 		cause = AST_CAUSE_BUSY;
 	} else {
 		/* Setup parameters */
-		c = o->chan = ast_request(tech, in->nativeformats, in, stuff, &cause);
+		c = o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &cause);
 		if (c) {
 			if (single)
 				ast_channel_make_compatible(o->chan, in);
@@ -1039,7 +1039,7 @@
 				 */
 				*to = -1;
 				strcpy(pa->status, "CONGESTION");
-				ast_cdr_failed(in->cdr);
+				ast_cdr_failed(ast_channel_cdr(in));
 				return NULL;
 			}
 		}
@@ -1100,7 +1100,7 @@
 
 			if (c == NULL)
 				continue;
-			if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
+			if (ast_test_flag64(o, DIAL_STILLGOING) && ast_channel_state(c) == AST_STATE_UP) {
 				if (!peer) {
 					ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
@@ -1157,14 +1157,14 @@
 			}
 			f = ast_read(winner);
 			if (!f) {
-				in->hangupcause = c->hangupcause;
+				ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
 #ifdef HAVE_EPOLL
 				ast_poll_channel_del(in, c);
 #endif
 				ast_hangup(c);
 				c = o->chan = NULL;
 				ast_clear_flag64(o, DIAL_STILLGOING);
-				handle_cause(in->hangupcause, &num);
+				handle_cause(ast_channel_hangupcause(in), &num);
 				continue;
 			}
 			if (f->frametype == AST_FRAME_CONTROL) {
@@ -1196,9 +1196,9 @@
 							}
 						}
 						peer = c;
-						if (peer->cdr) {
-							peer->cdr->answer = ast_tvnow();
-							peer->cdr->disposition = AST_CDR_ANSWERED;
+						if (ast_channel_cdr(peer)) {
+							ast_channel_cdr(peer)->answer = ast_tvnow();
+							ast_channel_cdr(peer)->disposition = AST_CDR_ANSWERED;
 						}
 						ast_copy_flags64(peerflags, o,
 							OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -1214,12 +1214,12 @@
 							ast_channel_early_bridge(in, peer);
 					}
 					/* If call has been answered, then the eventual hangup is likely to be normal hangup */
-					in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
-					c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
+					ast_channel_hangupcause_set(in, AST_CAUSE_NORMAL_CLEARING);
+					ast_channel_hangupcause_set(c, AST_CAUSE_NORMAL_CLEARING);
 					break;
 				case AST_CONTROL_BUSY:
 					ast_verb(3, "%s is busy\n", ast_channel_name(c));
-					in->hangupcause = c->hangupcause;
+					ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
 					ast_hangup(c);
 					c = o->chan = NULL;
 					ast_clear_flag64(o, DIAL_STILLGOING);
@@ -1227,7 +1227,7 @@
 					break;
 				case AST_CONTROL_CONGESTION:
 					ast_verb(3, "%s is circuit-busy\n", ast_channel_name(c));
-					in->hangupcause = c->hangupcause;
+					ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
 					ast_hangup(c);
 					c = o->chan = NULL;
 					ast_clear_flag64(o, DIAL_STILLGOING);
@@ -1404,10 +1404,10 @@
 				/* Got hung up */
 				*to = -1;
 				strcpy(pa->status, "CANCEL");
-				ast_cdr_noanswer(in->cdr);
+				ast_cdr_noanswer(ast_channel_cdr(in));
 				if (f) {
 					if (f->data.uint32) {
-						in->hangupcause = f->data.uint32;
+						ast_channel_hangupcause_set(in, f->data.uint32);
 					}
 					ast_frfree(f);
 				}
@@ -1426,7 +1426,7 @@
 					if (onedigit_goto(in, context, (char) f->subclass.integer, 1)) {
 						ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer);
 						*to = 0;
-						ast_cdr_noanswer(in->cdr);
+						ast_cdr_noanswer(ast_channel_cdr(in));
 						*result = f->subclass.integer;
 						strcpy(pa->status, "CANCEL");
 						ast_frfree(f);
@@ -1444,7 +1444,7 @@
 					ast_verb(3, "User requested call disconnect.\n");
 					*to = 0;
 					strcpy(pa->status, "CANCEL");
-					ast_cdr_noanswer(in->cdr);
+					ast_cdr_noanswer(ast_channel_cdr(in));
 					ast_frfree(f);
 					if (is_cc_recall) {
 						ast_cc_completed(in, "CC completed, but the caller hung up with DTMF");
@@ -1510,7 +1510,7 @@
 		if (!*to)
 			ast_verb(3, "Nobody picked up in %d ms\n", orig);
 		if (!*to || ast_check_hangup(in))
-			ast_cdr_noanswer(in->cdr);
+			ast_cdr_noanswer(ast_channel_cdr(in));
 	}
 
 #ifdef HAVE_EPOLL
@@ -1807,20 +1807,20 @@
 	time_t end;
 	struct ast_channel *chan = data;
 
-	if (!chan->cdr) {
+	if (!ast_channel_cdr(chan)) {
 		return;
 	}
 
 	time(&end);
 
 	ast_channel_lock(chan);
-	if (chan->cdr->answer.tv_sec) {
-		snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec);
+	if (ast_channel_cdr(chan)->answer.tv_sec) {
+		snprintf(buf, sizeof(buf), "%ld", (long) end - ast_channel_cdr(chan)->answer.tv_sec);
 		pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
 	}
 
-	if (chan->cdr->start.tv_sec) {
-		snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec);
+	if (ast_channel_cdr(chan)->start.tv_sec) {
+		snprintf(buf, sizeof(buf), "%ld", (long) end - ast_channel_cdr(chan)->start.tv_sec);
 		pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
 	}
 	ast_channel_unlock(chan);
@@ -1841,7 +1841,7 @@
 		return -1;
 	}
 
-	ts = ast_get_indication_tone(chan->zone, str);
+	ts = ast_get_indication_tone(ast_channel_zone(chan), str);
 
 	if (ts && ts->data[0]) {
 		res = ast_playtones_start(chan, 0, ts->data, 0);
@@ -2081,8 +2081,8 @@
 		ast_channel_unlock(chan);
 	}
 
-	if (ast_test_flag64(&opts, OPT_RESETCDR) && chan->cdr)
-		ast_cdr_reset(chan->cdr, NULL);
+	if (ast_test_flag64(&opts, OPT_RESETCDR) && ast_channel_cdr(chan))
+		ast_cdr_reset(ast_channel_cdr(chan), NULL);
 	if (ast_test_flag64(&opts, OPT_PRIVACY) && ast_strlen_zero(opt_args[OPT_ARG_PRIVACY]))
 		opt_args[OPT_ARG_PRIVACY] = ast_strdupa(ast_channel_exten(chan));
 
@@ -2211,14 +2211,14 @@
 			AST_LIST_UNLOCK(dialed_interfaces);
 		}
 
-		tc = ast_request(tech, chan->nativeformats, chan, numsubst, &cause);
+		tc = ast_request(tech, ast_channel_nativeformats(chan), chan, numsubst, &cause);
 		if (!tc) {
 			/* If we can't, just go on to the next call */
 			ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",
 				tech, cause, ast_cause2str(cause));
 			handle_cause(cause, &num);
 			if (!rest) /* we are on the last destination */
-				chan->hangupcause = cause;
+				ast_channel_hangupcause_set(chan, cause);
 			chanlist_free(tmp);
 			if (!ignore_cc && (cause == AST_CAUSE_BUSY || cause == AST_CAUSE_CONGESTION)) {
 				if (!ast_cc_callback(chan, tech, numsubst, ast_cc_busy_interface)) {
@@ -2312,8 +2312,8 @@
 			ast_channel_musicclass_set(tc, ast_channel_musicclass(chan));
 
 		/* Pass ADSI CPE and transfer capability */
-		tc->adsicpe = chan->adsicpe;
-		tc->transfercapability = chan->transfercapability;
+		ast_channel_adsicpe_set(tc, ast_channel_adsicpe(chan));
+		ast_channel_transfercapability_set(tc, ast_channel_transfercapability(chan));
 
 		/* If we have an outbound group, set this peer channel to it */
 		if (outbound_group)
@@ -2340,16 +2340,16 @@
 		ast_channel_lock(chan);
 
 		/* Save the info in cdr's that we called them */
-		if (chan->cdr)
-			ast_cdr_setdestchan(chan->cdr, ast_channel_name(tc));
+		if (ast_channel_cdr(chan))
+			ast_cdr_setdestchan(ast_channel_cdr(chan), ast_channel_name(tc));
 
 		/* check the results of ast_call */
 		if (res) {
 			/* Again, keep going even if there's an error */
 			ast_debug(1, "ast call on peer returned %d\n", res);
 			ast_verb(3, "Couldn't call %s/%s\n", tech, numsubst);
-			if (tc->hangupcause) {
-				chan->hangupcause = tc->hangupcause;
+			if (ast_channel_hangupcause(tc)) {
+				ast_channel_hangupcause_set(chan, ast_channel_hangupcause(tc));
 			}
 			ast_channel_unlock(chan);
 			ast_cc_call_failed(chan, tc, interface);
@@ -2370,7 +2370,7 @@
 		tmp->next = outgoing;
 		outgoing = tmp;
 		/* If this line is up, don't try anybody else */
-		if (outgoing->chan->_state == AST_STATE_UP)
+		if (ast_channel_state(outgoing->chan) == AST_STATE_UP)
 			break;
 	}
 	
@@ -2458,9 +2458,9 @@
 		hanguptree(outgoing, peer, 1);
 		outgoing = NULL;
 		/* If appropriate, log that we have a destination channel and set the answer time */
-		if (chan->cdr) {
-			ast_cdr_setdestchan(chan->cdr, ast_channel_name(peer));
-			ast_cdr_setanswer(chan->cdr, peer->cdr->answer);
+		if (ast_channel_cdr(chan)) {
+			ast_cdr_setdestchan(ast_channel_cdr(chan), ast_channel_name(peer));
+			ast_cdr_setanswer(ast_channel_cdr(chan), ast_channel_cdr(peer)->answer);
 		}
 		if (ast_channel_name(peer))

[... 16154 lines stripped ...]



More information about the asterisk-commits mailing list