summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-03-26 17:47:42 +0000
committerCorey Farrell <git@cfware.com>2015-03-26 17:47:42 +0000
commitd7fc85e69d5dc23f27ec15dacaa03914ece64e42 (patch)
tree8e4a2663b0d01cf19a79040f0080296e7a5a96e5 /res/res_pjsip_session.c
parentab674f67b515e78ae73237cf500236135f7ebd21 (diff)
res_pjsip: Enable unload of all modules at shutdown.
* Move most of res_pjsip:module_unload to unload_pjsip to resolve crashes caused by running PJSIP functions from non-PJSIP threads. * Remove call to pjsip_endpt_destroy(ast_pjsip_endpoint), it was causing crashes in some cases. In theory pj_shutdown() should take care of this. * Mark res_pjsip_keepalive and res_pjsip_session as allowed to unload at shutdown. * Resolve leaked config global in res_pjsip_notify. * Unregister pubsub pjsip service module. * Implement cleanup for res_pjsip_session. ASTERISK-24731 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4498/ ........ Merged revisions 433469 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 865483a09..4854c51d0 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2641,14 +2641,18 @@ static int load_module(void)
}
ast_sip_register_service(&session_reinvite_module);
- ast_module_ref(ast_module_info->self);
+ ast_module_shutdown_ref(ast_module_info->self);
return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
{
- /* This will never get called as this module can't be unloaded */
+ ast_sip_unregister_service(&session_reinvite_module);
+ ast_sip_unregister_service(&session_module);
+ ast_sorcery_delete(ast_sip_get_sorcery(), nat_hook);
+ ao2_cleanup(nat_hook);
+ ao2_cleanup(sdp_handlers);
return 0;
}