[Home]

Summary:ASTERISK-28957: chan_sip: chan_sip does not process 400 response to an INVITE.
Reporter:Frederic LE FOLL (flefoll)Labels:
Date Opened:2020-06-22 03:23:59Date Closed:2020-06-25 09:17:36
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:16.4.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:chan_sip does not process 400 response to an INVITE.

This problem was observed during tests:
- Diaplan runs Dial() to generate an outgoing call with chan_sip.
- chan_sip generates an outgoing INVITE request,
- UAS returns a 400 response (nothing wrong in request, this is a test)
- chan_sip does not ACK first 400 response, it only ACKs second occurrence.
- Dial() exists only after timeout.
Comments:By: Asterisk Team (asteriskteam) 2020-06-22 03:24:02.767-0500

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.

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.

By: Frederic LE FOLL (flefoll) 2020-06-22 03:31:22.280-0500

Analysis :

chan_sip handle_response() function, for a 400 response to an INVITE, calls handle_response_invite() and does not generate ACK.
handle_response_invite() does not recognize 400 response and has no default response processing for unexpected responses, thus it does not generate ACK either.
The ACK on response repetition comes from handle_response() mechanism "We must re-send ACKs to re-transmitted final responses".

According to code history, 400 response specific processing was introduced with commit "channels/chan_sip: Add improved support for 4xx error codes"
This commit added support for :
- 400/414/493 in handle_response_subscribe() handle_response_register(), handle_response().
- 414/493 only in handle_response_invite()
This behaviour was observed with Asterisk 16.4 but it should also affect older versions, including Asterisk 13 since 13.1.0.

I propose to submit a patch to Gerrit.

By: Joshua C. Colp (jcolp) 2020-06-22 03:46:16.655-0500

I'm assigning this to you since you are going to submit a patch to Gerrit. Once done comment and this will go back into triage.

By: Friendly Automation (friendly-automation) 2020-06-25 09:17:38.306-0500

Change 14598 merged by Friendly Automation:
chan_sip: chan_sip does not process 400 response to an INVITE.

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

By: Friendly Automation (friendly-automation) 2020-06-25 09:22:58.785-0500

Change 14599 merged by Friendly Automation:
chan_sip: chan_sip does not process 400 response to an INVITE.

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

By: Friendly Automation (friendly-automation) 2020-06-25 09:24:28.183-0500

Change 14569 merged by Friendly Automation:
chan_sip: chan_sip does not process 400 response to an INVITE.

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

By: Friendly Automation (friendly-automation) 2020-06-25 09:48:56.869-0500

Change 14600 merged by George Joseph:
chan_sip: chan_sip does not process 400 response to an INVITE.

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