asterisk/res/res_pjsip_pubsub.exports.in
Joshua Colp e33682cae2 res_pjsip_exten_state: Fix race condition between sending NOTIFY and termination
The res_pjsip_exten_state module currently has a race condition between
processing the extension state callback from the PBX core and processing
the subscription shutdown callback from res_pjsip_pubsub. There is currently
no synchronization between the two. This can present a problem as while
the SIP subscription will remain valid the tree it points to may not.
This is in particular a problem as a task to send a NOTIFY may get queued
which will try to use the tree that may no longer be valid.

This change does the following to fix this problem:

1. All access to the subscription tree is done within the task that
sends the NOTIFY to ensure that no other thread is modifying or
destroying the tree. This task executes on the serializer for the
subscriptions.

2. A reference to the subscription serializer is kept to ensure it
remains valid for the lifetime of the extension state subscription.

3. The NOTIFY task has been changed so it will no longer attempt
to send a NOTIFY if the subscription has already been terminated.

ASTERISK-25057 #close
Reported by: Matt Jordan

Change-Id: I0b3cd2fac5be8d9b3dc5e693aaa79846eeaf5643
2015-05-07 07:42:10 -05:00

44 lines
2.2 KiB
Text

{
global:
LINKER_SYMBOL_PREFIXast_sip_create_subscription;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_endpoint;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_serializer;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_evsub;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_dlg;
LINKER_SYMBOL_PREFIXast_sip_subscription_accept;
LINKER_SYMBOL_PREFIXast_sip_subscription_send_request;
LINKER_SYMBOL_PREFIXast_sip_subscription_alloc_datastore;
LINKER_SYMBOL_PREFIXast_sip_subscription_add_datastore;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_datastore;
LINKER_SYMBOL_PREFIXast_sip_subscription_remove_datastore;
LINKER_SYMBOL_PREFIXast_sip_register_subscription_handler;
LINKER_SYMBOL_PREFIXast_sip_unregister_subscription_handler;
LINKER_SYMBOL_PREFIXast_sip_create_publication;
LINKER_SYMBOL_PREFIXast_sip_publication_get_endpoint;
LINKER_SYMBOL_PREFIXast_sip_publication_get_resource;
LINKER_SYMBOL_PREFIXast_sip_publication_get_event_configuration;
LINKER_SYMBOL_PREFIXast_sip_publication_create_response;
LINKER_SYMBOL_PREFIXast_sip_publication_send_response;
LINKER_SYMBOL_PREFIXast_sip_register_publish_handler;
LINKER_SYMBOL_PREFIXast_sip_unregister_publish_handler;
LINKER_SYMBOL_PREFIXast_sip_publication_add_datastore;
LINKER_SYMBOL_PREFIXast_sip_publication_get_datastore;
LINKER_SYMBOL_PREFIXast_sip_publication_remove_datastore;
LINKER_SYMBOL_PREFIXast_sip_publication_remove_datastore;
LINKER_SYMBOL_PREFIXast_sip_pubsub_register_body_generator;
LINKER_SYMBOL_PREFIXast_sip_pubsub_unregister_body_generator;
LINKER_SYMBOL_PREFIXast_sip_pubsub_register_body_supplement;
LINKER_SYMBOL_PREFIXast_sip_pubsub_unregister_body_supplement;
LINKER_SYMBOL_PREFIXast_sip_pubsub_generate_body_content;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_body_type;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_body_subtype;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_resource_name;
LINKER_SYMBOL_PREFIXast_sip_subscription_notify;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_local_uri;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_remote_uri;
LINKER_SYMBOL_PREFIXast_sip_subscription_get_header;
LINKER_SYMBOL_PREFIXast_sip_subscription_is_terminated;
local:
*;
};