Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Go to the source code of this file.
Macros | |
#define | _ASTERISK_PHONEPROV_H |
Typedefs | |
typedef int(* | ast_phoneprov_load_users_cb) (void) |
Causes the provider to load its users. More... | |
Functions | |
int | ast_phoneprov_add_extension (char *provider_name, struct varshead *vars) |
Adds an extension. More... | |
void | ast_phoneprov_delete_extension (char *provider_name, char *macaddress) |
Deletes an extension. More... | |
void | ast_phoneprov_delete_extensions (char *provider_name) |
Deletes all extensions for this provider. More... | |
int | ast_phoneprov_provider_register (char *provider_name, ast_phoneprov_load_users_cb load_users) |
Registers a config provider to phoneprov. More... | |
void | ast_phoneprov_provider_unregister (char *provider_name) |
Unegisters a config provider from phoneprov and frees its resources. More... | |
const char * | ast_phoneprov_std_variable_lookup (enum ast_phoneprov_std_variables var) |
Returns the string respresentation of a phoneprov standard variable. More... | |
#define _ASTERISK_PHONEPROV_H |
Definition at line 24 of file phoneprov.h.
typedef int(* ast_phoneprov_load_users_cb) (void) |
Causes the provider to load its users.
This function is called by phoneprov in response to a ast_phoneprov_provider_register call by the provider. It may also be called by phoneprov to request a reload in response to the res_phoneprov module being reloaded.
0 | if successful |
non-zero | if failure |
Definition at line 75 of file phoneprov.h.
Definition at line 29 of file phoneprov.h.
int ast_phoneprov_add_extension | ( | char * | provider_name, |
struct varshead * | vars | ||
) |
Adds an extension.
provider_name | The name of the provider |
vars | An ast_vat_t linked list of the extension's variables. The list is automatically cloned and it must contain at least MACADDRESS and USERNAME entries. |
0 | if successful |
non-zero | if failure |
Definition at line 1633 of file res_phoneprov.c.
References add_user_extension(), ao2_cleanup, ao2_link, ast_log, AST_PHONEPROV_STD_MAC, AST_PHONEPROV_STD_PROFILE, AST_PHONEPROV_STD_USERNAME, ast_strlen_zero(), ast_var_find(), build_extension(), build_user(), build_user_routes(), delete_extension(), find_profile(), find_provider(), find_user(), LOG_ERROR, LOG_WARNING, user::macaddress, extension::name, NULL, user::profile, provider, user::provider_name, RAII_VAR, and variable_lookup.
Referenced by load_users(), and users_apply_handler().
void ast_phoneprov_delete_extension | ( | char * | provider_name, |
char * | macaddress | ||
) |
Deletes an extension.
provider_name | The name of the provider |
macaddress | The mac address of the extension |
Definition at line 1604 of file res_phoneprov.c.
References ao2_callback_data, extension_delete_cb(), user::macaddress, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, and user::provider_name.
Referenced by phoneprov_destroy().
void ast_phoneprov_delete_extensions | ( | char * | provider_name | ) |
Deletes all extensions for this provider.
provider_name | The name of the provider |
Definition at line 1614 of file res_phoneprov.c.
References ao2_callback, extensions_delete_cb(), OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and user::provider_name.
Referenced by ast_phoneprov_provider_unregister().
int ast_phoneprov_provider_register | ( | char * | provider_name, |
ast_phoneprov_load_users_cb | load_users | ||
) |
Registers a config provider to phoneprov.
provider_name | The name of the provider |
load_users | Callback that gathers user variables then loads them by calling ast_phoneprov_add_extension once for each extension. |
0 | if successful |
non-zero | if failure |
Definition at line 1533 of file res_phoneprov.c.
References ao2_alloc, ao2_link, ao2_ref, ast_log, ast_phoneprov_provider_unregister(), ast_string_field_init, ast_string_field_set, ast_strlen_zero(), find_provider(), load_users(), LOG_ERROR, LOG_WARNING, provider, provider_destructor(), phoneprov_provider::provider_name, and providers.
Referenced by load_module(), and reload_module().
void ast_phoneprov_provider_unregister | ( | char * | provider_name | ) |
Unegisters a config provider from phoneprov and frees its resources.
provider_name | The name of the provider |
Definition at line 1623 of file res_phoneprov.c.
References ao2_find, ast_phoneprov_delete_extensions(), OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, user::provider_name, and providers.
Referenced by ast_phoneprov_provider_register(), reload_module(), and unload_module().
const char * ast_phoneprov_std_variable_lookup | ( | enum ast_phoneprov_std_variables | var | ) |
Returns the string respresentation of a phoneprov standard variable.
var | One of enum ast_phoneprov_std_variables |
Definition at line 1524 of file res_phoneprov.c.
References AST_PHONEPROV_STD_VAR_LIST_LENGTH, NULL, var, and variable_lookup.
Referenced by load_endpoint(), and users_apply_handler().