36 #ifndef _ASTERISK_MODULE_H 37 #define _ASTERISK_MODULE_H 41 #if defined(__cplusplus) || defined(c_plusplus) 46 #define ASTERISK_GPL_KEY \ 47 "This paragraph is copyright (c) 2006 by Digium, Inc. \ 48 In order for your module to load, it must return this \ 49 key via a function called \"key\". Any code which \ 50 includes this paragraph must be licensed under the GNU \ 51 General Public License version 2 or later (at your \ 52 option). In addition to Digium's general reservations \ 53 of rights, Digium expressly reserves the right to \ 54 allow other parties to license this paragraph under \ 55 different terms. Any use of Digium, Inc. trademarks or \ 56 logos (including \"Asterisk\" or \"Digium\") without \ 57 express written permission of Digium, Inc. is prohibited.\n" 59 #define AST_MODULE_CONFIG "modules.conf" 222 const char *like,
void *data);
240 void *
data,
const char *condition),
241 const char *like,
void *data,
const char *condition);
307 struct ast_module_user_list;
426 #define ast_module_user_add(chan) __ast_module_user_add(AST_MODULE_SELF, chan) 427 #define ast_module_user_remove(user) __ast_module_user_remove(AST_MODULE_SELF, user) 428 #define ast_module_user_hangup_all() __ast_module_user_hangup_all(AST_MODULE_SELF) 443 #define ast_module_ref(mod) __ast_module_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) 455 #define ast_module_running_ref(mod) \ 456 __ast_module_running_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) 464 #define ast_module_shutdown_ref(mod) __ast_module_shutdown_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) 469 #define ast_module_unref(mod) __ast_module_unref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) 471 #if defined(__cplusplus) || defined(c_plusplus) 472 #define AST_MODULE_INFO(keystr, flags_to_set, desc, load_func, unload_func, reload_func, load_pri, support_level) \ 473 static struct ast_module_info __mod_info = { \ 493 static void __attribute__((constructor)) __reg_module(void) \ 495 ast_module_register(&__mod_info); \ 497 static void __attribute__((destructor)) __unreg_module(void) \ 499 ast_module_unregister(&__mod_info); \ 501 struct ast_module *AST_MODULE_SELF_SYM(void) \ 503 return __mod_info.self; \ 505 static const __attribute__((unused)) struct ast_module_info *ast_module_info = &__mod_info 508 #define AST_MODULE_INFO_STANDARD(keystr, desc) \ 509 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 513 AST_MODPRI_DEFAULT, \ 514 AST_MODULE_SUPPORT_CORE \ 517 #define AST_MODULE_INFO_STANDARD_EXTENDED(keystr, desc) \ 518 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 522 AST_MODPRI_DEFAULT, \ 523 AST_MODULE_SUPPORT_EXTENDED \ 525 #define AST_MODULE_INFO_STANDARD_DEPRECATED(keystr, desc) \ 526 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 530 AST_MODPRI_DEFAULT, \ 531 AST_MODULE_SUPPORT_DEPRECATED \ 539 #if !defined(AST_IN_CORE) 543 #define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...) \ 544 static struct ast_module_info \ 546 .name = AST_MODULE, \ 547 .flags = flags_to_set, \ 548 .description = desc, \ 550 .buildopt_sum = AST_BUILDOPT_SUM, \ 553 static void __attribute__((constructor)) __reg_module(void) \ 555 ast_module_register(&__mod_info); \ 557 static void __attribute__((destructor)) __unreg_module(void) \ 559 ast_module_unregister(&__mod_info); \ 561 struct ast_module *AST_MODULE_SELF_SYM(void) \ 563 return __mod_info.self; \ 565 static const struct ast_module_info *ast_module_info = &__mod_info 567 #define AST_MODULE_INFO_STANDARD(keystr, desc) \ 568 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 569 .load = load_module, \ 570 .unload = unload_module, \ 571 .load_pri = AST_MODPRI_DEFAULT, \ 572 .support_level = AST_MODULE_SUPPORT_CORE, \ 575 #define AST_MODULE_INFO_STANDARD_EXTENDED(keystr, desc) \ 576 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 577 .load = load_module, \ 578 .unload = unload_module, \ 579 .load_pri = AST_MODPRI_DEFAULT, \ 580 .support_level = AST_MODULE_SUPPORT_EXTENDED, \ 583 #define AST_MODULE_INFO_STANDARD_DEPRECATED(keystr, desc) \ 584 AST_MODULE_INFO(keystr, AST_MODFLAG_LOAD_ORDER, desc, \ 585 .load = load_module, \ 586 .unload = unload_module, \ 587 .load_pri = AST_MODPRI_DEFAULT, \ 588 .support_level = AST_MODULE_SUPPORT_DEPRECATED, \ 610 #define ast_register_application(app, execute, synopsis, description) ast_register_application2(app, execute, synopsis, description, AST_MODULE_SELF) 626 #define ast_register_application_xml(app, execute) ast_register_application(app, execute, NULL, NULL) 665 #define SCOPED_MODULE_USE(module) \ 666 RAII_VAR(struct ast_module *, __self__ ## __LINE__, ast_module_ref(module), ast_module_unref) 668 #if defined(__cplusplus) || defined(c_plusplus)
static const char synopsis[]
Main Channel structure associated with a channel.
int ast_update_module_list_data(int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data), const char *like, void *data)
Ask for a list of modules, descriptions, use counts and status.
static SQLHSTMT execute(struct odbc_obj *obj, void *data, int silent)
Common execution function for SQL queries.
char * ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, enum ast_module_helper_type type)
Match modules names for the Asterisk cli.
enum ast_module_load_result ast_load_resource(const char *resource_name)
Load a module.
void __ast_module_user_hangup_all(struct ast_module *)
enum ast_module_reload_result ast_module_reload(const char *name)
Reload asterisk modules.
ast_module_reload_result
Possible return types for ast_module_reload.
const char * ast_module_support_level_to_string(enum ast_module_support_level support_level)
void __ast_module_user_remove(struct ast_module *, struct ast_module_user *)
int ast_update_module_list_condition(int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data, const char *condition), const char *like, void *data, const char *condition)
Ask for a list of modules, descriptions, use counts and status.
void ast_update_use_count(void)
Notify when usecount has been changed.
int ast_unregister_application(const char *app)
Unregister an application.
const char * enhances
Modules that we provide enhanced functionality for.
int ast_module_check(const char *name)
Check if module with the name given is loaded.
void ast_module_unregister(const struct ast_module_info *)
const char * optional_modules
Comma-separated list of optionally required modules.
static const struct ast_module_info * ast_module_info
void __ast_module_shutdown_ref(struct ast_module *mod, const char *file, int line, const char *func)
struct ast_module_user * __ast_module_user_add(struct ast_module *, struct ast_channel *)
int ast_loader_unregister(int(*updater)(void))
Remove a procedure to be run when modules are updated.
void __ast_module_unref(struct ast_module *mod, const char *file, int line, const char *func)
int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode)
Unload a module.
struct ast_module * __ast_module_running_ref(struct ast_module *mod, const char *file, int line, const char *func)
Module could not be loaded properly.
Module has failed to load, may be in an inconsistent state.
int ast_loader_register(int(*updater)(void))
Add a procedure to be run when modules have been updated.
const char * ast_module_name(const struct ast_module *mod)
Get the name of a module.
int ast_register_application2(const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
Register an application.
void ast_module_register(const struct ast_module_info *)
union ast_frame::@263 data
enum ast_module_load_result(* load)(void)
enum ast_module_support_level support_level
const char buildopt_sum[33]
struct ast_module * __ast_module_ref(struct ast_module *mod, const char *file, int line, const char *func)
int ast_update_module_list(int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level), const char *like)
Ask for a list of modules, descriptions, use counts and status.