Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

channel_pvt.h

Go to the documentation of this file.
00001 /* 00002 * Asterisk -- A telephony toolkit for Linux. 00003 * 00004 * Private channel definitions for channel implementations only. 00005 * 00006 * Copyright (C) 1999, Mark Spencer 00007 * 00008 * Mark Spencer <markster@linux-support.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License 00012 */ 00013 00014 #ifndef _ASTERISK_CHANNEL_PVT_H 00015 #define _ASTERISK_CHANNEL_PVT_H 00016 00017 #include <asterisk/channel.h> 00018 00019 #if defined(__cplusplus) || defined(c_plusplus) 00020 extern "C" { 00021 #endif 00022 00023 00024 struct ast_channel_pvt { 00025 /*! Private data used by channel backend */ 00026 void *pvt; 00027 struct ast_frame *readq; 00028 int alertpipe[2]; 00029 /*! Write translation path */ 00030 struct ast_trans_pvt *writetrans; 00031 /*! Read translation path */ 00032 struct ast_trans_pvt *readtrans; 00033 /*! Raw read format */ 00034 int rawreadformat; 00035 /*! Raw write format */ 00036 int rawwriteformat; 00037 /*! Send a literal DTMF digit */ 00038 int (*send_digit)(struct ast_channel *chan, char digit); 00039 /*! Call a given phone number (address, etc), but don't 00040 take longer than timeout seconds to do so. */ 00041 int (*call)(struct ast_channel *chan, char *addr, int timeout); 00042 /*! Hangup (and possibly destroy) the channel */ 00043 int (*hangup)(struct ast_channel *chan); 00044 /*! Answer the line */ 00045 int (*answer)(struct ast_channel *chan); 00046 /*! Read a frame, in standard format */ 00047 struct ast_frame * (*read)(struct ast_channel *chan); 00048 /*! Write a frame, in standard format */ 00049 int (*write)(struct ast_channel *chan, struct ast_frame *frame); 00050 /*! Display or transmit text */ 00051 int (*send_text)(struct ast_channel *chan, char *text); 00052 /*! Display or send an image */ 00053 int (*send_image)(struct ast_channel *chan, struct ast_frame *frame); 00054 /*! Send HTML data */ 00055 int (*send_html)(struct ast_channel *chan, int subclass, char *data, int len); 00056 /*! Handle an exception, reading a frame */ 00057 struct ast_frame * (*exception)(struct ast_channel *chan); 00058 /*! Bridge two channels of the same type together */ 00059 int (*bridge)(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc); 00060 /*! Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTION */ 00061 int (*indicate)(struct ast_channel *c, int condition); 00062 /*! Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links */ 00063 int (*fixup)(struct ast_channel *oldchan, struct ast_channel *newchan); 00064 /*! Set a given option */ 00065 int (*setoption)(struct ast_channel *chan, int option, void *data, int datalen); 00066 /*! Query a given option */ 00067 int (*queryoption)(struct ast_channel *chan, int option, void *data, int *datalen); 00068 /*! Blind transfer other side */ 00069 int (*transfer)(struct ast_channel *chan, char *newdest); 00070 /*! Write a frame, in standard format */ 00071 int (*write_video)(struct ast_channel *chan, struct ast_frame *frame); 00072 }; 00073 00074 //! Create a channel structure 00075 /*! Returns NULL on failure to allocate */ 00076 struct ast_channel *ast_channel_alloc(int needalertpipe); 00077 00078 /*! Queue an outgoing frame */ 00079 int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f); 00080 00081 int ast_queue_hangup(struct ast_channel *chan); 00082 00083 int ast_queue_control(struct ast_channel *chan, int control); 00084 00085 /*! Change the state of a channel */ 00086 int ast_setstate(struct ast_channel *chan, int state); 00087 00088 void ast_change_name(struct ast_channel *chan, char *newname); 00089 00090 //! Free a channel structure 00091 void ast_channel_free(struct ast_channel *); 00092 00093 #if defined(__cplusplus) || defined(c_plusplus) 00094 } 00095 #endif 00096 00097 00098 #endif

Generated on Sat Jun 12 16:40:57 2004 for Asterisk by doxygen 1.3.7