work on chan_lcr: bridging works, interface selection possible
[lcr.git] / bchannel.h
1 /*****************************************************************************\
2 **                                                                           **
3 ** Linux Call Router                                                         **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** mISDN channel handlin for remote application                              **
9 **                                                                           **
10 \*****************************************************************************/ 
11
12
13 struct bchannel {
14         struct bchannel *next;
15         struct chan_call *call;         /* link to call process */
16         unsigned long handle;           /* handle for stack id */
17         int b_sock;                     /* socket for b-channel */
18         int b_state;
19         int b_txdata;
20         int b_delay;
21         int b_tx_dejitter;
22         int b_tx_gain, b_rx_gain;
23         char b_pipeline[256];
24         unsigned long b_conf;
25         int b_echo;
26         int b_tone;
27         int b_rxoff;
28         // int b_txmix;
29         int b_dtmf;
30         int b_crypt_len;
31         int b_crypt_type;
32         unsigned char b_crypt_key[128];
33 };
34
35
36 extern struct bchannel *bchannel_first;
37 extern pid_t bchannel_pid;
38
39 int bchannel_initialize(void);
40 void bchannel_deinitialize(void);
41 int bchannel_create(struct bchannel *channel);
42 void bchannel_activate(struct bchannel *channel, int activate);
43 void bchannel_transmit(struct bchannel *channel, unsigned char *data, int len);
44 void bchannel_join(struct bchannel *channel, unsigned short id);
45 void bchannel_dtmf(struct bchannel *channel, int on);
46 int bchannel_handle(void);
47 struct bchannel *find_bchannel_handle(unsigned long handle);
48 //struct bchannel *find_bchannel_ref(unsigned long ref);
49 struct bchannel *alloc_bchannel(unsigned long handle);
50 void free_bchannel(struct bchannel *channel);
51