]> git.ipfire.org Git - thirdparty/asterisk.git/commit
loader.c: Allow dependent modules to be unloaded recursively.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 2 Dec 2023 23:07:02 +0000 (18:07 -0500)
committerNaveen Albert <asterisk@phreaknet.org>
Tue, 30 Apr 2024 14:14:08 +0000 (14:14 +0000)
commitc276ae11e0c0769b030f509164ad39f4c484d6c3
tree5532f8a1093bd81c08e1d6a204baf275c87eb63b
parentd74266fe054b09348e39d1987a7c611d4225221e
loader.c: Allow dependent modules to be unloaded recursively.

Because of the (often recursive) nature of module dependencies in
Asterisk, hot swapping a module on the fly is cumbersome if a module
is depended on by other modules. Currently, dependencies must be
popped manually by unloading dependents, unloading the module of
interest, and then loading modules again in reverse order.

To make this easier, the ability to do this recursively in certain
circumstances has been added, as an optional extension to the
"module refresh" command. If requested, Asterisk will check if a module
that has a positive usecount could be unloaded safely if anything
recursively dependent on it were unloaded. If so, it will go ahead
and unload all these modules and load them back again. This makes
hot swapping modules that provide dependencies much easier.

Resolves: #474

UserNote: In certain circumstances, modules with dependency relations
can have their dependents automatically recursively unloaded and loaded
again using the "module refresh" CLI command or the ModuleLoad AMI command.
include/asterisk/module.h
main/cli.c
main/loader.c
main/manager.c