Skip to content
Snippets Groups Projects
user avatar
Maximilian Fridrich authored
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
60b81eab
History
Name Last commit Last update
..
ael
ari
parking
prometheus
res_aeap
res_geolocation
res_pjsip
res_pjsip_session
res_stir_shaken
snmp
srtp
stasis
stasis_recording
Makefile
ari.make
res.xml
res_adsi.c
res_aeap.c
res_aeap.exports.in
res_ael_share.c
res_ael_share.exports.in
res_agi.c
res_agi.exports.in
res_ari.c
res_ari.exports.in
res_ari_applications.c
res_ari_asterisk.c
res_ari_bridges.c
res_ari_channels.c
res_ari_device_states.c
res_ari_endpoints.c
res_ari_events.c
res_ari_mailboxes.c
res_ari_model.c
res_ari_model.exports.in
res_ari_playbacks.c
res_ari_recordings.c
res_ari_sounds.c
res_audiosocket.c
res_audiosocket.exports.in
res_calendar.c
res_calendar.exports.in
res_calendar_caldav.c
res_calendar_ews.c
res_calendar_exchange.c
res_calendar_icalendar.c
res_chan_stats.c
res_clialiases.c
res_cliexec.c
res_clioriginate.c
res_config_curl.c
res_config_ldap.c
res_config_odbc.c
res_config_pgsql.c
res_config_sqlite3.c
res_convert.c
res_corosync.c
res_crypto.c
res_crypto.exports.in
res_curl.c
res_endpoint_stats.c
res_fax.c
res_fax.exports.in
res_fax_spandsp.c
res_format_attr_celt.c
res_format_attr_g729.c
res_format_attr_h263.c
res_format_attr_h264.c
res_format_attr_ilbc.c
res_format_attr_opus.c
res_format_attr_silk.c
res_format_attr_siren14.c
res_format_attr_siren7.c
res_format_attr_vp8.c
res_geolocation.c
res_geolocation.exports.in
res_hep.c
res_hep.exports.in
res_hep_pjsip.c
res_hep_rtcp.c
res_http_media_cache.c
res_http_post.c
res_http_websocket.c
res_http_websocket.exports.in
res_limit.c
res_manager_devicestate.c
res_manager_presencestate.c
res_monitor.c
res_monitor.exports.in
res_musiconhold.c
res_mutestream.c
res_mwi_devstate.c
res_mwi_external.c
res_mwi_external.exports.in
res_mwi_external_ami.c
res_odbc.c
res_odbc.exports.in
res_odbc_transaction.c
res_odbc_transaction.exports.in
res_parking.c