diff options
author | Richard Mudgett <rmudgett@digium.com> | 2017-07-28 18:26:17 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-08-10 12:18:58 -0500 |
commit | 1dcb92bba89440fff3454670ed5f892da157bf27 (patch) | |
tree | bfea5b5fcb09477570d4e6d728661c8ba3b3407b /res/res_pjsip.c | |
parent | ee5edfb050f8bfff7a28ba716d70ee479929ce56 (diff) |
res_pjsip: PJSIP Transport state monitor refactor.
The fix for the issue is broken up into three parts.
This is part one which refactors the transport state monitor code to allow
more modules to be able to monitor transports.
* Pull the management of PJPROJECT's transport state callback code from
res_pjsip_transport_management.c into res_pjsip. Now other modules can
dynamically add and remove themselves from transport monitoring without
worrying about breaking PJPROJECT's callback chain.
* Add the ability for other modules to get a callback whenever a specific
transport is shutdown.
ASTERISK-27147
Change-Id: I7d9a31371eb1487c9b7050cf82a9af5180a57912
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index f3648acdb..2917df3c5 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -4662,6 +4662,7 @@ static int unload_pjsip(void *data) ast_sip_destroy_system(); ast_sip_destroy_global_headers(); internal_sip_unregister_service(&supplement_module); + ast_sip_destroy_transport_events(); } if (monitor_thread) { @@ -4740,7 +4741,6 @@ static int load_pjsip(void) return AST_MODULE_LOAD_SUCCESS; error: - unload_pjsip(NULL); return AST_MODULE_LOAD_DECLINE; } @@ -4806,6 +4806,11 @@ static int load_module(void) goto error; } + if (ast_sip_initialize_transport_events()) { + ast_log(LOG_ERROR, "Failed to initialize SIP transport monitor. Aborting load\n"); + goto error; + } + ast_sip_initialize_dns(); ast_sip_initialize_global_headers(); |