Version 0.1.1 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         /* Send a literal DTMF digit */
28         int (*send_digit)(struct ast_channel *chan, char digit);
29         /* Call a given phone number (address, etc), but don't
30            take longer than timeout seconds to do so.  */
31         int (*call)(struct ast_channel *chan, char *addr, int timeout);
32         /* Hangup (and possibly destroy) the channel */
33         int (*hangup)(struct ast_channel *chan);
34         /* Answer the line */
35         int (*answer)(struct ast_channel *chan);
36         /* Read a frame, in standard format */
37         struct ast_frame * (*read)(struct ast_channel *chan);
38         /* Write a frame, in standard format */
39         int (*write)(struct ast_channel *chan, struct ast_frame *frame);
40 };
41
42 /* Create a channel structure */
43 struct ast_channel *ast_channel_alloc(void);
44 void  ast_channel_free(struct ast_channel *);
45
46 #if defined(__cplusplus) || defined(c_plusplus)
47 }
48 #endif
49
50
51 #endif