mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-11 15:18:38 +00:00
res_pjsip_registrar: blocked threads on reliable transport shutdown take 3
When a contact was removed by the registrar it did not always check to see if the circumstances involved a monitored reliable transport. For instance, if the 'remove_existing' option was set to 'true' then when existing contacts were removed due to 'max_contacts' being reached, those existing contacts being removed did not unregister the transport monitor. Also, it was possible to add more than one monitor on a reliable transport for a given aor and contact. This patch makes it so all contact removals done by the registrar also remove any associated transport monitors if necessary. It also makes it so duplicate monitors cannot be added for a given transport. ASTERISK-28213 Change-Id: I94b06f9026ed177d6adfd538317c784a42c1b17a
This commit is contained in:
@@ -3142,6 +3142,29 @@ enum ast_transport_monitor_reg {
|
||||
enum ast_transport_monitor_reg ast_sip_transport_monitor_register(pjsip_transport *transport,
|
||||
ast_transport_monitor_shutdown_cb cb, void *ao2_data);
|
||||
|
||||
/*!
|
||||
* \brief Register a reliable transport shutdown monitor callback replacing any duplicate.
|
||||
* \since 13.26.0
|
||||
* \since 16.3.0
|
||||
*
|
||||
* \param transport Transport to monitor for shutdown.
|
||||
* \param cb Who to call when transport is shutdown.
|
||||
* \param ao2_data Data to pass with the callback.
|
||||
* \param matches Matcher function that returns true if data matches a previously
|
||||
* registered data object
|
||||
*
|
||||
* \note The data object passed will have its reference count automatically
|
||||
* incremented by this call and automatically decremented after the callback
|
||||
* runs or when the callback is unregistered.
|
||||
*
|
||||
* This function checks for duplicates, and overwrites/replaces the old monitor
|
||||
* with the given one.
|
||||
*
|
||||
* \return enum ast_transport_monitor_reg
|
||||
*/
|
||||
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace(pjsip_transport *transport,
|
||||
ast_transport_monitor_shutdown_cb cb, void *ao2_data, ast_transport_monitor_data_matcher matches);
|
||||
|
||||
/*!
|
||||
* \brief Unregister a reliable transport shutdown monitor
|
||||
* \since 13.20.0
|
||||
|
Reference in New Issue
Block a user