Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should...
[asterisk-bristuff.git] / include / asterisk / image.h
blob72d1a40189e0d5fb199e47d60a30cae0d86b8195
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2006, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 /*! \file
20 * \brief General Asterisk channel definitions for image handling
23 #ifndef _ASTERISK_IMAGE_H
24 #define _ASTERISK_IMAGE_H
26 /*! \brief structure associated with registering an image format */
27 struct ast_imager {
28 /*! Name */
29 char *name;
30 /*! Description */
31 char *desc;
32 /*! Extension(s) (separated by '|' ) */
33 char *exts;
34 /*! Image format */
35 int format;
36 /*! Read an image from a file descriptor */
37 struct ast_frame *(*read_image)(int fd, int len);
38 /*! Identify if this is that type of file */
39 int (*identify)(int fd);
40 /*! Returns length written */
41 int (*write_image)(int fd, struct ast_frame *frame);
42 /*! For linked list */
43 AST_LIST_ENTRY(ast_imager) list;
46 /*! Check for image support on a channel */
47 /*!
48 * \param chan channel to check
49 * Checks the channel to see if it supports the transmission of images
50 * Returns non-zero if image transmission is supported
52 int ast_supports_images(struct ast_channel *chan);
54 /*! Sends an image */
55 /*!
56 * \param chan channel to send image on
57 * \param filename filename of image to send (minus extension)
58 * Sends an image on the given channel.
59 * Returns 0 on success, -1 on error
61 int ast_send_image(struct ast_channel *chan, char *filename);
63 /*! Make an image */
64 /*!
65 * \param filename filename of image to prepare
66 * \param preflang preferred language to get the image...?
67 * \param format the format of the file
68 * Make an image from a filename ??? No estoy positivo
69 * Returns an ast_frame on success, NULL on failure
71 struct ast_frame *ast_read_image(char *filename, const char *preflang, int format);
73 /*! Register image format */
74 /*!
75 * \param imgdrv Populated ast_imager structure with info to register
76 * Registers an image format
77 * Returns 0 regardless
79 int ast_image_register(struct ast_imager *imgdrv);
81 /*! Unregister an image format */
82 /*!
83 * \param imgdrv pointer to the ast_imager structure you wish to unregister
84 * Unregisters the image format passed in
85 * Returns nothing
87 void ast_image_unregister(struct ast_imager *imgdrv);
89 /*! Initialize image stuff */
90 /*!
91 * Initializes all the various image stuff. Basically just registers the cli stuff
92 * Returns 0 all the time
94 int ast_image_init(void);
96 #endif /* _ASTERISK_IMAGE_H */