From: Alexander Traud Date: Wed, 4 Jan 2017 11:50:11 +0000 (+0100) Subject: chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND. X-Git-Tag: 13.14.0-rc1~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=367128e70be203f1c2a7b5371cd8f72a5dc69905;p=thirdparty%2Fasterisk.git chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND. After a SIP_CODEC_INBOUND in the dialplan, do not continue with cached formats but remember the joint format. Cached formats contain default parameters, often create an empty fmtp line. However, a joint format might have passed format_get_joint(.) in a res_format_attr_* module (like Opus Codec) and contain the resulting format parameters from a SDP negotiation. ASTERISK-26691 #close Change-Id: I35712d98a793d4c3efdd156cec57deab9014b1dc --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d62a811a11..51c17c5383 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7371,6 +7371,12 @@ static void try_suggested_sip_codec(struct sip_pvt *p) ao2_ref(fmt, -1); } + + /* The original joint formats may have contained negotiated parameters (fmtp) + * like the Opus Codec or iLBC 20. The cached formats contain the default + * parameters, which could be different than the negotiated (joint) result. */ + ast_format_cap_replace_from_cap(p->jointcaps, original_jointcaps, AST_MEDIA_TYPE_UNKNOWN); + ao2_ref(original_jointcaps, -1); return; }