[Home]

Summary:ASTERISK-29258: chan_sip: Audio stream rejected, Other stream present: Invalid SDP.
Reporter:Alexander Traud (traud)Labels:patch
Date Opened:2021-01-21 13:26:33.000-0600Date Closed:2021-01-27 10:16:54.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/CodecHandling
Versions:13.38.1 16.16.0 18.2.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) invite_video.xml
( 1) video_with_rejected_audio.patch
Description:When Asterisk receives a call with audio and video, but the audio stream is rejected because of incompatible formats. This can happen when the callee is misconfigured (not even G.711 as audio codec). Then, Asterisk continues with the video stream only. So far, so good. However, Asterisk answers with invalid SDP:{code}m=audio 49170 RTP/AVP
m=video 49172 RTP/AVP 34{code}This is a violation of [RFC 3264 section 6|https://tools.ietf.org/html/rfc3264#section-6]
bq. To reject an offered stream, the port number in the corresponding stream in the answer MUST be set to zero.
and [RFC 4566bis|https://tools.ietf.org/html/draft-ietf-mmusic-rfc4566bis] because at least one format must be specified.

The cause is the re-architecture of the media-format handling introduced with Asterisk 13 in commit [a2c912e|https://github.com/asterisk/asterisk/commit/a2c912e9972c91973ea66902d217746133f96026], six years ago. The issue got worse with the fix for ASTERISK-24543 (commit [d343a25|https://github.com/asterisk/asterisk/commit/d343a25173e846fe2474700ed1849df4d74d88f3] and [3f72015|https://github.com/asterisk/asterisk/commit/3f720155b7c8b3089c59cbfc78150aff4efc8240]) because that fix was incomplete.

The attached patch makes sure, {{p->caps}} are only asked for audio formats when they are going to be appended. In other words, the append of {{p->caps}} is guarded with the same condition now. The attached XML file is for the app SIPp. Because I do not get the Asterisk Test Suite running, I cannot create a complete test case.
Comments:By: Asterisk Team (asteriskteam) 2021-01-21 13:26:34.761-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Friendly Automation (friendly-automation) 2021-01-27 10:16:55.738-0600

Change 15365 merged by Friendly Automation:
chan_sip: SDP: Reject audio streams correctly.

[https://gerrit.asterisk.org/c/asterisk/+/15365|https://gerrit.asterisk.org/c/asterisk/+/15365]

By: Friendly Automation (friendly-automation) 2021-01-27 10:44:11.835-0600

Change 15364 merged by George Joseph:
chan_sip: SDP: Reject audio streams correctly.

[https://gerrit.asterisk.org/c/asterisk/+/15364|https://gerrit.asterisk.org/c/asterisk/+/15364]

By: Friendly Automation (friendly-automation) 2021-01-27 10:49:38.773-0600

Change 15333 merged by Friendly Automation:
chan_sip: SDP: Reject audio streams correctly.

[https://gerrit.asterisk.org/c/asterisk/+/15333|https://gerrit.asterisk.org/c/asterisk/+/15333]