Prevent unload of modules which implement an Optional API.

Once an Optional API module is loaded it should stay loaded.  Unloading
an optional API module runs the risk of a crash if something else is
using it.  This patch causes all optional API providers to tell the
module loader not to unload except at shutdown.

ASTERISK-27389

Change-Id: Ia07786fe655681aec49cc8d3d96e06483b11f5e6
This commit is contained in:
Corey Farrell
2017-11-01 20:46:11 -04:00
parent 64f1294ef2
commit 79f111e1f3
7 changed files with 26 additions and 0 deletions

View File

@@ -1446,6 +1446,9 @@ static int load_module(void)
ast_http_uri_link(&websocketuri);
websocket_add_protocol_internal("echo", websocket_echo_callback);
/* For Optional API. */
ast_module_shutdown_ref(AST_MODULE_SELF);
return 0;
}