Asterisk - The Open Source Telephony Project GIT-master-a358458
phoneprov.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2014 - Fairview 5 Engineering, LLC
5 *
6 * George Joseph <george.joseph@fairview5.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#ifndef _ASTERISK_PHONEPROV_H
24#define _ASTERISK_PHONEPROV_H
25
26#include "asterisk.h"
27#include "asterisk/inline_api.h"
28
53 AST_PHONEPROV_STD_VAR_LIST_LENGTH, /* This entry must always be the last in the list */
54};
55
56/*!
57 * \brief Returns the string respresentation of a phoneprov standard variable.
58 * \param var One of enum ast_phoneprov_std_variables
59 *
60 * \return The string representation or NULL if not found.
61 */
63
64/*!
65 * \brief Causes the provider to load its users.
66 *
67 * This function is called by phoneprov in response to a
68 * ast_phoneprov_provider_register call by the provider.
69 * It may also be called by phoneprov to request a reload in
70 * response to the res_phoneprov module being reloaded.
71 *
72 * \retval 0 if successful
73 * \retval non-zero if failure
74 */
75typedef int(*ast_phoneprov_load_users_cb)(void);
76
77/*!
78 * \brief Registers a config provider to phoneprov.
79 * \param provider_name The name of the provider
80 * \param load_users Callback that gathers user variables then loads them by
81 * calling ast_phoneprov_add_extension once for each extension.
82 *
83 * \retval 0 if successful
84 * \retval non-zero if failure
85 */
86int ast_phoneprov_provider_register(char *provider_name,
88
89/*!
90 * \brief Unegisters a config provider from phoneprov and frees its resources.
91 * \param provider_name The name of the provider
92 */
93void ast_phoneprov_provider_unregister(char *provider_name);
94
95/*!
96 * \brief Adds an extension
97 * \param provider_name The name of the provider
98 * \param vars An ast_vat_t linked list of the extension's variables.
99 * The list is automatically cloned and it must contain at least MACADDRESS
100 * and USERNAME entries.
101 *
102 * \retval 0 if successful
103 * \retval non-zero if failure
104 */
105int ast_phoneprov_add_extension(char *provider_name, struct varshead *vars);
106
107/*!
108 * \brief Deletes an extension
109 * \param provider_name The name of the provider
110 * \param macaddress The mac address of the extension
111 */
112void ast_phoneprov_delete_extension(char *provider_name, char *macaddress);
113
114/*!
115 * \brief Deletes all extensions for this provider
116 * \param provider_name The name of the provider
117 */
118void ast_phoneprov_delete_extensions(char *provider_name);
119
120#endif /* _ASTERISK_PHONEPROV_H */
121
122#ifdef __cplusplus
123}
124#endif
static void load_users(struct ast_config *cfg)
#define var
Definition: ast_expr2f.c:605
Asterisk main include file. File version handling, generic pbx functions.
Inlinable API function macro.
void ast_phoneprov_delete_extensions(char *provider_name)
Deletes all extensions for this provider.
void ast_phoneprov_provider_unregister(char *provider_name)
Unegisters a config provider from phoneprov and frees its resources.
const char * ast_phoneprov_std_variable_lookup(enum ast_phoneprov_std_variables var)
Returns the string respresentation of a phoneprov standard variable.
int ast_phoneprov_add_extension(char *provider_name, struct varshead *vars)
Adds an extension.
ast_phoneprov_std_variables
Definition: phoneprov.h:29
@ AST_PHONEPROV_STD_DST_END_MDAY
Definition: phoneprov.h:51
@ AST_PHONEPROV_STD_SERVER_IFACE
Definition: phoneprov.h:42
@ AST_PHONEPROV_STD_VAR_LIST_LENGTH
Definition: phoneprov.h:53
@ AST_PHONEPROV_STD_SERVER_PORT
Definition: phoneprov.h:41
@ AST_PHONEPROV_STD_DST_START_MDAY
Definition: phoneprov.h:48
@ AST_PHONEPROV_STD_MAC
Definition: phoneprov.h:30
@ AST_PHONEPROV_STD_CALLERID
Definition: phoneprov.h:36
@ AST_PHONEPROV_STD_DST_START_MONTH
Definition: phoneprov.h:47
@ AST_PHONEPROV_STD_TZOFFSET
Definition: phoneprov.h:45
@ AST_PHONEPROV_STD_USERNAME
Definition: phoneprov.h:32
@ AST_PHONEPROV_STD_DST_END_MONTH
Definition: phoneprov.h:50
@ AST_PHONEPROV_STD_LINENUMBER
Definition: phoneprov.h:38
@ AST_PHONEPROV_STD_TIMEZONE
Definition: phoneprov.h:37
@ AST_PHONEPROV_STD_SERVER
Definition: phoneprov.h:40
@ AST_PHONEPROV_STD_LABEL
Definition: phoneprov.h:35
@ AST_PHONEPROV_STD_PROFILE
Definition: phoneprov.h:31
@ AST_PHONEPROV_STD_EXTENSION_LENGTH
Definition: phoneprov.h:44
@ AST_PHONEPROV_STD_DST_END_HOUR
Definition: phoneprov.h:52
@ AST_PHONEPROV_STD_DST_ENABLE
Definition: phoneprov.h:46
@ AST_PHONEPROV_STD_DISPLAY_NAME
Definition: phoneprov.h:33
@ AST_PHONEPROV_STD_SECRET
Definition: phoneprov.h:34
@ AST_PHONEPROV_STD_DST_START_HOUR
Definition: phoneprov.h:49
@ AST_PHONEPROV_STD_VOICEMAIL_EXTEN
Definition: phoneprov.h:43
@ AST_PHONEPROV_STD_LINEKEYS
Definition: phoneprov.h:39
void ast_phoneprov_delete_extension(char *provider_name, char *macaddress)
Deletes an extension.
int(* ast_phoneprov_load_users_cb)(void)
Causes the provider to load its users.
Definition: phoneprov.h:75
int ast_phoneprov_provider_register(char *provider_name, ast_phoneprov_load_users_cb load_users)
Registers a config provider to phoneprov.