[Home]

Summary:ASTERISK-29105: chan_pjsip: 180 Ringing with SDP not changed into progress
Reporter:Sebastian Damm (sdamm)Labels:
Date Opened:2020-10-05 05:32:37Date Closed:2021-03-02 11:22:25.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip_sdp_rtp
Versions:17.6.0 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-28261 PJSIP: SDP in 180 Ringing is ignored
Environment:Debian 10Attachments:( 0) asterisk.log
( 1) asterisk180SDP.tgz
Description:When Asterisk receives an 180 Ringing response with SDP, it does not forward this response but instead sends an 180 Ringing response without SDP to the caller. Additionally, it does not forward the audio from B to the caller.

I would expect Asterisk to forward the Ringing with SDP as well as the audio from B to A.

Attached is a log of Asterisk showing the behavior. Additionally, I have attached a docker scenario to reproduce it. Follow these steps to reproduce:
* docker-compose up -d
* docker-compose exec sipp /bin/bash
* /testcase/start.sh
* exit from container
* docker-compose logs asterisk
* Inside the sipp container you will find sipp output from both caller and called, as well as a pcap file of all udp traffic. Inside the pcap file, you can see that B sends audio to the Asterisk, but there is no audio from Asterisk to A before the 200 OK arrives.
Comments:By: Asterisk Team (asteriskteam) 2020-10-05 05:32:38.936-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. 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: Sebastian Damm (sdamm) 2020-10-05 05:34:43.371-0500

This is the log file and the docker scenario for reproducing it.

By: Joshua C. Colp (jcolp) 2020-10-05 05:51:21.138-0500

This should actually get turned into a 183 Session Progress on the other side, Asterisk doesn't support sending 180 Ringing with SDP.

By: Sebastian Damm (sdamm) 2020-10-05 06:04:09.510-0500

Okay, a 183 potentially followed by a 180 (without SDP) to indicate that it is actually ringing would be fine as well.

By: Holger Hans Peter Freyther (zecke) 2020-10-12 21:04:35.259-0500

I am not sure what the other side refers to but do you suggest:

a.)
Inside chan_pjsip_indicate for condition==AST_CONTROL_RINGING as a result of another channel receiving the 180, we extend the check for pjmedia_sdp_neg_get_state() to cover this scenario.

b.)
Inside chan_pjsip_incoming_response status.code==180 for the channel that received the SIP 180, we queue a AST_CONTROL_PROGRESS instead of the ringing?


And should we put this behind a configuration flag or do it unconditionally?

In case of a.) the neg_get_state could return   PJMEDIA_SDP_NEG_STATE_WAIT_NEGO and then pjsip will call sdp_neg_negotiate _before_ sending out the 183. Is this acceptable or should sdp_neg_negotiate be called somewhere inside Asterisk before queuing the AST_CONTROL_RINGING?

By: Joshua C. Colp (jcolp) 2020-10-13 04:18:24.045-0500

I haven't looked into the implementation detail and am not actively working on this so I don't know the state of things. It would be somewhere in the 'b' part of your comment, and I don't think it would need to go behind a configuration flag.

By: Holger Hans Peter Freyther (zecke) 2021-01-07 08:53:50.508-0600

The chan_pjsip response handler will be called twice and we queue the AST_CONTROL_PROGRESS twice. In contrast to the 180 we generate progress twice (two 183 on the wire).

I worked around this by queuing the progress only once and only for the AST_SIP_SESSION_AFTER_MEDIA case. Is there a better way of achieving this?

The change is in gerrit. https://gerrit.asterisk.org/c/asterisk/+/15307

By: Friendly Automation (friendly-automation) 2021-03-02 11:22:26.551-0600

Change 15524 merged by Joshua Colp:
pjsip: Generate progress (once) when receiving a 180 with a SDP

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

By: Friendly Automation (friendly-automation) 2021-03-02 11:22:36.719-0600

Change 15525 merged by Joshua Colp:
pjsip: Generate progress (once) when receiving a 180 with a SDP

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

By: Friendly Automation (friendly-automation) 2021-03-02 11:22:46.371-0600

Change 15307 merged by Joshua Colp:
pjsip: Generate progress (once) when receiving a 180 with a SDP

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

By: Sven Andersen (gong) 2021-07-13 08:48:43.854-0500

This change seems to be problematic in some situations. I digged a "no ringback-tone"-issue down to this change, reverting fixed it.

Calling T-Mobile germany from o2 germany _sometimes_ (~1 out of 5 times) responds with 180/SDP but actually does not send the expected/announced audio-stream. So there is no indication that the remote party is ringing and suddenly the call is established (If the caller waits long enough and does not hang up due to missing ringback). The other 4 of 5 times the response is just 180 without SDP and all is fine.

Could this be made configurable? Otherwise I would need to patch every new release for myself.

Should I try and submit an according patch (though I am not an asterisk/SIP developer or c-expert so don't expect it to be perfect...)?

By: Joshua C. Colp (jcolp) 2021-07-13 08:58:24.626-0500

A new issue should be opened, referencing this one.