Add missing OPTIONAL_API and ARI dependences.
I've audited all modules that include any header which includes asterisk/optional_api.h. All modules which use OPTIONAL_API now declare those dependencies in AST_MODULE_INFO using requires or optional_modules as appropriate. In addition ARI dependency declarations have been reworked. Instead of declaring additional required modules in res/ari/resource_*.c we now add them to an optional array "requiresModules" in api-docs for each module. This allows the AST_MODULE_INFO dependencies to include those missing modules. Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606
This commit is contained in:
parent
908e39f186
commit
679fa5fb34
|
@ -1556,4 +1556,9 @@ static int load_module(void)
|
|||
return res;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mixed Audio Monitoring Application");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Mixed Audio Monitoring Application",
|
||||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.optional_modules = "func_periodic_hook",
|
||||
);
|
||||
|
|
|
@ -420,4 +420,9 @@ static int load_module(void)
|
|||
return ast_register_application_xml(app, statsd_exec);
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "StatsD Dialplan Application");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "StatsD Dialplan Application",
|
||||
.support_level = AST_MODULE_SUPPORT_EXTENDED,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_statsd",
|
||||
);
|
||||
|
|
|
@ -519,4 +519,9 @@ static int load_module(void)
|
|||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Built in bridging features");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Built in bridging features",
|
||||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.optional_modules = "res_monitor",
|
||||
);
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_answer</depend>
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<depend type="module">res_stasis_snoop</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_device_state</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_http_websocket</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_mailbox</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -1579,5 +1581,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Bri
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_recording,res_stasis_playback",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_answer</depend>
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<depend type="module">res_stasis_snoop</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -2869,5 +2873,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Cha
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_answer,res_stasis_playback,res_stasis_recording,res_stasis_snoop",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_device_state</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -349,5 +350,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Dev
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_device_state",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_http_websocket</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -473,5 +474,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Web
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_http_websocket",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_mailbox</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -355,5 +356,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Mai
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_mailbox",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_playback</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -307,5 +308,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Pla
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_playback",
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
<depend type="module">res_stasis_recording</depend>
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -891,5 +892,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Rec
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis,res_stasis_recording",
|
||||
);
|
||||
|
|
|
@ -1013,4 +1013,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
|
|||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
||||
.optional_modules = "func_periodic_hook",
|
||||
);
|
||||
|
|
|
@ -5139,4 +5139,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
|
|||
.reload = reload_module,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND - 5,
|
||||
.requires = "res_pjproject",
|
||||
.optional_modules = "res_statsd",
|
||||
);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "asterisk/acl.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "include/res_pjsip_private.h"
|
||||
/* We're only using a #define from http_websocket.h, no OPTIONAL_API symbols are used. */
|
||||
#include "asterisk/http_websocket.h"
|
||||
|
||||
#define MAX_POINTER_STRING 33
|
||||
|
|
|
@ -2290,4 +2290,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Outbound Regist
|
|||
.unload = unload_module,
|
||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
||||
.requires = "res_pjsip",
|
||||
.optional_modules = "res_statsd",
|
||||
);
|
||||
|
|
|
@ -381,13 +381,13 @@ static int reload_module(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* The priority of this module is set to be as low as possible, since it could
|
||||
* be used by any other sort of module.
|
||||
/* The priority of this module is set just after realtime, since it loads
|
||||
* configuration and could be used by any other sort of module.
|
||||
*/
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "Statsd client support",
|
||||
.support_level = AST_MODULE_SUPPORT_EXTENDED,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.reload = reload_module,
|
||||
.load_pri = 0,
|
||||
.load_pri = AST_MODPRI_REALTIME_DRIVER + 5,
|
||||
);
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<depend type="module">res_ari</depend>
|
||||
<depend type="module">res_ari_model</depend>
|
||||
<depend type="module">res_stasis</depend>
|
||||
{{#requires_modules}}
|
||||
<depend type="module">{{.}}</depend>
|
||||
{{/requires_modules}}
|
||||
<support_level>core</support_level>
|
||||
***/
|
||||
|
||||
|
@ -324,6 +327,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - {{{
|
|||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_ari,res_ari_model,res_stasis",
|
||||
.requires = "res_ari,res_ari_model,res_stasis{{#requires_modules}},{{.}}{{/requires_modules}}",
|
||||
);
|
||||
{{/api_declaration}}
|
||||
|
|
|
@ -647,6 +647,7 @@ class ApiDeclaration(Stringify):
|
|||
self.api_version = api_decl_json.get('apiVersion')
|
||||
self.base_path = api_decl_json.get('basePath')
|
||||
self.resource_path = api_decl_json.get('resourcePath')
|
||||
self.requires_modules = api_decl_json.get('requiresModules') or []
|
||||
api_json = api_decl_json.get('apis') or []
|
||||
self.apis = [
|
||||
Api().load(j, processor, context) for j in api_json]
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/bridges.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_recording",
|
||||
"res_stasis_playback"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/bridges",
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/channels.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_answer",
|
||||
"res_stasis_playback",
|
||||
"res_stasis_recording",
|
||||
"res_stasis_snoop"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/channels",
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/deviceStates.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_device_state"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/deviceStates",
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
"swaggerVersion": "1.2",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/events.{format}",
|
||||
"requiresModules": [
|
||||
"res_http_websocket"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/events",
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/mailboxes.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_mailbox"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/mailboxes",
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/playbacks.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_playback"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/playbacks/{playbackId}",
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
"swaggerVersion": "1.1",
|
||||
"basePath": "http://localhost:8088/ari",
|
||||
"resourcePath": "/api-docs/recordings.{format}",
|
||||
"requiresModules": [
|
||||
"res_stasis_recording"
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"path": "/recordings/stored",
|
||||
|
|
|
@ -646,4 +646,9 @@ static int load_module(void)
|
|||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Utils test module");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Utils test module",
|
||||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_agi,res_crypto",
|
||||
);
|
||||
|
|
|
@ -156,4 +156,9 @@ static int unload_module(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Websocket client test module");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Websocket client test module",
|
||||
.support_level = AST_MODULE_SUPPORT_CORE,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.requires = "res_http_websocket",
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue