#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"
Include dependency graph for func_base64.c:
Go to the source code of this file.
Functions | |
AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"base64 encode/decode dialplan functions") | |
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_custom_function | base64_decode_function |
static struct ast_custom_function | base64_encode_function |
Definition in file func_base64.c.
AST_MODULE_INFO_STANDARD | ( | ASTERISK_GPL_KEY | , | |
"base64 encode/decode dialplan functions" | ||||
) |
static int base64_decode | ( | struct ast_channel * | chan, | |
char * | cmd, | |||
char * | data, | |||
char * | buf, | |||
size_t | len | |||
) | [static] |
Definition at line 54 of file func_base64.c.
References ast_base64decode(), ast_log(), ast_strlen_zero(), and LOG_WARNING.
00056 { 00057 if (ast_strlen_zero(data)) { 00058 ast_log(LOG_WARNING, "Syntax: BASE64_DECODE(<base_64 string>) - missing argument!\n"); 00059 return -1; 00060 } 00061 00062 ast_base64decode((unsigned char *) buf, data, len); 00063 00064 return 0; 00065 }
static int base64_encode | ( | struct ast_channel * | chan, | |
char * | cmd, | |||
char * | data, | |||
char * | buf, | |||
size_t | len | |||
) | [static] |
Definition at line 41 of file func_base64.c.
References ast_base64encode(), ast_log(), ast_strlen_zero(), and LOG_WARNING.
00043 { 00044 if (ast_strlen_zero(data)) { 00045 ast_log(LOG_WARNING, "Syntax: BASE64_ENCODE(<data>) - missing argument!\n"); 00046 return -1; 00047 } 00048 00049 ast_base64encode(buf, (unsigned char *) data, strlen(data), len); 00050 00051 return 0; 00052 }
static int load_module | ( | void | ) | [static] |
Definition at line 89 of file func_base64.c.
References ast_custom_function_register(), base64_decode_function, and base64_encode_function.
00090 { 00091 return ast_custom_function_register(&base64_encode_function) | 00092 ast_custom_function_register(&base64_decode_function); 00093 }
static int unload_module | ( | void | ) | [static] |
Definition at line 83 of file func_base64.c.
References ast_custom_function_unregister(), base64_decode_function, and base64_encode_function.
00084 { 00085 return ast_custom_function_unregister(&base64_encode_function) | 00086 ast_custom_function_unregister(&base64_decode_function); 00087 }
struct ast_custom_function base64_decode_function [static] |
struct ast_custom_function base64_encode_function [static] |