[Home]

Summary:ASTERISK-30184: res_pjsip_session: re-INVITE after answering results in wrong stream direction of first call leg
Reporter:Maximilian Fridrich (mfridrich)Labels:
Date Opened:2022-08-17 06:03:41Date Closed:2022-11-29 08:23:59.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_pjsip Resources/res_pjsip Resources/res_pjsip_session
Versions:18.13.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) ASTERISK-30184.pcapng
( 1) ASTERISK-30184-fixed-with-delay.pcapng
( 2) debug_log_30184.txt
Description:Using the Dial application, when the outgoing call leg receives a 200 from the callee answering the call, and then immediately after receives a re-INVITE from the callee updating a media stream direction, Asterisk does not correctly update the media stream of the first call leg (to the caller). Asterisk does send multiple re-INVITES to the first call leg but the last one does not contain the correct stream directions from the re-INVITE.

When sending the re-INVITE with some delay (e.g. 500ms), Asterisk correctly updates the stream direction of the first call leg (see attached traces).
Comments:By: Asterisk Team (asteriskteam) 2022-08-17 06:03:45.181-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: Maximilian Fridrich (mfridrich) 2022-08-17 08:02:56.986-0500

I am trying to solve the issue but I am facing some difficulties. Some observations I have made:

* Many re-INVITES (session refreshes) are sent to the first call leg after answering. The sources of those re-INVITES seem to be:
** {{bridge_simple.c:simple_bridge_join()}}: The incoming channel was in held state, so an unhold is indicated ( -> session refresh).
** {{bridge_simple.c:simple_bridge_join()}}: Requests a stream topology change.
** Possibly {{chan_pjsip.c:update_connected_line()}} which is called.

It looks like re-INVITES are being delayed and are sent when the initial INVITE transaction has terminated. It seems like the delayed requests do not contain what we expect - I would expect the re-INVITE triggered by the topology change of the re-INVITE by the callee to be the last one in the queue of delayed requests.

I am quite confused how Asterisk ended up in this situation and I would be thankful for any help/ideas on what could have gone wrong or where I should look at. Thank you.

By: Friendly Automation (friendly-automation) 2022-11-29 08:24:00.641-0600

Change 19585 merged by Friendly Automation:
core & res_pjsip: Improve topology change handling.

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

By: Friendly Automation (friendly-automation) 2022-11-29 08:27:17.624-0600

Change 19588 merged by Friendly Automation:
core & res_pjsip: Improve topology change handling.

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

By: Friendly Automation (friendly-automation) 2022-11-29 16:35:40.900-0600

Change 19059 merged by Friendly Automation:
core & res_pjsip: Improve topology change handling.

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