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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 23 18:32:30 CST 2012


Author: twilson
Date: Thu Feb 23 18:32:20 2012
New Revision: 356573

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356573
Log:
Opaquification for ast_format structs in struct ast_channel

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

Modified:
    trunk/addons/chan_mobile.c
    trunk/addons/chan_ooh323.c
    trunk/apps/app_amd.c
    trunk/apps/app_chanspy.c
    trunk/apps/app_confbridge.c
    trunk/apps/app_dictate.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_fax.c
    trunk/apps/app_festival.c
    trunk/apps/app_ices.c
    trunk/apps/app_meetme.c
    trunk/apps/app_mp3.c
    trunk/apps/app_nbscat.c
    trunk/apps/app_record.c
    trunk/apps/app_speech_utils.c
    trunk/apps/app_talkdetect.c
    trunk/apps/app_test.c
    trunk/apps/app_voicemail.c
    trunk/apps/app_waitforsilence.c
    trunk/bridges/bridge_multiplexed.c
    trunk/bridges/bridge_simple.c
    trunk/bridges/bridge_softmix.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_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/funcs/func_channel.c
    trunk/include/asterisk/channel.h
    trunk/main/app.c
    trunk/main/bridging.c
    trunk/main/channel.c
    trunk/main/channel_internal_api.c
    trunk/main/cli.c
    trunk/main/features.c
    trunk/main/file.c
    trunk/main/indications.c
    trunk/main/pbx.c
    trunk/main/rtp_engine.c
    trunk/res/res_adsi.c
    trunk/res/res_agi.c
    trunk/res/res_calendar.c
    trunk/res/res_fax.c
    trunk/res/res_musiconhold.c

Modified: trunk/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_mobile.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/addons/chan_mobile.c (original)
+++ trunk/addons/chan_mobile.c Thu Feb 23 18:32:20 2012
@@ -845,10 +845,10 @@
 
 	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);
+	ast_format_copy(ast_channel_rawreadformat(chn), &prefformat);
+	ast_format_copy(ast_channel_rawwriteformat(chn), &prefformat);
+	ast_format_copy(ast_channel_writeformat(chn), &prefformat);
+	ast_format_copy(ast_channel_readformat(chn), &prefformat);
 	ast_channel_tech_pvt_set(chn, pvt);
 
 	if (state == AST_STATE_RING)

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Thu Feb 23 18:32:20 2012
@@ -390,8 +390,8 @@
 			ast_codec_pref_index(&i->prefs, 0, &tmpfmt);
 
 		ast_format_cap_add(ast_channel_nativeformats(ch), &tmpfmt);
-		ast_format_copy(&ch->rawwriteformat, &tmpfmt);
-		ast_format_copy(&ch->rawreadformat, &tmpfmt);
+		ast_format_copy(ast_channel_rawwriteformat(ch), &tmpfmt);
+		ast_format_copy(ast_channel_rawreadformat(ch), &tmpfmt);
 
 		ast_jb_configure(ch, &global_jbconf);
 
@@ -1177,8 +1177,8 @@
 							"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_channel_nativeformats(ast)),
-							ast_getformatname(&ast->readformat),
-							ast_getformatname(&ast->writeformat));
+							ast_getformatname(ast_channel_readformat(ast)),
+							ast_getformatname(ast_channel_writeformat(ast)));
 
 					ast_set_write_format(ast, &f->subclass.format);
 				} else {
@@ -1512,7 +1512,7 @@
 		}
 		if (gH323Debug)
 	  		ast_verb(0, "Writeformat before update %s/%s\n", 
-			  ast_getformatname(&p->owner->writeformat),
+			  ast_getformatname(ast_channel_writeformat(p->owner)),
 			  ast_getformatname_multiple(formats, sizeof(formats), ast_channel_nativeformats(p->owner)));
 		if (txframes)
 			ast_codec_pref_setsize(&p->prefs, fmt, txframes);
@@ -1527,8 +1527,8 @@
 		}
 
 		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_set_write_format(p->owner, ast_channel_writeformat(p->owner));
+	  	ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
 		ast_channel_unlock(p->owner);
    	} else
 		ast_log(LOG_ERROR, "No owner found\n");
@@ -1571,9 +1571,9 @@
 
 		if (gH323Debug)
 	  		ast_verb(0, "Readformat before update %s\n", 
-				  ast_getformatname(&p->owner->readformat));
+				  ast_getformatname(ast_channel_readformat(p->owner)));
 		ast_format_cap_set(ast_channel_nativeformats(p->owner), fmt);
-	  	ast_set_read_format(p->owner, &p->owner->readformat);
+	  	ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
 		ast_channel_unlock(p->owner);
    	} else
 		ast_log(LOG_ERROR, "No owner found\n");
@@ -4196,7 +4196,7 @@
 		return 0;
 	}
 
