--- chan_h323.c.orig 2012-05-14 23:44:27.000000000 +0400 +++ chan_h323.c 2013-08-22 13:43:35.358043880 +0400 @@ -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,7 @@ 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 +1061,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 +2079,11 @@ 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(&pvt->owner->readformat), ast_getformatname(&pvt->owner->writeformat)); } 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);