[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r356844 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Feb 26 11:57:34 CST 2012


Author: may
Date: Sun Feb 26 11:57:23 2012
New Revision: 356844

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

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

Merged revisions 356042 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/may/ooh323_ipv6_direct_rtp/   (props changed)
    team/may/ooh323_ipv6_direct_rtp/addons/chan_mobile.c
    team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_alarmreceiver.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_authenticate.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_cdr.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_chanisavail.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_channelredirect.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_chanspy.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_confbridge.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_dahdibarge.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_dahdiras.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_dictate.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_directory.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_disa.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_dumpchan.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_echo.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_externalivr.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_fax.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_festival.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_flash.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_followme.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_forkcdr.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_ices.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_ivrdemo.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_macro.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_meetme.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_milliwatt.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_minivm.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_osplookup.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_parkandannounce.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_playback.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_playtones.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_privacy.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_queue.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_read.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_readexten.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_record.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_rpt.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_sayunixtime.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_sendtext.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_sms.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_softhangup.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_speech_utils.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_stack.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_talkdetect.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_test.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_transfer.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_verbose.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_waitforsilence.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_while.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_zapateller.c
    team/may/ooh323_ipv6_direct_rtp/bridges/bridge_builtin_features.c
    team/may/ooh323_ipv6_direct_rtp/bridges/bridge_multiplexed.c
    team/may/ooh323_ipv6_direct_rtp/bridges/bridge_simple.c
    team/may/ooh323_ipv6_direct_rtp/cdr/cdr_custom.c
    team/may/ooh323_ipv6_direct_rtp/cdr/cdr_manager.c
    team/may/ooh323_ipv6_direct_rtp/cdr/cdr_sqlite3_custom.c
    team/may/ooh323_ipv6_direct_rtp/cdr/cdr_syslog.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_agent.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_alsa.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_bridge.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_console.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_gtalk.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_h323.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_iax2.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_jingle.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_local.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_mgcp.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_multicast_rtp.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_nbs.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_oss.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_phone.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_skinny.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_unistim.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_usbradio.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_vpb.cc
    team/may/ooh323_ipv6_direct_rtp/channels/sig_analog.c
    team/may/ooh323_ipv6_direct_rtp/channels/sig_pri.c
    team/may/ooh323_ipv6_direct_rtp/channels/sig_ss7.c
    team/may/ooh323_ipv6_direct_rtp/channels/sip/dialplan_functions.c
    team/may/ooh323_ipv6_direct_rtp/funcs/func_callerid.c
    team/may/ooh323_ipv6_direct_rtp/funcs/func_cdr.c
    team/may/ooh323_ipv6_direct_rtp/funcs/func_channel.c
    team/may/ooh323_ipv6_direct_rtp/funcs/func_jitterbuffer.c
    team/may/ooh323_ipv6_direct_rtp/funcs/func_timeout.c
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/sched.h
    team/may/ooh323_ipv6_direct_rtp/main/abstract_jb.c
    team/may/ooh323_ipv6_direct_rtp/main/app.c
    team/may/ooh323_ipv6_direct_rtp/main/audiohook.c
    team/may/ooh323_ipv6_direct_rtp/main/bridging.c
    team/may/ooh323_ipv6_direct_rtp/main/ccss.c
    team/may/ooh323_ipv6_direct_rtp/main/cdr.c
    team/may/ooh323_ipv6_direct_rtp/main/cel.c
    team/may/ooh323_ipv6_direct_rtp/main/channel.c
    team/may/ooh323_ipv6_direct_rtp/main/channel_internal_api.c
    team/may/ooh323_ipv6_direct_rtp/main/cli.c
    team/may/ooh323_ipv6_direct_rtp/main/devicestate.c
    team/may/ooh323_ipv6_direct_rtp/main/dial.c
    team/may/ooh323_ipv6_direct_rtp/main/features.c
    team/may/ooh323_ipv6_direct_rtp/main/file.c
    team/may/ooh323_ipv6_direct_rtp/main/framehook.c
    team/may/ooh323_ipv6_direct_rtp/main/image.c
    team/may/ooh323_ipv6_direct_rtp/main/manager.c
    team/may/ooh323_ipv6_direct_rtp/main/message.c
    team/may/ooh323_ipv6_direct_rtp/main/pbx.c
    team/may/ooh323_ipv6_direct_rtp/main/rtp_engine.c
    team/may/ooh323_ipv6_direct_rtp/main/udptl.c
    team/may/ooh323_ipv6_direct_rtp/pbx/pbx_lua.c
    team/may/ooh323_ipv6_direct_rtp/pbx/pbx_realtime.c
    team/may/ooh323_ipv6_direct_rtp/res/res_adsi.c
    team/may/ooh323_ipv6_direct_rtp/res/res_agi.c
    team/may/ooh323_ipv6_direct_rtp/res/res_calendar.c
    team/may/ooh323_ipv6_direct_rtp/res/res_fax.c
    team/may/ooh323_ipv6_direct_rtp/res/res_monitor.c
    team/may/ooh323_ipv6_direct_rtp/res/res_musiconhold.c
    team/may/ooh323_ipv6_direct_rtp/res/res_rtp_asterisk.c
    team/may/ooh323_ipv6_direct_rtp/res/snmp/agent.c

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 26 11:57:23 2012
@@ -1,1 +1,1 @@
-/trunk:331201-331202,346391,354429
+/trunk:331201-331202,346391,354429,356042

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Feb 26 11:57:23 2012
@@ -1,1 +1,1 @@
-/trunk:1-313481,313483-313906,313908-313943,313945-356012
+/trunk:1-313481,313483-313906,313908-313943,313945-356012,356042

Modified: team/may/ooh323_ipv6_direct_rtp/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_mobile.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_mobile.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_mobile.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c Sun Feb 26 11:57:23 2012
@@ -394,26 +394,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);
 
