From: Joshua Colp Date: Wed, 23 Oct 2013 11:10:19 +0000 (+0000) Subject: chan_sip: Fix an issue where an incompatible audio format may be added to SDP. X-Git-Tag: 1.8.25.0-rc1~3^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d5e2cb9cf47a10193339ed51c0731da8e858128;p=thirdparty%2Fasterisk.git 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@401497 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f1271fb80b..2289fab93a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11949,7 +11949,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int /* Prefer the audio codec we were requested to use, first, no matter what Note that p->prefcodec can include video codecs, so mask them out */ - if (capability & p->prefcodec) { + if ((capability & p->prefcodec) & AST_FORMAT_AUDIO_MASK) { format_t codec = p->prefcodec & AST_FORMAT_AUDIO_MASK; add_codec_to_sdp(p, codec, &m_audio, &a_audio, debug, &min_audio_packet_size);