Fri Jul 24 00:41:09 2009

Asterisk developer's documentation


app_image.c File Reference

App to transmit an image. More...

#include "asterisk.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/image.h"

Go to the source code of this file.

Functions

static void __reg_module (void)
static void __unreg_module (void)
static int load_module (void)
static int sendimage_exec (struct ast_channel *chan, void *data)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Image Transmission Application" , .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 char * app = "SendImage"
static struct ast_module_infoast_module_info = &__mod_info
static char * descrip
static char * synopsis = "Send an image file"


Detailed Description

App to transmit an image.

Author:
Mark Spencer <markster@digium.com>

Definition in file app_image.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 82 of file app_image.c.

static void __unreg_module ( void   )  [static]

Definition at line 82 of file app_image.c.

static int load_module ( void   )  [static]

Definition at line 77 of file app_image.c.

References ast_register_application, and sendimage_exec().

00078 {
00079    return ast_register_application(app, sendimage_exec, synopsis, descrip);
00080 }

static int sendimage_exec ( struct ast_channel chan,
void *  data 
) [static]

Definition at line 49 of file app_image.c.

References ast_log(), ast_send_image(), ast_strlen_zero(), ast_supports_images(), chan, LOG_WARNING, and pbx_builtin_setvar_helper().

Referenced by load_module().

00050 {
00051 
00052    if (ast_strlen_zero(data)) {
00053       ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n");
00054       return -1;
00055    }
00056 
00057    if (!ast_supports_images(chan)) {
00058       /* Does not support transport */
00059       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "UNSUPPORTED");
00060       return 0;
00061    }
00062 
00063    if (!ast_send_image(chan, data)) {
00064       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "SUCCESS");
00065    } else {
00066       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "FAILURE");
00067    }
00068    
00069    return 0;
00070 }

static int unload_module ( void   )  [static]

Definition at line 72 of file app_image.c.

References ast_unregister_application().

00073 {
00074    return ast_unregister_application(app);
00075 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Image Transmission Application" , .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 82 of file app_image.c.

char* app = "SendImage" [static]

Definition at line 36 of file app_image.c.

struct ast_module_info* ast_module_info = &__mod_info [static]

Definition at line 82 of file app_image.c.

char* descrip [static]

Definition at line 40 of file app_image.c.

char* synopsis = "Send an image file" [static]

Definition at line 38 of file app_image.c.


Generated on Fri Jul 24 00:41:09 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7