-	if (ooh323_convertAsteriskCapToH323Cap(&chan->writeformat) < 0) {
+	if (ooh323_convertAsteriskCapToH323Cap(ast_channel_writeformat(chan)) < 0) {
 		ast_log(LOG_WARNING, "Unknown format.\n");
 		return -1;
 	}
@@ -4619,8 +4619,8 @@
 		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(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);
+			ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
+			ast_set_write_format(p->owner, ast_channel_writeformat(p->owner));
 		}
 		if (((p->dtmfmode & H323_DTMF_INBAND) || (p->faxdetect & FAXDETECT_CNG)) && p->vad &&
 		    (f->subclass.format.id == AST_FORMAT_SLINEAR || f->subclass.format.id == AST_FORMAT_ALAW ||

Modified: trunk/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_amd.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Thu Feb 23 18:32:20 2012
@@ -195,7 +195,7 @@
 	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)"),
-		ast_getformatname(&chan->readformat));
+		ast_getformatname(ast_channel_readformat(chan)));
 
 	/* Lets parse the arguments. */
 	if (!ast_strlen_zero(parse)) {
@@ -244,7 +244,7 @@
 				minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold, maximumWordLength);
 
 	/* Set read format to signed linear so we get signed linear frames in */
-	ast_format_copy(&readFormat, &chan->readformat);
+	ast_format_copy(&readFormat, ast_channel_readformat(chan));
 	if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0 ) {
 		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", ast_channel_name(chan));
 		pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");

Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Thu Feb 23 18:32:20 2012
@@ -1123,7 +1123,7 @@
 		ast_clear_flag(&flags, AST_FLAGS_ALL);
 	}
 
-	ast_format_copy(&oldwf, &chan->writeformat);
+	ast_format_copy(&oldwf, ast_channel_writeformat(chan));
 	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 		return -1;
@@ -1247,7 +1247,7 @@
 		ast_clear_flag(&flags, AST_FLAGS_ALL);
 	}
 
-	oldwf = chan->writeformat;
+	ast_format_copy(&oldwf, ast_channel_writeformat(chan));
 	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 		return -1;
@@ -1297,7 +1297,7 @@
 	ast_set_flag(&flags, OPTION_DTMF_CYCLE);
 	ast_set_flag(&flags, OPTION_DAHDI_SCAN);
 
-	ast_format_copy(&oldwf, &chan->writeformat);
+	ast_format_copy(&oldwf, ast_channel_writeformat(chan));
 	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 		return -1;

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Thu Feb 23 18:32:20 2012
@@ -380,10 +380,10 @@
 	ast_format_set(&fmt, AST_FORMAT_SLINEAR, 0);
 	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);
-	ast_format_copy(&tmp->rawreadformat, &fmt);
+	ast_format_copy(ast_channel_writeformat(tmp), &fmt);
+	ast_format_copy(ast_channel_rawwriteformat(tmp), &fmt);
+	ast_format_copy(ast_channel_readformat(tmp), &fmt);
+	ast_format_copy(ast_channel_rawreadformat(tmp), &fmt);
 	return tmp;
 }
 

Modified: trunk/apps/app_dictate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dictate.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_dictate.c (original)
+++ trunk/apps/app_dictate.c Thu Feb 23 18:32:20 2012
@@ -126,7 +126,7 @@
 	if (args.argc > 1 && args.filename) {
 		filename = args.filename;
 	}
