Tue Aug 24 20:34:47 2010

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"
Include dependency graph for app_image.c:

Go to the source code of this file.

Functions

 AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"Image Transmission Application")
static int load_module (void)
static int sendimage_exec (struct ast_channel *chan, void *data)
static int unload_module (void)

Variables

static char * app = "SendImage"

Detailed Description

App to transmit an image.

Author:
Mark Spencer <markster@digium.com>

Definition in file app_image.c.


Function Documentation

AST_MODULE_INFO_STANDARD ( ASTERISK_GPL_KEY  ,
"Image Transmission Application"   
)
static int load_module ( void   )  [static]

Definition at line 100 of file app_image.c.

References ast_register_application_xml, and sendimage_exec().

00101 {
00102    return ast_register_application_xml(app, sendimage_exec);
00103 }

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

Definition at line 72 of file app_image.c.

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

Referenced by load_module().

00073 {
00074 
00075    if (ast_strlen_zero(data)) {
00076       ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n");
00077       return -1;
00078    }
00079 
00080    if (!ast_supports_images(chan)) {
00081       /* Does not support transport */
00082       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "UNSUPPORTED");
00083       return 0;
00084    }
00085 
00086    if (!ast_send_image(chan, data)) {
00087       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "SUCCESS");
00088    } else {
00089       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "FAILURE");
00090    }
00091    
00092    return 0;
00093 }

static int unload_module ( void   )  [static]

Definition at line 95 of file app_image.c.

References ast_unregister_application().

00096 {
00097    return ast_unregister_application(app);
00098 }


Variable Documentation

char* app = "SendImage" [static]

Definition at line 36 of file app_image.c.


Generated on 24 Aug 2010 for Asterisk - the Open Source PBX by  doxygen 1.6.1