[asterisk-commits] file: trunk r389567 - /trunk/res/res_sip_sdp_rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 23 13:19:31 CDT 2013


Author: file
Date: Thu May 23 13:19:27 2013
New Revision: 389567

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389567
Log:
Fix a bug with applying the end result of the codec negotiation to the Asterisk channel.

Modified:
    trunk/res/res_sip_sdp_rtp.c

Modified: trunk/res/res_sip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_sip_sdp_rtp.c?view=diff&rev=389567&r1=389566&r2=389567
==============================================================================
--- trunk/res/res_sip_sdp_rtp.c (original)
+++ trunk/res/res_sip_sdp_rtp.c Thu May 23 13:19:27 2013
@@ -224,11 +224,11 @@
 	if (session->channel) {
 		ast_format_cap_copy(caps, ast_channel_nativeformats(session->channel));
 		ast_format_cap_remove_bytype(caps, media_type);
-		ast_format_cap_append(caps, joint);
+		ast_codec_choose(&session->endpoint->prefs, joint, 1, &fmt);
+		ast_format_cap_add(caps, &fmt);
 
 		/* Apply the new formats to the channel, potentially changing read/write formats while doing so */
-		ast_format_cap_append(ast_channel_nativeformats(session->channel), caps);
-		ast_codec_choose(&session->endpoint->prefs, caps, 0, &fmt);
+		ast_format_cap_copy(ast_channel_nativeformats(session->channel), caps);
 		ast_format_copy(ast_channel_rawwriteformat(session->channel), &fmt);
 		ast_format_copy(ast_channel_rawreadformat(session->channel), &fmt);
 		ast_set_read_format(session->channel, ast_channel_readformat(session->channel));




More information about the asterisk-commits mailing list