Skip to content
Snippets Groups Projects
user avatar
Mike Bradeen authored
There are two main parts of the change associated with this
commit. These are driven by the change in call order of
pubsub_on_rx_refresh and pubsub_on_evsub_state by pjproject
when an in-dialog SUBSCRIBE is received.

First, the previous behavior was for pjproject to call
pubsub_on_rx_refresh before calling pubsub_on_evsub_state
when an in-dialog SUBSCRIBE was received that changes the
subscription state.

If that change was a termination due to a re-SUBSCRIBE with
an expires of 0, we used to use the call to pubsub_on_rx_refresh
to set the substate of the evsub to TERMINATE_PENDING before
pjproject could call pubsub_on_evsub_state.

This substate let pubsub_on_evsub_state know that the
subscription TERMINATED event could be ignored as there was
still a subsequent NOTIFY that needed to be generated and
another call to pubsub_on_evsub_state to come with it.

That NOTIFY was sent via serialized_pubsub_on_refresh_timeout
which would see the TERMINATE_PENDING state and transition it
to TERMINATE_IN_PROGRESS before triggering another call to
pubsub_on_evsub_state (which now would clean up the evsub.)

The new pjproject behavior is to call pubsub_on_evsub_state
before pubsub_on_rx_refresh. This means we no longer can set
the state to TERMINATE_PENDING to tell pubsub_on_evsub_state
that it can ignore the first TERMINATED event.

To handle this, we now look directly at the event type,
method type and the expires value to determine whether we
want to ignore the event or use it to trigger the evsub
cleanup.

Second, pjproject now expects the NOTIFY to actually be sent
during pubsub_on_rx_refresh and avoids the protocol violation
inherent in sending a NOTIFY before the SUBSCRIBE is
acknowledged by caching the sent NOTIFY then sending it
after responding to the SUBSCRIBE.

This requires we send the NOTIFY using the non-serialized
pubsub_on_refresh_timeout directly and let pjproject handle
the protocol violation.

ASTERISK-30469

Change-Id: I05c1d91a44fe28244ae93faa4a2268a3332b5fd7
f8dfbaf2
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