[Asterisk-code-review] core & res_pjsip: Improve topology change handling. (asterisk[16])

Maximilian Fridrich asteriskteam at digium.com
Thu Sep 8 04:30:28 CDT 2022


Hello Friendly Automation, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/c/asterisk/+/19059

to look at the new patch set (#2).

Change subject: core & res_pjsip: Improve topology change handling.
......................................................................

core & res_pjsip: Improve topology change handling.

This PR contains two relatively separate changes in channel.c and
res_pjsip_session.c which ensure that topology changes are not ignored
in cases where they should be handled.

For channel.c:

The function ast_channel_request_stream_topology_change only triggers a
stream topology request change indication, if the channel's topology
does not equal the requested topology. However, a channel could be in a
state where it is currently "negotiating" a new topology but hasn't
updated it yet, so the topology request change would be lost. Channels
need to be able to handle such situations internally and stream
topology requests should therefore always be passed on.

In the case of chan_pjsip for example, it queues a session refresh
(re-INVITE) if it is currently in the middle of a transaction or has
pending requests (among other reasons).

Now, ast_channel_request_stream_topology_change always indicates a
stream topology request change even if the requested topology equals the
channel's topology.

For res_pjsip_session.c:

The function resolve_refresh_media_states does not process stream state
changes if the delayed active state differs from the current active
state. I.e. if the currently active stream state has changed between the
time the sip session refresh request was queued and the time it is being
processed, the session refresh is ignored. However, res_pjsip_session
contains logic that ensures that session refreshes are queued and
re-queued correctly if a session refresh is currently not possible. So
this check is not necessary and led to some session refreshes being
lost.

Now, a session refresh is done even if the delayed active state differs
from the current active state and it is checked whether the delayed
pending state differs from the current active - because that means a
refresh is necessary.

Further, the unit test of resolve_refresh_media_states was adapted to
reflect the new behavior. I.e. the changes to delayed pending are
prioritized over the changes to current active because we want to
preserve the original intention of the pending state.

ASTERISK-30184

Change-Id: Icd0703295271089057717006730b555b9a1d4e5a
---
M main/channel.c
M res/res_pjsip_session.c
2 files changed, 62 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/19059/2
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19059
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Icd0703295271089057717006730b555b9a1d4e5a
Gerrit-Change-Number: 19059
Gerrit-PatchSet: 2
Gerrit-Owner: Maximilian Fridrich <m.fridrich at commend.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220908/6bbe2337/attachment.html>


More information about the asterisk-code-review mailing list