Asterisk - The Open Source Telephony Project
18.5.0
|
HTTP POST upload support for Asterisk HTTP server. More...
#include "asterisk.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <gmime/gmime.h>
#include "asterisk/linkedlists.h"
#include "asterisk/http.h"
#include "asterisk/paths.h"
#include "asterisk/tcptls.h"
#include "asterisk/manager.h"
#include "asterisk/cli.h"
#include "asterisk/module.h"
#include "asterisk/ast_version.h"
Go to the source code of this file.
Data Structures | |
struct | mime_cbinfo |
Macros | |
#define | MAX_PREFIX 80 |
Functions | |
static int | __ast_http_post_load (int reload) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | find_sequence (char *inbuf, int inlen, char *matchbuf, int matchlen) |
static int | http_post_callback (struct ast_tcptls_session_instance *ser, const struct ast_http_uri *urih, const char *uri, enum ast_http_method method, struct ast_variable *get_vars, struct ast_variable *headers) |
static int | load_module (void) |
static GMimeMessage * | parse_message (FILE *f) |
static void | post_raw (GMimePart *part, const char *post_dir, const char *fn) |
static int | process_message (GMimeMessage *message, const char *post_dir) |
static void | process_message_callback (GMimeObject *part, gpointer user_data) |
static int | readmimefile (struct ast_iostream *in, FILE *fout, char *boundary, int contentlen) |
static int | reload (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "HTTP POST support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .requires = "http", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char | prefix [MAX_PREFIX] |
HTTP POST upload support for Asterisk HTTP server.
AMI over HTTP support - AMI over the http protocol
Definition in file res_http_post.c.
#define MAX_PREFIX 80 |
Definition at line 52 of file res_http_post.c.
|
static |
Definition at line 429 of file res_http_post.c.
References ast_calloc, ast_config_destroy(), ast_config_load2(), ast_copy_string(), ast_free, ast_http_uri_link(), ast_http_uri_unlink_all_with_key(), ast_str_create, ast_str_set(), ast_strdup, ast_variable_browse(), ast_http_uri::callback, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, ast_http_uri::data, ast_http_uri::description, ast_http_uri::dmallocd, ast_http_uri::has_subtree, http_post_callback(), ast_http_uri::key, ast_http_uri::mallocd, ast_variable::name, ast_variable::next, prefix, ast_http_uri::uri, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 517 of file res_http_post.c.
|
static |
Definition at line 517 of file res_http_post.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 517 of file res_http_post.c.
|
static |
Definition at line 189 of file res_http_post.c.
Referenced by readmimefile().
|
static |
Definition at line 323 of file res_http_post.c.
References ast_debug, ast_http_body_read_status(), ast_http_error(), ast_http_manid_from_vars(), AST_HTTP_POST, ast_http_request_close_on_completion(), ast_log, ast_str_buffer(), astman_is_authed(), astman_verify_session_writepermissions(), ast_http_uri::data, EVENT_FLAG_CONFIG, LOG_ERROR, ast_variable::name, ast_variable::next, NULL, parse_message(), mime_cbinfo::post_dir, process_message(), readmimefile(), ast_tcptls_session_instance::stream, ast_variable::value, and var.
Referenced by __ast_http_post_load().
|
static |
Definition at line 498 of file res_http_post.c.
References __ast_http_post_load(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, reload(), and unload_module().
|
static |
Definition at line 104 of file res_http_post.c.
References NULL, and process_message_callback().
Referenced by http_post_callback().
|
static |
Definition at line 71 of file res_http_post.c.
References ast_debug, ast_log, LOG_WARNING, and PATH_MAX.
Referenced by process_message_callback().
|
static |
Definition at line 172 of file res_http_post.c.
References mime_cbinfo::count, mime_cbinfo::post_dir, and process_message_callback().
Referenced by http_post_callback().
|
static |
Definition at line 131 of file res_http_post.c.
References ast_debug, ast_log, ast_strlen_zero, mime_cbinfo::count, LOG_ERROR, LOG_WARNING, mime_cbinfo::post_dir, and post_raw().
Referenced by parse_message(), and process_message().
|
static |
Definition at line 225 of file res_http_post.c.
References ast_iostream_read(), ast_log, buf, errno, find_sequence(), LOG_WARNING, and NULL.
Referenced by http_post_callback().
|
static |
Definition at line 491 of file res_http_post.c.
References __ast_http_post_load(), and AST_MODULE_LOAD_SUCCESS.
Referenced by load_module().
|
static |
Definition at line 484 of file res_http_post.c.
References ast_http_uri_unlink_all_with_key().
Referenced by load_module().
|
static |
Definition at line 517 of file res_http_post.c.
|
static |
Definition at line 517 of file res_http_post.c.
|
static |
Definition at line 69 of file res_http_post.c.
Referenced by __ast_http_post_load().