summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-09-23 12:03:18 +0000
committerJoshua Colp <jcolp@digium.com>2013-09-23 12:03:18 +0000
commit85d6db6cbe9974291cabe5de70de03f310de058c (patch)
tree401307c29d2a8cce8598adb478bfe6bc1cf05dca /res/res_pjsip_session.c
parentec5a72471465ec8a2661cea9d40184e6e9d1b33b (diff)
Fix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip and res_pjsip_session.
During load time in res_pjsip if an error occurred the operation would attempt to rollback all operations done during load. This is not permitted by PJSIP as it will assert if the operation has not been done. This fix changes the code so it will only rollback what has been initialized already. Further changes also prevent res_pjsip and res_pjsip_session from being unloaded. This is due to limitations within PJSIP itself. The library environment can only be changed to a certain extent and does not provide the ability, currently, to deinitialize certain required functionality. (closes issue ASTERISK-22474) Reported by: Corey Farrell ........ Merged revisions 399624 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index c6c395361..cac4c2fc5 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2134,17 +2134,15 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
ast_sip_register_service(&session_reinvite_module);
+
+ ast_module_ref(ast_module_info->self);
+
return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
{
- ast_sip_unregister_service(&session_module);
- ast_sip_unregister_service(&session_reinvite_module);
- if (nat_hook) {
- ast_sorcery_delete(ast_sip_get_sorcery(), nat_hook);
- nat_hook = NULL;
- }
+ /* This will never get called as this module can't be unloaded */
return 0;
}