[asterisk-commits] kmoore: branch 11 r398510 - /branches/11/channels/chan_h323.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 6 10:58:06 CDT 2013


Author: kmoore
Date: Fri Sep  6 10:58:04 2013
New Revision: 398510

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398510
Log:
Fix chan_h323 compilation

This fixes the things in chan_h323 that were missed or ignored in the
great channel opaquification and gets chan_h323 back into a compiling
state.

(closes issue ASTERISK-22365)
Reported by: Dmitry Melekhov
Patches:
    chan_h323.patch uploaded by Dmitry Melekhov

Modified:
    branches/11/channels/chan_h323.c

Modified: branches/11/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_h323.c?view=diff&rev=398510&r1=398509&r2=398510
==============================================================================
--- branches/11/channels/chan_h323.c (original)
+++ branches/11/channels/chan_h323.c Fri Sep  6 10:58:04 2013
@@ -346,8 +346,8 @@
 		if (h323debug)
 			ast_debug(1, "Preparing %s for new native format\n", ast_channel_name(c));
 		ast_format_cap_from_old_bitfield(ast_channel_nativeformats(c), pvt->nativeformats);
-		ast_set_read_format(c, &c->readformat);
-		ast_set_write_format(c, &c->writeformat);
+		ast_set_read_format(c, ast_channel_readformat(c));
+		ast_set_write_format(c, ast_channel_writeformat(c));
 	}
 	if (pvt->needhangup) {
 		if (h323debug)
@@ -787,8 +787,8 @@
 
 				pvt->nativeformats = ast_format_to_old_bitfield(&f->subclass.format);
 
-				ast_set_read_format(pvt->owner, &pvt->owner->readformat);
-				ast_set_write_format(pvt->owner, &pvt->owner->writeformat);
+				ast_set_read_format(pvt->owner, ast_channel_readformat(pvt->owner));
+				ast_set_write_format(pvt->owner, ast_channel_writeformat(pvt->owner));
 				ast_channel_unlock(pvt->owner);
 			}
 			/* Do in-band DTMF detection */
@@ -854,7 +854,10 @@
 		if (!(ast_format_cap_iscompatible(ast_channel_nativeformats(c), &frame->subclass.format))) {
 			char tmp[256];
 			ast_log(LOG_WARNING, "Asked to transmit frame type '%s', while native formats is '%s' (read/write = %s/%s)\n",
-				ast_getformatname(&frame->subclass.format), ast_getformatname_multiple(tmp, sizeof(tmp), ast_channel_nativeformats(c)), ast_getformatname(&c->readformat), ast_getformatname(&c->writeformat));
+				ast_getformatname(&frame->subclass.format),
+				ast_getformatname_multiple(tmp, sizeof(tmp), ast_channel_nativeformats(c)),
+				ast_getformatname(ast_channel_readformat(c)),
+				ast_getformatname(ast_channel_writeformat(c)));
 			return 0;
 		}
 	}
@@ -1061,10 +1064,10 @@
 
 		pvt->nativeformats = ast_format_cap_to_old_bitfield(ast_channel_nativeformats(ch));
 		ast_best_codec(ast_channel_nativeformats(ch), &tmpfmt);
-		ast_format_copy(&ch->writeformat, &tmpfmt);
-		ast_format_copy(&ch->rawwriteformat, &tmpfmt);
-		ast_format_copy(&ch->readformat, &tmpfmt);
-		ast_format_copy(&ch->rawreadformat, &tmpfmt);
+		ast_format_copy(ast_channel_writeformat(ch), &tmpfmt);
+		ast_format_copy(ast_channel_rawwriteformat(ch), &tmpfmt);
+		ast_format_copy(ast_channel_readformat(ch), &tmpfmt);
+		ast_format_copy(ast_channel_rawreadformat(ch), &tmpfmt);
 		if (!pvt->rtp)
 			__oh323_rtp_create(pvt);
 #if 0
@@ -2079,11 +2082,15 @@
 			if (!(ast_format_cap_identical(ast_channel_nativeformats(pvt->owner), pvt_native))) {
 				if (h323debug) {
 					char tmp[256], tmp2[256];
-					ast_debug(1, "Native format changed to '%s' from '%s', read format is %s, write format is %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), pvt_native), ast_getformatname_multiple(tmp2, sizeof(tmp2), ast_channel_nativeformats(pvt->owner)), ast_getformatname(&pvt->owner->readformat), ast_getformatname(&pvt->owner->writeformat));
+					ast_debug(1, "Native format changed to '%s' from '%s', read format is %s, write format is %s\n",
+						ast_getformatname_multiple(tmp, sizeof(tmp), pvt_native),
+						ast_getformatname_multiple(tmp2, sizeof(tmp2), ast_channel_nativeformats(pvt->owner)),
+						ast_getformatname(ast_channel_readformat(pvt->owner)),
+						ast_getformatname(ast_channel_readformat(pvt->owner)));
 				}
 				ast_format_cap_copy(ast_channel_nativeformats(pvt->owner), pvt_native);
-				ast_set_read_format(pvt->owner, &pvt->owner->readformat);
-				ast_set_write_format(pvt->owner, &pvt->owner->writeformat);
+				ast_set_read_format(pvt->owner, ast_channel_readformat(pvt->owner));
+				ast_set_write_format(pvt->owner, ast_channel_writeformat(pvt->owner));
 			}
 			if (pvt->options.progress_audio)
 				ast_queue_control(pvt->owner, AST_CONTROL_PROGRESS);




More information about the asterisk-commits mailing list