-	ast_format_copy(&oldr, &chan->readformat);
+	ast_format_copy(&oldr, ast_channel_readformat(chan));
 	if ((res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) < 0) {
 		ast_log(LOG_WARNING, "Unable to set to linear mode.\n");
 		return -1;

Modified: trunk/apps/app_dumpchan.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dumpchan.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Thu Feb 23 18:32:20 2012
@@ -143,10 +143,10 @@
 		ast_channel_state(c),
 		ast_channel_rings(c), 
 		ast_getformatname_multiple(nf, sizeof(nf), ast_channel_nativeformats(c)),
-		ast_getformatname(&c->writeformat),
-		ast_getformatname(&c->readformat),
-		ast_getformatname(&c->rawwriteformat),
-		ast_getformatname(&c->rawreadformat),
+		ast_getformatname(ast_channel_writeformat(c)),
+		ast_getformatname(ast_channel_readformat(c)),
+		ast_getformatname(ast_channel_rawwriteformat(c)),
+		ast_getformatname(ast_channel_rawreadformat(c)),
 		ast_channel_writetrans(c) ? "Yes" : "No",
 		ast_translate_path_to_str(ast_channel_writetrans(c), &write_transpath),
 		ast_channel_readtrans(c) ? "Yes" : "No",

Modified: trunk/apps/app_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_fax.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Thu Feb 23 18:32:20 2012
@@ -465,7 +465,7 @@
         t30state = &fax.t30_state;
 #endif
 
-	ast_format_copy(&original_read_fmt, &s->chan->readformat);
+	ast_format_copy(&original_read_fmt, ast_channel_readformat(s->chan));
 	if (original_read_fmt.id != AST_FORMAT_SLINEAR) {
 		res = ast_set_read_format_by_id(s->chan, AST_FORMAT_SLINEAR);
 		if (res < 0) {
@@ -474,7 +474,7 @@
 		}
 	}
 
-	ast_format_copy(&original_write_fmt, &s->chan->writeformat);
+	ast_format_copy(&original_write_fmt, ast_channel_writeformat(s->chan));
 	if (original_write_fmt.id != AST_FORMAT_SLINEAR) {
 		res = ast_set_write_format_by_id(s->chan, AST_FORMAT_SLINEAR);
 		if (res < 0) {

Modified: trunk/apps/app_festival.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_festival.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_festival.c (original)
+++ trunk/apps/app_festival.c Thu Feb 23 18:32:20 2012
@@ -190,7 +190,7 @@
 	ast_stopstream(chan);
 	ast_indicate(chan, -1);
 	
-	ast_format_copy(&owriteformat, &chan->writeformat);
+	ast_format_copy(&owriteformat, ast_channel_writeformat(chan));
 	res = ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");

Modified: trunk/apps/app_ices.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_ices.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_ices.c (original)
+++ trunk/apps/app_ices.c Thu Feb 23 18:32:20 2012
@@ -145,7 +145,7 @@
 		return -1;
 	}
 
-	ast_format_copy(&oreadformat, &chan->readformat);
+	ast_format_copy(&oreadformat, ast_channel_readformat(chan));
 	res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR);
 	if (res < 0) {
 		close(fds[0]);

Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Thu Feb 23 18:32:20 2012
@@ -3717,7 +3717,7 @@
 						 )) {
 						int idx;
 						for (idx = 0; idx < AST_FRAME_BITS; idx++) {
-							if (ast_format_to_old_bitfield(&chan->rawwriteformat) & (1 << idx)) {
+							if (ast_format_to_old_bitfield(ast_channel_rawwriteformat(chan)) & (1 << idx)) {
 								break;
 							}
 						}

Modified: trunk/apps/app_mp3.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_mp3.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_mp3.c (original)
+++ trunk/apps/app_mp3.c Thu Feb 23 18:32:20 2012
@@ -168,7 +168,7 @@
 	
 	ast_stopstream(chan);
 
-	ast_format_copy(&owriteformat, &chan->writeformat);
+	ast_format_copy(&owriteformat, ast_channel_writeformat(chan));
 	res = ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");

Modified: trunk/apps/app_nbscat.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_nbscat.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_nbscat.c (original)
+++ trunk/apps/app_nbscat.c Thu Feb 23 18:32:20 2012
@@ -132,7 +132,7 @@
 	
 	ast_stopstream(chan);
 
-	ast_format_copy(&owriteformat, &chan->writeformat);
+	ast_format_copy(&owriteformat, ast_channel_writeformat(chan));
 	res = ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");

Modified: trunk/apps/app_record.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_record.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_record.c (original)
+++ trunk/apps/app_record.c Thu Feb 23 18:32:20 2012
@@ -291,7 +291,7 @@
 	/* The end of beep code.  Now the recording starts */
 
 	if (silence > 0) {
-		ast_format_copy(&rfmt, &chan->readformat);
+		ast_format_copy(&rfmt, ast_channel_readformat(chan));
 		res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");

Modified: trunk/apps/app_speech_utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Thu Feb 23 18:32:20 2012
@@ -678,7 +678,7 @@
 	}
 
 	/* Record old read format */
-	ast_format_copy(&oldreadformat, &chan->readformat);
+	ast_format_copy(&oldreadformat, ast_channel_readformat(chan));
 
 	/* Change read format to be signed linear */
 	if (ast_set_read_format(chan, &speech->format))

Modified: trunk/apps/app_talkdetect.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_talkdetect.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_talkdetect.c (original)
+++ trunk/apps/app_talkdetect.c Thu Feb 23 18:32:20 2012
@@ -131,7 +131,7 @@
 			}
 		}
 
-		ast_format_copy(&origrformat, &chan->readformat);
+		ast_format_copy(&origrformat, ast_channel_readformat(chan));
 		if ((ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR))) {
 			ast_log(LOG_WARNING, "Unable to set read format to linear!\n");
 			res = -1;

Modified: trunk/apps/app_test.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_test.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_test.c (original)
+++ trunk/apps/app_test.c Thu Feb 23 18:32:20 2012
@@ -93,7 +93,7 @@
 	struct ast_frame *f;
 	struct ast_format rformat;
 
-	ast_format_copy(&rformat, &chan->readformat);
+	ast_format_copy(&rformat, ast_channel_readformat(chan));
 	if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) {
 		ast_log(LOG_NOTICE, "Unable to set to linear mode!\n");
 		return -1;

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Feb 23 18:32:20 2012
@@ -12814,12 +12814,12 @@
 	}
 
 	/* normally this is done in the channel driver */
