Sun Dec 18 20:55:51 2011

Asterisk developer's documentation


func_base64.c File Reference

Use the base64 as functions. More...

#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


Detailed Description

Use the base64 as functions.

Definition in file func_base64.c.


Function Documentation

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 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]

static int unload_module ( void   )  [static]


Variable Documentation

Definition at line 74 of file func_base64.c.

Definition at line 66 of file func_base64.c.


Generated on Sun Dec 18 20:55:51 2011 for Asterisk - the Open Source PBX by  doxygen 1.5.6