400 Reply To INVITE Not Properly Treated

Home » Asterisk Users » 400 Reply To INVITE Not Properly Treated
Asterisk Users 1 Comment

Hello list, Hope you all doing fine!!

I am using chan_sip of Asterisk 13.6.0 and eventually I have a carrier which replies with 400 to some INVITES which happen to timeout…. I know the SIP reply code is not correct, but anyway I want to understand what is happening, because I think it is a bug…. In this situation, Asterisk is not failing the Dial, but sends back an ACK. Given the carrier has previously sent a 180, Asterisk just lets the user ringing forever…. Because the Dial() doesn’t fail in this case, the user must hangup to terminate the call…. So question is, is this a known behaviour? I could not find anything related…. In my opinion, Asterisk should at fail the Dial and proceed with whatever was configured in the dialplan…. I tried some other 4XX SIP codes, but the only one I found not behaving properly is the 400 one….

Thanks, Kind regards, Patrick Wakano

One thought on - 400 Reply To INVITE Not Properly Treated

  • I think you are right, any 4xx is a final response. The call has failed at this moment (unless there are other branches). You should file a bug report IMHO.

    https://tools.ietf.org/html/rfc3261#section-13.2.2.3
    A single non-2xx final response may be received for the INVITE. 4xx,
    5xx and 6xx responses may contain a Contact header field value
    indicating the location where additional information about the error
    can be found. Subsequent final responses (which would only arrive
    under error conditions) MUST be ignored.

    All early dialogs are considered terminated upon reception of the
    non-2xx final response.

    After having received the non-2xx final response the UAC core
    considers the INVITE transaction completed. The INVITE client
    transaction handles the generation of ACKs for the response (see
    Section 17).