Mon May 14 04:48:12 2007

Asterisk developer's documentation


func_global.c File Reference

Global variable dialplan functions. More...

#include "asterisk.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"

Include dependency graph for func_global.c:

Go to the source code of this file.

Functions

 AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"Global variable dialplan functions")
static int global_read (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
static int global_write (struct ast_channel *chan, char *cmd, char *data, const char *value)
static int load_module (void)
static int unload_module (void)

Variables

static struct ast_custom_function global_function


Detailed Description

Global variable dialplan functions.

Author:
Tilghman Lesher <func_global__200605@the-tilghman.com>

Definition in file func_global.c.


Function Documentation

AST_MODULE_INFO_STANDARD ( ASTERISK_GPL_KEY  ,
"Global variable dialplan functions"   
)

static int global_read ( struct ast_channel chan,
char *  cmd,
char *  data,
char *  buf,
size_t  len 
) [static]

Definition at line 43 of file func_global.c.

References pbx_builtin_getvar_helper(), and var.

00044 {
00045    const char *var = pbx_builtin_getvar_helper(NULL, data);
00046 
00047    *buf = '\0';
00048 
00049    if (var)
00050       ast_copy_string(buf, var, len);
00051 
00052    return 0;
00053 }

static int global_write ( struct ast_channel chan,
char *  cmd,
char *  data,
const char *  value 
) [static]

Definition at line 55 of file func_global.c.

References pbx_builtin_setvar_helper().

00056 {
00057    pbx_builtin_setvar_helper(NULL, data, value);
00058 
00059    return 0;
00060 }

static int load_module ( void   )  [static]

Definition at line 79 of file func_global.c.

References ast_custom_function_register(), and global_function.

00080 {
00081    int res = 0;
00082 
00083    res |= ast_custom_function_register(&global_function);
00084 
00085    return res;
00086 }

static int unload_module ( void   )  [static]

Definition at line 70 of file func_global.c.

References ast_custom_function_unregister(), and global_function.

00071 {
00072    int res = 0;
00073 
00074    res |= ast_custom_function_unregister(&global_function);
00075 
00076    return res;
00077 }


Variable Documentation

struct ast_custom_function global_function [static]

Definition at line 62 of file func_global.c.

Referenced by load_module(), and unload_module().


Generated on Mon May 14 04:48:13 2007 for Asterisk - the Open Source PBX by  doxygen 1.5.1