180 Ringing after 183 Progress is not passed on to the caller

Have a problem after upgrading from asterisk 1.8 to 18 with pjsip
when a user make a outgoing call from there Asterisk PBX via our Asterisk GW to our provider
the Asterisk GW newer indicate 180 Ringing to our Asterisk PBX
the problem is our provider first send a 183 Progress with SDP and after that send a 180 Ringing
with asterisk 1.8 this was not a problem as It would just send it, but with asterisk 18 will change it to 183

is this a bug or as intended ??

           178.21.248.59:5060           178.21.248.172:5060           195.215.224.12:5060
          ─;;;;;;;;;┬─;;;;;;;;          ─;;;;;;;;;┬─;;;;;;;;          ─;;;;;;;;;┬─;;;;;;;;
  10:44:06.916070   │        INVITE (SDP)         │                             │
        +0.000755   │ ─                         > │                             │
  10:44:06.916825   │         100 Trying          │                             │
        +0.013465   │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │                             │
  10:44:06.930290   │                             │        INVITE (SDP)         │
        +0.202759   │                             │ ─                         > │
  10:44:07.133049   │                             │         100 Trying          │
        +2.195055   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:09.328104   │                             │  183 Session Progress (SDP) │
        +0.001095   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:09.329199   │                             │            PRACK            │
        +0.000605   │                             │ ─                         > │
  10:44:09.329804   │  183 Session Progress (SDP) │                             │
        +0.055379   │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │                             │
  10:44:09.385183   │                             │           200 OK            │
        +1.398832   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:10.784015   │                             │         180 Ringing         │
        +0.000820   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:10.784835   │                             │            PRACK            │
        +0.000703   │                             │ ─                         > │
  10:44:10.785538   │  183 Session Progress (SDP) │                             │
        +0.045755   │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │                             │
  10:44:10.831293   │                             │           200 OK            │
        +1.432871   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:12.264164   │                             │           200 OK            │
        +0.000764   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:12.264928   │                             │             ACK             │
        +0.000641   │                             │ ─                         > │
  10:44:12.265569   │        200 OK (SDP)         │                             │
        +0.014951   │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │                             │
  10:44:12.280520   │             ACK             │                             │
        +2.936439   │ ─                         > │                             │
  10:44:15.216959   │                             │             BYE             │
        +0.000885   │                             │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │
  10:44:15.217844   │                             │           200 OK            │
        +0.002238   │                             │ ─                         > │
  10:44:15.220082   │             BYE             │                             │
        +0.010167   │ <─<<<<<<<<<<<<<<<<<<<<<<<<< │                             │
  10:44:15.230249   │           200 OK            │                             │

According to the code[1] and issue[2] it is on purpose.

[1] asterisk/chan_pjsip.c at master · asterisk/asterisk · GitHub
[2] [ASTERISK-27994] PJSIP: Early media ringback not indicated after Progress() - Digium/Asterisk JIRA

I have looked at the link you send and from what I understand there problem was that Asterisk did not send INBAND ringing for the Dial application if the channel already had early media set up via Progress
not where asterisk send 180 or 183

the problem is that only 180 Ringing will be send out on AMI
so changing 180 to 183 prevent the caller from setting the correct AST_STATE_RINGING

do you see any problem with this patch suggestion

chan_pjsip.c: prevent changing 180 to 183 if early_media already enabled

index e8fbb3d79a..882db3cd6c 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1638,11 +1638,9 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi
                        if (channel->session->endpoint->inband_progress ||
                                (channel->session->inv_session && channel->session->inv_session->neg &&
                                pjmedia_sdp_neg_get_state(channel->session->inv_session->neg) == PJMEDIA_SDP_NEG_STATE_DONE)) {
-                               response_code = 183;
                                res = -1;
-                       } else {
-                               response_code = 180;
                        }
+                       response_code = 180;
                } else {
                        res = -1;
                }

I don’t know. I didn’t make the original change, and that was some time ago so can’t recall any further specifics.

ok, thanks

I will try man a jira ticket and submit my patch and add as much details at possible and see where it lands

https://issues.asterisk.org/jira/browse/ASTERISK-29842