Asterisk - The Open Source Telephony Project  21.4.1
Data Fields
ast_module_info Struct Reference

Data Fields

const char buildopt_sum [33]
 
const char * description
 
const char * enhances
 Modules that we provide enhanced functionality for. More...
 
unsigned int flags
 
const char * key
 
enum ast_module_load_result(* load )(void)
 
unsigned char load_pri
 
const char * name
 
const char * optional_modules
 Comma-separated list of optionally required modules. More...
 
int(* reload )(void)
 
const char * requires
 
void * reserved1
 
void * reserved2
 
void * reserved3
 
void * reserved4
 
struct ast_moduleself
 
enum ast_module_support_level support_level
 
int(* unload )(void)
 

Detailed Description

Definition at line 350 of file module.h.

Field Documentation

const char buildopt_sum[33]

The value of AST_BUILDOPT_SUM when this module was compiled

Definition at line 377 of file module.h.

const char* description

User friendly description of the module.

Definition at line 366 of file module.h.

Referenced by ast_module_reload(), and ast_update_module_list_data().

const char* enhances

Modules that we provide enhanced functionality for.

This is similar to a "requires" but specifies that we add functionality to the other modules. Any module that requires something we "enhances" will also require us, but only if we are dlopen'ed.

Example:

  • res_fax_spandsp has .enhances = "res_fax".
  • res_my_module has .requires = "res_fax" but has no direct knowledge of res_fax_spandsp.

This forces the following startup order among the 3 modules: 1) res_fax starts. 2) res_fax_spandsp starts, holds a reference to res_fax. 3) res_mymod starts, holds a reference to res_fax and res_fax_spandsp.

If res_fax_spandsp were not being loaded res_mymod would load with res_fax only. If res_fax_spandsp were later loaded res_mymod would get a reference to it.

Definition at line 420 of file module.h.

const char* key

This holds the ASTERISK_GPL_KEY, signifying that you agree to the terms of the Asterisk license as stated in the ASTERISK_GPL_KEY. Your module will not load if it does not return the EXACT key string.

Definition at line 373 of file module.h.

enum ast_module_load_result(* load) (void)

Register stuff etc. Optional.

Definition at line 358 of file module.h.

unsigned char load_pri

This value represents the order in which a module's load() function is initialized. The lower this value, the higher the priority. The value is only checked if the AST_MODFLAG_LOAD_ORDER flag is set. If the AST_MODFLAG_LOAD_ORDER flag is not set, this value will never be read and the module will be given the lowest possible priority on load.

Definition at line 384 of file module.h.

const char* name

Name of the module for loader reference and CLI commands

Definition at line 364 of file module.h.

Referenced by PathSegment::__init__(), ast_module_name(), and PathSegment::get_child().

const char* optional_modules

Comma-separated list of optionally required modules.

The listed modules are optional, but load order is enforced. For example app_voicemail optionally requires res_adsi. This means that app_voicemail will happily load without res_adsi, but if both are being loaded the module loader will force res_adsi to start first.

Definition at line 397 of file module.h.

int(* reload) (void)

Config etc. Optional.

Definition at line 360 of file module.h.

Referenced by ast_module_reload().

const char* requires

Modules which must always be started first, in comma-separated string format.

Definition at line 387 of file module.h.

void* reserved1

These reserved fields should be NULL, they exist to allow addition to this structure in a non-breaking way.

Definition at line 424 of file module.h.

struct ast_module* self

The 'self' pointer for a module; it will be set by the loader before it calls the module's load_module() entrypoint, and used by various other macros that need to identify the module.

Definition at line 356 of file module.h.

Referenced by ast_iax2_new(), iax2_predestroy(), instance_created_observer(), instance_destroying_observer(), and load_module().

enum ast_module_support_level support_level

The support level for the given module

Definition at line 430 of file module.h.

Referenced by ast_update_module_list_data(), and load_modules().

int(* unload) (void)

Unload. called with the module locked

Definition at line 362 of file module.h.

Referenced by auto_unload_resource(), and modules_shutdown().


The documentation for this struct was generated from the following file: