[Home]

Summary:ASTERISK-26691: Remember SDP negotiation on SIP_CODEC_INBOUND.
Reporter:Alexander Traud (traud)Labels:
Date Opened:2017-01-04 05:56:15.000-0600Date Closed:2017-01-09 08:39:33.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/CodecHandling
Versions:13.13.1 14.2.1 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) joint_after_SIP_CODEC.patch
Description:Since Asterisk 13.7, the joint media formats contain the SDP negotiation. For example in Asterisk 14 with iLBC, the {{mode}} is stored (whether 30 or 20). For example in Asterisk 13 with Opus Codec (RFC 7587), the {{maxplaybackrate}} is stored (between 8000 and 48000 Hz). Similar happens with SiLK.

With the SIP channel driver {{chan_sip}}, the dialplan can force a media format via SIP_CODEC_INBOUND:
{noformat}
exten => 509,1,Set(SIP_CODEC_INBOUND=ilbc)
same => n,Playback(demo-moreinfo)
same => n,Goto(2)
{noformat}
Now, Asterisk sends not the joint but the cached media format as SDP answer. Cached formats do not contain the negotiated state but default values. The joint media formats get overwritten and are lost.

At the phone, this is not noticeable for iLBC, SiLK, and Opus Codec because their defaults (no {{fmtp}} in SDP) are backward compatible. However, media formats exist (like [AMR|https://github.com/traud/asterisk-amr], [AMR-WB|https://github.com/traud/asterisk-amr], and [3GPP EVS|https://github.com/traud/asterisk-evs]) which are not allowed to change the send format parameters within the SDP answer, like {{octet-align}}. ‘Loosing’ the negotiated state therefore creates undefined behavior by the SDP offerer, like no audio, lower quality, or higher bandwidth than demanded.

The attached patch fixes this and does not loose the joint media format. That way, the SDP answer contains the negotiated and therefore expected {{fmtp}}.

This issue does not apply to the SIP channel driver res_pjsip because it does not offer a SIP_CODEC_INBOUND functionality at all.
Comments:By: Friendly Automation (friendly-automation) 2017-01-09 08:39:34.468-0600

Change 4693 merged by zuul:
chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND.

[https://gerrit.asterisk.org/4693|https://gerrit.asterisk.org/4693]

By: Friendly Automation (friendly-automation) 2017-01-09 08:46:37.236-0600

Change 4694 merged by zuul:
chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND.

[https://gerrit.asterisk.org/4694|https://gerrit.asterisk.org/4694]

By: Friendly Automation (friendly-automation) 2017-01-09 08:47:20.316-0600

Change 4695 merged by Joshua Colp:
chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND.

[https://gerrit.asterisk.org/4695|https://gerrit.asterisk.org/4695]