#include "asterisk.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | base64_decode (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) |
static int | base64_encode (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "base64 encode/decode dialplan functions" , .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 = "6989f2ec67f8497e38c12890500c525b" , .load = load_module, .unload = unload_module, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_custom_function | base64_decode_function |
static struct ast_custom_function | base64_encode_function |
Definition in file func_base64.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 94 of file func_base64.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 94 of file func_base64.c.
static int base64_decode | ( | struct ast_channel * | chan, | |
char * | cmd, | |||
char * | data, | |||
char * | buf, | |||
size_t | len | |||
) | [static] |
Definition at line 53 of file func_base64.c.
References ast_base64decode(), ast_log(), ast_strlen_zero(), and LOG_WARNING.
00055 { 00056 if (ast_strlen_zero(data)) { 00057 ast_log(LOG_WARNING, "Syntax: BASE64_DECODE(<base_64 string>) - missing argument!\n"); 00058 return -1; 00059 } 00060 00061 ast_base64decode((unsigned char *) buf, data, len); 00062 00063 return 0; 00064 }
static int base64_encode | ( | struct ast_channel * | chan, | |
char * | cmd, | |||
char * | data, | |||
char * | buf, | |||
size_t | len | |||
) | [static] |
Definition at line 40 of file func_base64.c.
References ast_base64encode(), ast_log(), ast_strlen_zero(), and LOG_WARNING.
00042 { 00043 if (ast_strlen_zero(data)) { 00044 ast_log(LOG_WARNING, "Syntax: BASE64_ENCODE(<data>) - missing argument!\n"); 00045 return -1; 00046 } 00047 00048 ast_base64encode(buf, (unsigned char *) data, strlen(data), len); 00049 00050 return 0; 00051 }
static int load_module | ( | void | ) | [static] |
Definition at line 88 of file func_base64.c.
References ast_custom_function_register(), base64_decode_function, and base64_encode_function.
00089 { 00090 return ast_custom_function_register(&base64_encode_function) | 00091 ast_custom_function_register(&base64_decode_function); 00092 }
static int unload_module | ( | void | ) | [static] |
Definition at line 82 of file func_base64.c.
References ast_custom_function_unregister(), base64_decode_function, and base64_encode_function.
00083 { 00084 return ast_custom_function_unregister(&base64_encode_function) | 00085 ast_custom_function_unregister(&base64_decode_function); 00086 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "base64 encode/decode dialplan functions" , .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 = "6989f2ec67f8497e38c12890500c525b" , .load = load_module, .unload = unload_module, } [static] |
Definition at line 94 of file func_base64.c.
const struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 94 of file func_base64.c.
struct ast_custom_function base64_decode_function [static] |
struct ast_custom_function base64_encode_function [static] |