Version 0.1.7 from FTP
[asterisk/asterisk.git] / include / asterisk / channel_pvt.h
1 /*
2  * Asterisk -- A telephony toolkit for Linux.
3  *
4  * Private channel definitions for channel implementations only.
5  * 
6  * Copyright (C) 1999, Mark Spencer
7  *
8  * Mark Spencer <markster@linux-support.net>
9  *
10  * This program is free software, distributed under the terms of
11  * the GNU General Public License
12  */
13
14 #ifndef _ASTERISK_CHANNEL_PVT_H
15 #define _ASTERISK_CHANNEL_PVT_H
16
17 #include <asterisk/channel.h>
18
19 #if defined(__cplusplus) || defined(c_plusplus)
20 extern "C" {
21 #endif
22
23
24 struct ast_channel_pvt {
25         /* Private data used by channel backend */
26         void *pvt;      
27         /* Write translation path */
28         struct ast_trans_pvt *writetrans;
29         /* Read translation path */
30         struct ast_trans_pvt *readtrans;
31         /* Raw read format */
32         int rawreadformat;
33         /* Raw write format */
34         int rawwriteformat;
35         /* Send a literal DTMF digit */
36         int (*send_digit)(struct ast_channel *chan, char digit);
37         /* Call a given phone number (address, etc), but don't
38            take longer than timeout seconds to do so.  */
39         int (*call)(struct ast_channel *chan, char *addr, int timeout);
40         /* Hangup (and possibly destroy) the channel */
41         int (*hangup)(struct ast_channel *chan);
42         /* Answer the line */
43         int (*answer)(struct ast_channel *chan);
44         /* Read a frame, in standard format */
45         struct ast_frame * (*read)(struct ast_channel *chan);
46         /* Write a frame, in standard format */
47         int (*write)(struct ast_channel *chan, struct ast_frame *frame);
48         /* Display or transmit text */
49         int (*send_text)(struct ast_channel *chan, char *text);
50         /* Handle an exception, reading a frame */
51         struct ast_frame * (*exception)(struct ast_channel *chan);
52         /* Bridge two channels of the same type together */
53         int (*bridge)(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
54 };
55
56 /* Create a channel structure */
57 struct ast_channel *ast_channel_alloc(void);
58 void  ast_channel_free(struct ast_channel *);
59
60 #if defined(__cplusplus) || defined(c_plusplus)
61 }
62 #endif
63
64
65 #endif