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) |
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 (FILE *fin, 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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .reload = reload, } |
static 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 54 of file res_http_post.c.
|
static |
Definition at line 426 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_FILEMISSING, 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, ast_http_uri::uri, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 510 of file res_http_post.c.
|
static |
Definition at line 510 of file res_http_post.c.
|
static |
Definition at line 180 of file res_http_post.c.
Referenced by readmimefile().
|
static |
Definition at line 314 of file res_http_post.c.
References ast_debug, ast_http_error(), ast_http_get_cookies(), ast_http_manid_from_vars(), AST_HTTP_POST, ast_log(), ast_str_buffer(), ast_variables_destroy(), astman_is_authed(), astman_verify_session_writepermissions(), ast_http_uri::data, EVENT_FLAG_CONFIG, f, ast_tcptls_session_instance::f, LOG_DEBUG, LOG_ERROR, ast_variable::name, ast_variable::next, option_debug, parse_message(), process_message(), readmimefile(), ast_variable::value, and var.
Referenced by __ast_http_post_load().
|
static |
Definition at line 497 of file res_http_post.c.
References __ast_http_post_load(), and AST_MODULE_LOAD_SUCCESS.
|
static |
Definition at line 99 of file res_http_post.c.
Referenced by http_post_callback().
|
static |
Definition at line 70 of file res_http_post.c.
References ast_debug, ast_log(), and LOG_WARNING.
Referenced by process_message_callback().
|
static |
Definition at line 163 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 122 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 process_message().
|
static |
Definition at line 216 of file res_http_post.c.
References ast_log(), errno, find_sequence(), and LOG_WARNING.
Referenced by http_post_callback().
|
static |
Definition at line 490 of file res_http_post.c.
References __ast_http_post_load(), and AST_MODULE_LOAD_SUCCESS.
|
static |
Definition at line 483 of file res_http_post.c.
References ast_http_uri_unlink_all_with_key().
|
static |
Definition at line 510 of file res_http_post.c.
|
static |
Definition at line 510 of file res_http_post.c.
|
static |
Definition at line 68 of file res_http_post.c.