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
This commit is contained in:
Joshua Colp
2013-09-23 12:03:18 +00:00
parent ec5a724714
commit 85d6db6cbe
2 changed files with 58 additions and 60 deletions

View File

@@ -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;
}