diff options
author | Kevin Harwell <kharwell@digium.com> | 2015-01-14 23:14:47 +0000 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2015-01-14 23:14:47 +0000 |
commit | 77a036bf3f23c67bb57bd93a348c1bf468d6e1c5 (patch) | |
tree | 6d31c57489c8fb78ec02809a7b3e203e79bf135b /res/res_pjsip/pjsip_global_headers.c | |
parent | e370c9e68e802708f18dd5c4f0abd2cb690bd287 (diff) |
res_pjsip: make it unloadable
The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.
This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.
This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.
The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.
Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.
ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4311/
patches:
pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/pjsip_global_headers.c')
-rw-r--r-- | res/res_pjsip/pjsip_global_headers.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_pjsip/pjsip_global_headers.c b/res/res_pjsip/pjsip_global_headers.c index eff870314..fc7226761 100644 --- a/res/res_pjsip/pjsip_global_headers.c +++ b/res/res_pjsip/pjsip_global_headers.c @@ -23,6 +23,7 @@ #include "asterisk/res_pjsip.h" #include "asterisk/linkedlists.h" +#include "include/res_pjsip_private.h" static pj_status_t add_request_headers(pjsip_tx_data *tdata); static pj_status_t add_response_headers(pjsip_tx_data *tdata); @@ -151,7 +152,7 @@ void ast_sip_initialize_global_headers(void) AST_RWLIST_HEAD_INIT(&request_headers); AST_RWLIST_HEAD_INIT(&response_headers); - ast_sip_register_service(&global_header_mod); + internal_sip_register_service(&global_header_mod); } static void destroy_headers(struct header_list *headers) @@ -168,4 +169,6 @@ void ast_sip_destroy_global_headers(void) { destroy_headers(&request_headers); destroy_headers(&response_headers); + + internal_sip_unregister_service(&global_header_mod); } |