Skip to content
Snippets Groups Projects
Commit f4e028a7 authored by Joshua Colp's avatar Joshua Colp
Browse files

chan_sip: Fix an issue where an incompatible audio format may be added to SDP.

If preferred codecs included any non-audio format the code would
mistakenly add the audio format, even if it was not a joint capability
with the remote side.

(closes issue ASTERISK-21131)
Reported by: nbougues
Patches:
	patch_unsupported_codec_1.8.patch uploaded by nbougues (license 6470)
........

Merged revisions 401497 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401498 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401499 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 4ca92e3b
Branches
Tags
No related merge requests found
...@@ -13358,10 +13358,11 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int ...@@ -13358,10 +13358,11 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
/* Unless otherwise configured, the prefcaps is added before the peer's /* Unless otherwise configured, the prefcaps is added before the peer's
* configured codecs. * configured codecs.
*/ */
if (!ast_test_flag(&p->flags[2], SIP_PAGE3_IGNORE_PREFCAPS) && ast_format_cap_has_joint(tmpcap, p->prefcaps)) { if (!ast_test_flag(&p->flags[2], SIP_PAGE3_IGNORE_PREFCAPS)) {
ast_format_cap_iter_start(p->prefcaps); ast_format_cap_iter_start(p->prefcaps);
while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) { while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) {
if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO) { if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO ||
!ast_format_cap_iscompatible(tmpcap, &tmp_fmt)) {
continue; continue;
} }
add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size, &max_audio_packet_size); add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size, &max_audio_packet_size);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment