[asterisk-commits] rmudgett: trunk r423563 - in /trunk: ./ channels/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 19 12:16:36 CDT 2014


Author: rmudgett
Date: Fri Sep 19 12:16:32 2014
New Revision: 423563

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=423563
Log:
res_pjsip_sdp_rtp.c: Fix native formats containing formats that were not negotiated.

Outgoing PJSIP calls can result in non-negotiated formats listed in the
channel's native formats if video formats are listed in the endpoint's
configuration.  The resulting call could then use a non-negotiated format
resulting in one way audio.

* Simplified the update of session->req_caps in set_caps().  Why do
something in five steps when only one is needed?

AFS-162 #close

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

Merged revisions 423561 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/channels/chan_pjsip.c
    trunk/res/res_pjsip_sdp_rtp.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_pjsip.c?view=diff&rev=423563&r1=423562&r2=423563
==============================================================================
--- trunk/channels/chan_pjsip.c (original)
+++ trunk/channels/chan_pjsip.c Fri Sep 19 12:16:32 2014
@@ -417,6 +417,11 @@
 	}
 
 	ast_channel_nativeformats_set(chan, caps);
+
+	/*
+	 * XXX Probably should pick the first audio codec instead
+	 * of simply the first codec.  The first codec may be video.
+	 */
 	fmt = ast_format_cap_get_format(caps, 0);
 	ast_channel_set_writeformat(chan, fmt);
 	ast_channel_set_rawwriteformat(chan, fmt);

Modified: trunk/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_sdp_rtp.c?view=diff&rev=423563&r1=423562&r2=423563
==============================================================================
--- trunk/res/res_pjsip_sdp_rtp.c (original)
+++ trunk/res/res_pjsip_sdp_rtp.c Fri Sep 19 12:16:32 2014
@@ -256,18 +256,26 @@
 	ast_rtp_codecs_payloads_copy(&codecs, ast_rtp_instance_get_codecs(session_media->rtp),
 				     session_media->rtp);
 
-	ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_UNKNOWN);
-	ast_format_cap_append_from_cap(caps, session->req_caps, AST_MEDIA_TYPE_UNKNOWN);
-	ast_format_cap_remove_by_type(caps, media_type);
-	ast_format_cap_append_from_cap(caps, joint, AST_MEDIA_TYPE_UNKNOWN);
-	ast_format_cap_append_from_cap(session->req_caps, caps, AST_MEDIA_TYPE_UNKNOWN);
+	ast_format_cap_append_from_cap(session->req_caps, joint, AST_MEDIA_TYPE_UNKNOWN);
 
 	if (session->channel) {
 		struct ast_format *fmt;
 
 		ast_channel_lock(session->channel);
+		ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_UNKNOWN);
 		ast_format_cap_append_from_cap(caps, ast_channel_nativeformats(session->channel), AST_MEDIA_TYPE_UNKNOWN);
 		ast_format_cap_remove_by_type(caps, media_type);
+
+		/*
+		 * XXX Historically we picked the "best" joint format to use
+		 * and stuck with it.  It would be nice to just append the
+		 * determined joint media capabilities to give translation
+		 * more formats to choose from when necessary.  Unfortunately,
+		 * there are some areas of the system where this doesn't work
+		 * very well. (The softmix bridge in particular is reluctant
+		 * to pick higher fidelity formats and has a problem with
+		 * asymmetric sample rates.)
+		 */
 		fmt = ast_format_cap_get_format(joint, 0);
 		ast_format_cap_append(caps, fmt, 0);
 




More information about the asterisk-commits mailing list