Fri Jun 19 12:10:37 2009

Asterisk developer's documentation


func_vmcount.c File Reference

VMCOUNT dialplan function. More...

#include "asterisk.h"
#include <dirent.h>
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.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 acf_vmcount_exec (struct ast_channel *chan, const char *cmd, char *argsstr, 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 , .description = "Indicator for whether a voice mailbox has messages in a given folder." , .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 = "a9c98e5d177805051735cb5b0b16b0a0" , .load = load_module, .unload = unload_module, }
ast_custom_function acf_vmcount
static struct ast_module_infoast_module_info = &__mod_info


Detailed Description

VMCOUNT dialplan function.

Author:
Tilghman Lesher <asterisk-vmcount-func@the-tilghman.com>

Definition in file func_vmcount.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 93 of file func_vmcount.c.

static void __unreg_module ( void   )  [static]

Definition at line 93 of file func_vmcount.c.

static int acf_vmcount_exec ( struct ast_channel chan,
const char *  cmd,
char *  argsstr,
char *  buf,
size_t  len 
) [static]

Definition at line 42 of file func_vmcount.c.

References AST_APP_ARG, ast_app_messagecount(), AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strlen_zero(), context, and strsep().

00043 {
00044    char *context;
00045    AST_DECLARE_APP_ARGS(args,
00046       AST_APP_ARG(vmbox);
00047       AST_APP_ARG(folder);
00048    );
00049 
00050    buf[0] = '\0';
00051 
00052    if (ast_strlen_zero(argsstr))
00053       return -1;
00054 
00055    AST_STANDARD_APP_ARGS(args, argsstr);
00056 
00057    if (strchr(args.vmbox, '@')) {
00058       context = args.vmbox;
00059       args.vmbox = strsep(&context, "@");
00060    } else {
00061       context = "default";
00062    }
00063 
00064    if (ast_strlen_zero(args.folder)) {
00065       args.folder = "INBOX";
00066    }
00067 
00068    snprintf(buf, len, "%d", ast_app_messagecount(context, args.vmbox, args.folder));
00069    
00070    return 0;
00071 }

static int load_module ( void   )  [static]

Definition at line 88 of file func_vmcount.c.

References acf_vmcount, and ast_custom_function_register.

00089 {
00090    return ast_custom_function_register(&acf_vmcount);
00091 }

static int unload_module ( void   )  [static]

Definition at line 83 of file func_vmcount.c.

References acf_vmcount, and ast_custom_function_unregister().

00084 {
00085    return ast_custom_function_unregister(&acf_vmcount);
00086 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Indicator for whether a voice mailbox has messages in a given folder." , .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 = "a9c98e5d177805051735cb5b0b16b0a0" , .load = load_module, .unload = unload_module, } [static]

Definition at line 93 of file func_vmcount.c.

struct ast_custom_function acf_vmcount

Definition at line 73 of file func_vmcount.c.

Referenced by load_module(), and unload_module().

struct ast_module_info* ast_module_info = &__mod_info [static]

Definition at line 93 of file func_vmcount.c.


Generated on Fri Jun 19 12:10:37 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7