-	ast_format_set(&test_channel1->writeformat, AST_FORMAT_GSM, 0);
+	ast_format_set(ast_channel_writeformat(test_channel1), AST_FORMAT_GSM, 0);
 	nativeformats = ast_channel_nativeformats(test_channel1);
-	ast_format_cap_add(nativeformats, &test_channel1->writeformat);
-	ast_format_set(&test_channel1->rawwriteformat, AST_FORMAT_GSM, 0);
-	ast_format_set(&test_channel1->readformat, AST_FORMAT_GSM, 0);
-	ast_format_set(&test_channel1->rawreadformat, AST_FORMAT_GSM, 0);
+	ast_format_cap_add(nativeformats, ast_channel_writeformat(test_channel1));
+	ast_format_set(ast_channel_rawwriteformat(test_channel1), AST_FORMAT_GSM, 0);
+	ast_format_set(ast_channel_readformat(test_channel1), AST_FORMAT_GSM, 0);
+	ast_format_set(ast_channel_rawreadformat(test_channel1), AST_FORMAT_GSM, 0);
 	ast_channel_tech_set(test_channel1, &fake_tech);
 
 	ast_test_status_update(test, "Test playing of extension when greeting is not available...\n");

Modified: trunk/apps/app_waitforsilence.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_waitforsilence.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/apps/app_waitforsilence.c (original)
+++ trunk/apps/app_waitforsilence.c Thu Feb 23 18:32:20 2012
@@ -138,7 +138,7 @@
 	int (*ast_dsp_func)(struct ast_dsp*, struct ast_frame*, int*) =
 				wait_for_silence ? ast_dsp_silence : ast_dsp_noise;
 
-	ast_format_copy(&rfmt, &chan->readformat); /* Set to linear mode */
+	ast_format_copy(&rfmt, ast_channel_readformat(chan)); /* Set to linear mode */
 	if ((res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) < 0) {
 		ast_log(LOG_WARNING, "Unable to set channel to linear mode, giving up\n");
 		return -1;

Modified: trunk/bridges/bridge_multiplexed.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_multiplexed.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/bridges/bridge_multiplexed.c (original)
+++ trunk/bridges/bridge_multiplexed.c Thu Feb 23 18:32:20 2012
@@ -327,8 +327,8 @@
 		return 0;
 	}
 
-	if ((ast_format_cmp(&c0->writeformat, &c1->readformat) == AST_FORMAT_CMP_EQUAL) &&
-		(ast_format_cmp(&c0->readformat, &c1->writeformat) == AST_FORMAT_CMP_EQUAL) &&
+	if ((ast_format_cmp(ast_channel_writeformat(c0), ast_channel_readformat(c1)) == AST_FORMAT_CMP_EQUAL) &&
+		(ast_format_cmp(ast_channel_readformat(c0), ast_channel_writeformat(c1)) == AST_FORMAT_CMP_EQUAL) &&
 		(ast_format_cap_identical(ast_channel_nativeformats(c0), ast_channel_nativeformats(c1)))) {
 		return 0;
 	}

Modified: trunk/bridges/bridge_simple.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_simple.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/bridges/bridge_simple.c (original)
+++ trunk/bridges/bridge_simple.c Thu Feb 23 18:32:20 2012
@@ -55,8 +55,8 @@
 	}
 
 	/* See if we need to make these compatible */