@@ -451,7 +451,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)) {
 		
@@ -476,7 +476,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) {
@@ -883,7 +883,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)
@@ -916,7 +916,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)
@@ -945,7 +945,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;
@@ -961,7 +961,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;
@@ -1017,7 +1017,7 @@
 
 	destination[sizeof(destination)-1]='\0';
 
-	opts.transfercap = ast->transfercapability;
+	opts.transfercap = ast_channel_transfercapability(ast);
 	opts.fastStart = p->faststart;
 	opts.tunneling = p->h245tunneling;
 
@@ -1042,7 +1042,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)
@@ -1051,8 +1051,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) {
@@ -1074,7 +1074,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);
@@ -1084,7 +1084,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);
 		}
@@ -1109,7 +1109,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)
@@ -1119,7 +1119,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) {
@@ -1152,7 +1152,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;
 
@@ -1168,7 +1168,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];
 
@@ -1194,12 +1194,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));
 
@@ -1235,7 +1235,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;
 
@@ -1285,7 +1285,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,
@@ -1298,7 +1298,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",
@@ -1421,7 +1421,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;
@@ -1482,7 +1482,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;
 
@@ -1543,7 +1543,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);
@@ -1556,7 +1556,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);
@@ -1602,7 +1602,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
@@ -1658,7 +1658,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);
@@ -1714,7 +1714,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);
@@ -2189,14 +2189,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);
@@ -3479,7 +3479,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) {
@@ -3487,8 +3487,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;
 	}
@@ -3524,7 +3524,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);
@@ -3533,8 +3533,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;
 	}
@@ -3918,7 +3918,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);
@@ -4173,7 +4173,7 @@
 		ast_verb(0, "+++ ooh323  get_rtp_peer \n");
 	}
 
-	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)) {
@@ -4211,7 +4211,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)) {
@@ -4297,7 +4297,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;
@@ -4589,7 +4589,7 @@
 	struct ooh323_pvt *p;
 	struct ast_udptl *udptl = NULL;
 
-	p = chan->tech_pvt;
+	p = ast_channel_tech_pvt(chan);
 	if (!p)
 		return NULL;
 
@@ -4604,7 +4604,7 @@
 {
 	struct ooh323_pvt *p;
 
-	p = chan->tech_pvt;
+	p = ast_channel_tech_pvt(chan);
 	if (!p)
 		return -1;
 	ast_mutex_lock(&p->lock);
@@ -4764,7 +4764,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;
@@ -4791,9 +4791,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: team/may/ooh323_ipv6_direct_rtp/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_alarmreceiver.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_alarmreceiver.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_alarmreceiver.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_authenticate.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_authenticate.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_authenticate.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_authenticate.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_cdr.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_cdr.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_cdr.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_chanisavail.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_chanisavail.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_chanisavail.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_chanisavail.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_channelredirect.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_channelredirect.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_channelredirect.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_channelredirect.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_chanspy.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_chanspy.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_chanspy.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_confbridge.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_confbridge.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_confbridge.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_dahdibarge.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_dahdibarge.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_dahdibarge.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_dahdibarge.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_dahdiras.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_dahdiras.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_dahdiras.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_dahdiras.c Sun Feb 26 11:57:23 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: team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c?view=diff&rev=356844&r1=356843&r2=356844
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c Sun Feb 26 11:57:23 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);
 					}

[... 16299 lines stripped ...]



More information about the asterisk-commits mailing list