Asterisk - The Open Source Telephony Project GIT-master-b023714
|
curl plugin for portable configuration engine More...
#include "asterisk.h"
#include <curl/curl.h>
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/threadstorage.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_THREADSTORAGE_CUSTOM_SCOPE (query_buf, NULL, ast_free_ptr, static) | |
AST_THREADSTORAGE_CUSTOM_SCOPE (result_buf, NULL, ast_free_ptr, static) | |
static struct ast_config * | config_curl (const char *url, const char *unused, const char *file, struct ast_config *cfg, struct ast_flags flags, const char *sugg_incl, const char *who_asked) |
static int | destroy_curl (const char *url, const char *unused, const char *keyfield, const char *lookup, const struct ast_variable *fields) |
Execute an DELETE query. | |
static int | load_module (void) |
static struct ast_variable * | realtime_curl (const char *url, const char *unused, const struct ast_variable *fields) |
Execute a curl query and return ast_variable list. | |
static struct ast_config * | realtime_multi_curl (const char *url, const char *unused, const struct ast_variable *fields) |
Execute an Select query and return ast_config list. | |
static int | reload_module (void) |
static int | require_curl (const char *url, const char *unused, va_list ap) |
static int | store_curl (const char *url, const char *unused, const struct ast_variable *fields) |
Execute an INSERT query. | |
static int | unload_module (void) |
static int | update2_curl (const char *url, const char *unused, const struct ast_variable *lookup_fields, const struct ast_variable *update_fields) |
static int | update_curl (const char *url, const char *unused, const char *keyfield, const char *lookup, const struct ast_variable *fields) |
Execute an UPDATE query. | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Realtime Curl configuration" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_REALTIME_DRIVER, .requires = "extconfig,res_curl,func_curl", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_config_engine | curl_engine |
curl plugin for portable configuration engine
Depends on the CURL library - http://curl.haxx.se/
Definition in file res_config_curl.c.
|
static |
Definition at line 656 of file res_config_curl.c.
|
static |
Definition at line 656 of file res_config_curl.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 656 of file res_config_curl.c.
AST_THREADSTORAGE_CUSTOM_SCOPE | ( | query_buf | , |
NULL | , | ||
ast_free_ptr | , | ||
static | |||
) |
AST_THREADSTORAGE_CUSTOM_SCOPE | ( | result_buf | , |
NULL | , | ||
ast_free_ptr | , | ||
static | |||
) |
|
static |
Definition at line 515 of file res_config_curl.c.
References ast_category_append(), ast_category_new_dynamic, ast_config_get_current_category(), ast_config_internal_load(), ast_custom_function_find(), ast_log, ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_strlen_zero(), ast_uri_decode(), ast_uri_encode(), ast_uri_http, ast_variable_append(), ast_variable_new, LOG_ERROR, NULL, S_OR, strsep(), and url.
|
static |
Execute an DELETE query.
url | |
unused | |
keyfield | where clause field |
lookup | value of field for where clause |
fields | list containing one or more field/value set(s) |
Delete a row from a database table, prepare the sql statement using keyfield and lookup control the number of records to change. Additional params to match rows are stored in ap list. Sub-in the values to the prepared statement and execute it.
number | of rows affected |
-1 | on failure |
Definition at line 415 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_uri_encode(), ast_uri_http, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, url, and ast_variable::value.
|
static |
Definition at line 640 of file res_config_curl.c.
References ast_config_engine_register(), curl_engine, and reload_module().
|
static |
Execute a curl query and return ast_variable list.
url | The base URL from which to retrieve data |
unused | Not currently used |
fields | list containing one or more field/operator/value set. |
var | on success |
NULL | on failure |
Definition at line 61 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_strlen_zero(), ast_uri_decode(), ast_uri_encode(), ast_uri_http, ast_variable_new, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, S_OR, strsep(), url, ast_variable::value, and var.
|
static |
Execute an Select query and return ast_config list.
url | |
unused | |
fields | list containing one or more field/operator/value set. |
struct | ast_config pointer on success |
NULL | on failure |
Definition at line 132 of file res_config_curl.c.
References ast_category_append(), ast_category_new_anonymous, ast_category_rename(), ast_config_new(), ast_custom_function_find(), ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_strdup, ast_strlen_zero(), ast_uri_decode(), ast_uri_encode(), ast_uri_http, ast_variable_append(), ast_variable_new, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, S_OR, strsep(), url, ast_variable::value, and var.
|
static |
Definition at line 604 of file res_config_curl.c.
References ast_config_destroy(), ast_config_load, ast_variable_browse(), CONFIG_FLAG_NOREALTIME, CONFIG_STATUS_FILEINVALID, ast_flags::flags, name, NULL, pbx_builtin_setvar_helper(), and var.
Referenced by load_module().
|
static |
Definition at line 464 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_uri_encode(), ast_uri_http, LOG_ERROR, NULL, RQ_CHAR, RQ_DATE, RQ_DATETIME, RQ_FLOAT, RQ_INTEGER1, RQ_INTEGER2, RQ_INTEGER3, RQ_INTEGER4, RQ_INTEGER8, RQ_UINTEGER1, RQ_UINTEGER2, RQ_UINTEGER3, RQ_UINTEGER4, RQ_UINTEGER8, type, and url.
|
static |
Execute an INSERT query.
url | |
unused | |
fields | list containing one or more field/value set(s) |
Insert a new record into database table, prepare the sql statement. All values to be changed are stored in ap list. Sub-in the values to the prepared statement and execute it.
number | of rows affected |
-1 | on failure |
Definition at line 354 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_uri_encode(), ast_uri_http, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, url, and ast_variable::value.
|
static |
Definition at line 633 of file res_config_curl.c.
References ast_config_engine_deregister(), and curl_engine.
|
static |
Definition at line 281 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_uri_encode(), ast_uri_http, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, url, and ast_variable::value.
|
static |
Execute an UPDATE query.
url | |
unused | |
keyfield | where clause field |
lookup | value of field for where clause |
fields | list containing one or more field/value set(s). |
Update a database table, prepare the sql statement using keyfield and lookup control the number of records to change. All values to be changed are stored in ap list. Sub-in the values to the prepared statement and execute it.
number | of rows affected |
-1 | on failure |
Definition at line 232 of file res_config_curl.c.
References ast_custom_function_find(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_substitute_variables(), ast_str_thread_get(), ast_uri_encode(), ast_uri_http, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, url, and ast_variable::value.
|
static |
Definition at line 656 of file res_config_curl.c.
|
static |
Definition at line 656 of file res_config_curl.c.
|
static |
Definition at line 592 of file res_config_curl.c.
Referenced by load_module(), and unload_module().