res_pjsip: Refactor load_module/unload_module
authorGeorge Joseph <george.joseph@fairview5.com>
Tue, 9 Feb 2016 23:34:05 +0000 (16:34 -0700)
committerGeorge Joseph <george.joseph@fairview5.com>
Fri, 12 Feb 2016 02:05:11 +0000 (19:05 -0700)
commitb37555cc94d1f82365116e6555a214f15e3f0a0d
tree7359ed20f84752c9ef018ea2da424dc7b5842c13
parenta39486552efb30ca4067d0b8e919ed03f332b4af
res_pjsip:  Refactor load_module/unload_module

load_module was just too hairy with every step having to clean up all
previous steps on failure.

Some of the pjproject init calls have now been moved to a separate
load_pjsip function and the unload_pjsip function was enhanced to clean
up everything if an error happened at any stage of the load process.

In the process, a bunch of missing pj_shutdowns, serializer_pool_shutdowns
and ast_threadpool_shutdowns were also corrected.

Change-Id: I5eec711b437c35b56605ed99537ebbb30463b302
res/res_pjsip.c
res/res_pjsip/pjsip_configuration.c