-	if ((ast_format_cmp(&c0->writeformat, &c1->readformat) == AST_FORMAT_CMP_EQUAL) &&
-		(ast_format_cmp(&c0->readformat, &c1->writeformat) == AST_FORMAT_CMP_EQUAL) &&
+	if ((ast_format_cmp(ast_channel_writeformat(c0), ast_channel_readformat(c1)) == AST_FORMAT_CMP_EQUAL) &&
+		(ast_format_cmp(ast_channel_readformat(c0), ast_channel_writeformat(c1)) == AST_FORMAT_CMP_EQUAL) &&
 		(ast_format_cap_identical(ast_channel_nativeformats(c0), ast_channel_nativeformats(c1)))) {
 		return 0;
 	}

Modified: trunk/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_softmix.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/bridges/bridge_softmix.c (original)
+++ trunk/bridges/bridge_softmix.c Thu Feb 23 18:32:20 2012
@@ -336,7 +336,7 @@
 static void set_softmix_bridge_data(int rate, int interval, struct ast_bridge_channel *bridge_channel, int reset)
 {
 	struct softmix_channel *sc = bridge_channel->bridge_pvt;
-	unsigned int channel_read_rate = ast_format_rate(&bridge_channel->chan->rawreadformat);
+	unsigned int channel_read_rate = ast_format_rate(ast_channel_rawreadformat(bridge_channel->chan));
 
 	ast_mutex_lock(&sc->lock);
 	if (reset) {
@@ -614,8 +614,8 @@
 	int channel_native_rate;
 	int i;
 	/* Gather stats about channel sample rates. */
-	channel_native_rate = MAX(ast_format_rate(&bridge_channel->chan->rawwriteformat),
-		ast_format_rate(&bridge_channel->chan->rawreadformat));
+	channel_native_rate = MAX(ast_format_rate(ast_channel_rawwriteformat(bridge_channel->chan)),
+		ast_format_rate(ast_channel_rawreadformat(bridge_channel->chan)));
 
 	if (channel_native_rate > stats->highest_supported_rate) {
 		stats->highest_supported_rate = channel_native_rate;
@@ -859,7 +859,7 @@
 			memcpy(sc->final_buf, buf, softmix_datalen);
 
 			/* process the softmix channel's new write audio */
-			softmix_process_write_audio(&trans_helper, &bridge_channel->chan->rawwriteformat, sc);
+			softmix_process_write_audio(&trans_helper, ast_channel_rawwriteformat(bridge_channel->chan), sc);
 
 			/* The frame is now ready for use... */
 			sc->have_frame = 1;

Modified: trunk/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_agent.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Thu Feb 23 18:32:20 2012
@@ -303,14 +303,14 @@
 			ast_debug(1, "Native formats changing from '%s' to '%s'\n", ast_getformatname_multiple(tmp1, sizeof(tmp1), ast_channel_nativeformats(ast)), ast_getformatname_multiple(tmp2, sizeof(tmp2), ast_channel_nativeformats(p->chan))); \
 			/* Native formats changed, reset things */ \
 			ast_format_cap_copy(ast_channel_nativeformats(ast), ast_channel_nativeformats(p->chan)); \
-			ast_debug(1, "Resetting read to '%s' and write to '%s'\n", ast_getformatname(&ast->readformat), ast_getformatname(&ast->writeformat));\
-			ast_set_read_format(ast, &ast->readformat); \
-			ast_set_write_format(ast, &ast->writeformat); \
+			ast_debug(1, "Resetting read to '%s' and write to '%s'\n", ast_getformatname(ast_channel_readformat(ast)), ast_getformatname(ast_channel_writeformat(ast)));\
+			ast_set_read_format(ast, ast_channel_readformat(ast)); \
+			ast_set_write_format(ast, ast_channel_writeformat(ast)); \
 		} \
-		if ((ast_format_cmp(&p->chan->readformat, &ast->rawreadformat) != AST_FORMAT_CMP_EQUAL) && !ast_channel_generator(p->chan))  \
-			ast_set_read_format(p->chan, &ast->rawreadformat); \
-		if ((ast_format_cmp(&p->chan->writeformat, &ast->rawwriteformat) != AST_FORMAT_CMP_EQUAL) && !ast_channel_generator(p->chan)) \
-			ast_set_write_format(p->chan, &ast->rawwriteformat); \
+		if ((ast_format_cmp(ast_channel_readformat(p->chan), ast_channel_rawreadformat(ast)) != AST_FORMAT_CMP_EQUAL) && !ast_channel_generator(p->chan))  \
+			ast_set_read_format(p->chan, ast_channel_rawreadformat(ast)); \
+		if ((ast_format_cmp(ast_channel_writeformat(p->chan), ast_channel_rawwriteformat(ast)) != AST_FORMAT_CMP_EQUAL) && !ast_channel_generator(p->chan)) \
+			ast_set_write_format(p->chan, ast_channel_rawwriteformat(ast)); \
 	} \
 } while(0)
 
@@ -742,7 +742,7 @@
 	else {
 		if ((f->frametype != AST_FRAME_VOICE) ||
 		    (f->frametype != AST_FRAME_VIDEO) ||
-		    (ast_format_cmp(&f->subclass.format, &p->chan->writeformat) != AST_FORMAT_CMP_NOT_EQUAL)) {
+		    (ast_format_cmp(&f->subclass.format, ast_channel_writeformat(p->chan)) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			res = ast_write(p->chan, f);
 		} else {
 			ast_debug(1, "Dropping one incompatible %s frame on '%s' to '%s'\n", 
@@ -1114,20 +1114,20 @@
 	ast_channel_tech_set(tmp, &agent_tech);
 	if (p->chan) {
 		ast_format_cap_copy(ast_channel_nativeformats(tmp), ast_channel_nativeformats(p->chan));
-		ast_format_copy(&tmp->writeformat, &p->chan->writeformat);
-		ast_format_copy(&tmp->rawwriteformat, &p->chan->writeformat);
-		ast_format_copy(&tmp->readformat, &p->chan->readformat);
-		ast_format_copy(&tmp->rawreadformat, &p->chan->readformat);
+		ast_format_copy(ast_channel_writeformat(tmp), ast_channel_writeformat(p->chan));
+		ast_format_copy(ast_channel_rawwriteformat(tmp), ast_channel_writeformat(p->chan));
+		ast_format_copy(ast_channel_readformat(tmp), ast_channel_readformat(p->chan));
+		ast_format_copy(ast_channel_rawreadformat(tmp), ast_channel_readformat(p->chan));
 		ast_channel_language_set(tmp, ast_channel_language(p->chan));
 		ast_channel_context_set(tmp, ast_channel_context(p->chan));
 		ast_channel_exten_set(tmp, ast_channel_exten(p->chan));
 		/* XXX Is this really all we copy form the originating channel?? */
 	} else {
-		ast_format_set(&tmp->writeformat, AST_FORMAT_SLINEAR, 0);
-		ast_format_set(&tmp->rawwriteformat, AST_FORMAT_SLINEAR, 0);
-		ast_format_set(&tmp->readformat, AST_FORMAT_SLINEAR, 0);
-		ast_format_set(&tmp->rawreadformat, AST_FORMAT_SLINEAR, 0);
-		ast_format_cap_add(ast_channel_nativeformats(tmp), &tmp->writeformat);
+		ast_format_set(ast_channel_writeformat(tmp), AST_FORMAT_SLINEAR, 0);
+		ast_format_set(ast_channel_rawwriteformat(tmp), AST_FORMAT_SLINEAR, 0);
+		ast_format_set(ast_channel_readformat(tmp), AST_FORMAT_SLINEAR, 0);
+		ast_format_set(ast_channel_rawreadformat(tmp), AST_FORMAT_SLINEAR, 0);
+		ast_format_cap_add(ast_channel_nativeformats(tmp), ast_channel_writeformat(tmp));
 	}
 	/* Safe, agentlock already held */
 	ast_channel_tech_pvt_set(tmp, p);
@@ -2127,7 +2127,7 @@
 							snprintf(ast_channel_cdr(chan)->channel, sizeof(ast_channel_cdr(chan)->channel), "Agent/%s", p->agent);
 						ast_queue_log("NONE", ast_channel_uniqueid(chan), agent, "AGENTLOGIN", "%s", ast_channel_name(chan));
 						ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
-								    ast_getformatname(&chan->readformat), ast_getformatname(&chan->writeformat));
+								    ast_getformatname(ast_channel_readformat(chan)), ast_getformatname(ast_channel_writeformat(chan)));
 						/* Login this channel and wait for it to go away */
 						p->chan = chan;
 						if (p->ackcall) {

Modified: trunk/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_alsa.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_alsa.c (original)
+++ trunk/channels/chan_alsa.c Thu Feb 23 18:32:20 2012
@@ -572,9 +572,9 @@
 
 	ast_channel_tech_set(tmp, &alsa_tech);
 	ast_channel_set_fd(tmp, 0, readdev);
-	ast_format_set(&tmp->readformat, AST_FORMAT_SLINEAR, 0);
-	ast_format_set(&tmp->writeformat, AST_FORMAT_SLINEAR, 0);
-	ast_format_cap_add(ast_channel_nativeformats(tmp), &tmp->writeformat);
+	ast_format_set(ast_channel_readformat(tmp), AST_FORMAT_SLINEAR, 0);
+	ast_format_set(ast_channel_writeformat(tmp), AST_FORMAT_SLINEAR, 0);
+	ast_format_cap_add(ast_channel_nativeformats(tmp), ast_channel_writeformat(tmp));
 
 	ast_channel_tech_pvt_set(tmp, p);
 	if (!ast_strlen_zero(p->context))

Modified: trunk/channels/chan_bridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_bridge.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_bridge.c (original)
+++ trunk/channels/chan_bridge.c Thu Feb 23 18:32:20 2012
@@ -188,14 +188,14 @@
 
 	ast_format_cap_add(ast_channel_nativeformats(p->input), &slin);
 	ast_format_cap_add(ast_channel_nativeformats(p->output), &slin);
-	ast_format_copy(&p->input->readformat, &slin);
-	ast_format_copy(&p->output->readformat, &slin);
-	ast_format_copy(&p->input->rawreadformat, &slin);
-	ast_format_copy(&p->output->rawreadformat, &slin);
-	ast_format_copy(&p->input->writeformat, &slin);
-	ast_format_copy(&p->output->writeformat, &slin);
-	ast_format_copy(&p->input->rawwriteformat, &slin);
-	ast_format_copy(&p->output->rawwriteformat, &slin);
+	ast_format_copy(ast_channel_readformat(p->input), &slin);
+	ast_format_copy(ast_channel_readformat(p->output), &slin);
+	ast_format_copy(ast_channel_rawreadformat(p->input), &slin);
+	ast_format_copy(ast_channel_rawreadformat(p->output), &slin);
+	ast_format_copy(ast_channel_writeformat(p->input), &slin);
+	ast_format_copy(ast_channel_writeformat(p->output), &slin);
+	ast_format_copy(ast_channel_rawwriteformat(p->input), &slin);
+	ast_format_copy(ast_channel_rawwriteformat(p->output), &slin);
 
 	ast_answer(p->output);
 	ast_answer(p->input);

Modified: trunk/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_console.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Thu Feb 23 18:32:20 2012
@@ -420,9 +420,9 @@
 	}
 
 	ast_channel_tech_set(chan, &console_tech);
-	ast_format_set(&chan->readformat, AST_FORMAT_SLINEAR16, 0);
-	ast_format_set(&chan->writeformat, AST_FORMAT_SLINEAR16, 0);
-	ast_format_cap_add(ast_channel_nativeformats(chan), &chan->readformat);
+	ast_format_set(ast_channel_readformat(chan), AST_FORMAT_SLINEAR16, 0);
+	ast_format_set(ast_channel_writeformat(chan), AST_FORMAT_SLINEAR16, 0);
+	ast_format_cap_add(ast_channel_nativeformats(chan), ast_channel_readformat(chan));
 	ast_channel_tech_pvt_set(chan, ref_pvt(pvt));
 
 	pvt->owner = chan;

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Thu Feb 23 18:32:20 2012
@@ -9116,15 +9116,15 @@
 		return f;
 	}
 
-	if (ast->rawreadformat.id == AST_FORMAT_SLINEAR) {
+	if (ast_channel_rawreadformat(ast)->id == AST_FORMAT_SLINEAR) {
 		if (!p->subs[idx].linear) {
 			p->subs[idx].linear = 1;
 			res = dahdi_setlinear(p->subs[idx].dfd, p->subs[idx].linear);
 			if (res)
 				ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to linear mode.\n", p->channel, idx);
 		}
-	} else if ((ast->rawreadformat.id == AST_FORMAT_ULAW) ||
-		(ast->rawreadformat.id == AST_FORMAT_ALAW)) {
+	} else if ((ast_channel_rawreadformat(ast)->id == AST_FORMAT_ULAW) ||
+		(ast_channel_rawreadformat(ast)->id == AST_FORMAT_ALAW)) {
 		if (p->subs[idx].linear) {
 			p->subs[idx].linear = 0;
 			res = dahdi_setlinear(p->subs[idx].dfd, p->subs[idx].linear);
@@ -9132,7 +9132,7 @@
 				ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to companded mode.\n", p->channel, idx);
 		}
 	} else {
-		ast_log(LOG_WARNING, "Don't know how to read frames in format %s\n", ast_getformatname(&ast->rawreadformat));
+		ast_log(LOG_WARNING, "Don't know how to read frames in format %s\n", ast_getformatname(ast_channel_rawreadformat(ast)));
 		ast_mutex_unlock(&p->lock);
 		return NULL;
 	}
@@ -9224,7 +9224,7 @@
 	}
 
 	p->subs[idx].f.frametype = AST_FRAME_VOICE;
-	ast_format_copy(&p->subs[idx].f.subclass.format, &ast->rawreadformat);
+	ast_format_copy(&p->subs[idx].f.subclass.format, ast_channel_rawreadformat(ast));
 	p->subs[idx].f.samples = READ_SIZE;
 	p->subs[idx].f.mallocd = 0;
 	p->subs[idx].f.offset = AST_FRIENDLY_OFFSET;
@@ -9675,10 +9675,10 @@
 	ast_channel_set_fd(tmp, 0, i->subs[idx].dfd);
 	ast_format_cap_add(ast_channel_nativeformats(tmp), &deflaw);
 	/* Start out assuming ulaw since it's smaller :) */
-	ast_format_copy(&tmp->rawreadformat, &deflaw);
-	ast_format_copy(&tmp->readformat, &deflaw);
-	ast_format_copy(&tmp->rawwriteformat, &deflaw);
-	ast_format_copy(&tmp->writeformat, &deflaw);
+	ast_format_copy(ast_channel_rawreadformat(tmp), &deflaw);
+	ast_format_copy(ast_channel_readformat(tmp), &deflaw);
+	ast_format_copy(ast_channel_rawwriteformat(tmp), &deflaw);
+	ast_format_copy(ast_channel_writeformat(tmp), &deflaw);
 	i->subs[idx].linear = 0;
 	dahdi_setlinear(i->subs[idx].dfd, i->subs[idx].linear);
 	features = 0;

Modified: trunk/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_gtalk.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_gtalk.c (original)
+++ trunk/channels/chan_gtalk.c Thu Feb 23 18:32:20 2012
@@ -1170,10 +1170,10 @@
 	ast_channel_adsicpe_set(tmp, AST_ADSI_UNAVAILABLE);
 
 	ast_best_codec(ast_channel_nativeformats(tmp), &tmpfmt);
-	ast_format_copy(&tmp->writeformat, &tmpfmt);
-	ast_format_copy(&tmp->rawwriteformat, &tmpfmt);
-	ast_format_copy(&tmp->readformat, &tmpfmt);
-	ast_format_copy(&tmp->rawreadformat, &tmpfmt);
+	ast_format_copy(ast_channel_writeformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_rawwriteformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_readformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_rawreadformat(tmp), &tmpfmt);
 	ast_channel_tech_pvt_set(tmp, i);
 
 	tmp->callgroup = client->callgroup;
@@ -1628,8 +1628,8 @@
 				ast_debug(1, "Oooh, format changed to %s\n", ast_getformatname(&f->subclass.format));
 				ast_format_cap_remove_bytype(ast_channel_nativeformats(p->owner), AST_FORMAT_TYPE_AUDIO);
 				ast_format_cap_add(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);
+				ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
+				ast_set_write_format(p->owner, ast_channel_writeformat(p->owner));
 			}
 			/* if ((ast_test_flag(p, SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) {
 				f = ast_dsp_process(p->owner, p->vad, f);
@@ -1666,8 +1666,8 @@
 					"Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
 					ast_getformatname(&frame->subclass.format),
 					ast_getformatname_multiple(buf, sizeof(buf), ast_channel_nativeformats(ast)),
-					ast_getformatname(&ast->readformat),
-					ast_getformatname(&ast->writeformat));
+					ast_getformatname(ast_channel_readformat(ast)),
+					ast_getformatname(ast_channel_writeformat(ast)));
 			return 0;
 		}
 		if (p) {
@@ -1992,8 +1992,8 @@
 					ast_channel_name(chan),
 					jid,
 					resource,
-					ast_getformatname(&chan->readformat),
-					ast_getformatname(&chan->writeformat)
+					ast_getformatname(ast_channel_readformat(chan)),
+					ast_getformatname(ast_channel_writeformat(chan))
 					);
 			else
 				ast_log(LOG_WARNING, "No available channel\n");

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=356573&r1=356572&r2=356573
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu Feb 23 18:32:20 2012
@@ -5756,10 +5756,10 @@
 	ast_format_cap_from_old_bitfield(ast_channel_nativeformats(tmp), capability);
 	ast_best_codec(ast_channel_nativeformats(tmp), &tmpfmt);
 
-	ast_format_copy(&tmp->readformat, &tmpfmt);
-	ast_format_copy(&tmp->rawreadformat, &tmpfmt);
-	ast_format_copy(&tmp->writeformat, &tmpfmt);
-	ast_format_copy(&tmp->rawwriteformat, &tmpfmt);
+	ast_format_copy(ast_channel_readformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_rawreadformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_writeformat(tmp), &tmpfmt);
+	ast_format_copy(ast_channel_rawwriteformat(tmp), &tmpfmt);
 
 	ast_channel_tech_pvt_set(tmp, CALLNO_TO_PTR(i->callno));
 
@@ -9353,8 +9353,8 @@
 	}
 
 	/* Make formats okay */
-	chan1m->readformat = chan1->readformat;
-	chan1m->writeformat = chan1->writeformat;
+	ast_format_copy(ast_channel_readformat(chan1m), ast_channel_readformat(chan1));
+	ast_format_copy(ast_channel_writeformat(chan1m), ast_channel_writeformat(chan1));
 
 	/* Prepare for taking over the channel */
 	if (ast_channel_masquerade(chan1m, chan1)) {
@@ -9377,8 +9377,8 @@
 	   back the announcement */
 
 	/* Make formats okay */
-	chan2m->readformat = chan2->readformat;
-	chan2m->writeformat = chan2->writeformat;
+	ast_format_copy(ast_channel_readformat(chan2m), ast_channel_readformat(chan2));
+	ast_format_copy(ast_channel_writeformat(chan2m), ast_channel_writeformat(chan2));
 	ast_channel_parkinglot_set(chan2m, ast_channel_parkinglot(chan2));
 
 	/* Prepare for taking over the channel */
@@ -10367,8 +10367,8 @@
 								struct ast_format_cap *native = ast_channel_nativeformats(iaxs[fr->callno]->owner);
 								if (orignative) {
 									ast_format_cap_set(native, &f.subclass.format);
-									if (iaxs[fr->callno]->owner->readformat.id) {
-										ast_set_read_format(iaxs[fr->callno]->owner, &iaxs[fr->callno]->owner->readformat);
+									if (ast_channel_readformat(iaxs[fr->callno]->owner)->id) {
+										ast_set_read_format(iaxs[fr->callno]->owner, ast_channel_readformat(iaxs[fr->callno]->owner));
 									}
 									ast_format_cap_copy(native, orignative);
 									ast_channel_unlock(iaxs[fr->callno]->owner);
@@ -10873,10 +10873,10 @@
 						ast_verb(3, "Format for call is %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), ast_channel_nativeformats(iaxs[fr->callno]->owner)));
 
 						/* Setup read/write formats properly. */

[... 1329 lines stripped ...]



More information about the asterisk-commits mailing list