summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-09-19 17:16:32 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-09-19 17:16:32 +0000
commitec0313c4118d2d8b26eed1b94319a0744534a32e (patch)
tree10b3f0f0628d2ccb3a662c5691ba999bcae02147 /res/res_pjsip_sdp_rtp.c
parent6dae3456746919fdca9983ba7459742dfa77dff5 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 29a46efc5..5aa176a2a 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -256,18 +256,26 @@ static int set_caps(struct ast_sip_session *session, struct ast_sip_session_medi
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);