Replaced polling loop for LCR and chan_lcr with select based event loop.
[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 int handle;            /* handle for stack id */
17         int b_sock;                     /* socket for b-channel */
18         struct lcr_fd lcr_fd;           /* socket register */
19         int b_mode;                     /* dsp, raw, dsphdlc */
20         int b_state;
21         int b_txdata;
22         int b_delay;
23         int b_tx_dejitter;
24         int b_tx_gain, b_rx_gain;
25         char b_pipeline[256];
26         unsigned int b_conf;
27         int b_echo;
28         int b_tone;
29         int b_rxoff;
30         // int b_txmix;
31         int b_dtmf;
32         int b_bf_len;
33         unsigned char b_bf_key[128];
34 };
35
36
37 extern struct bchannel *bchannel_first;
38 extern pid_t bchannel_pid;
39
40 int bchannel_initialize(void);
41 void bchannel_deinitialize(void);
42 void bchannel_destroy(struct bchannel *bchannel);
43 int bchannel_create(struct bchannel *channel, int mode);
44 void bchannel_activate(struct bchannel *channel, int activate);
45 void bchannel_transmit(struct bchannel *channel, unsigned char *data, int len);
46 void bchannel_join(struct bchannel *channel, unsigned short id);
47 void bchannel_dtmf(struct bchannel *channel, int on);
48 void bchannel_blowfish(struct bchannel *bchannel, unsigned char *key, int len);
49 void bchannel_pipeline(struct bchannel *bchannel, char *pipeline);
50 void bchannel_gain(struct bchannel *bchannel, int gain, int tx);
51 struct bchannel *find_bchannel_handle(unsigned int handle);
52 //struct bchannel *find_bchannel_ref(unsigned int ref);
53 struct bchannel *alloc_bchannel(unsigned int handle);
54 void free_bchannel(struct bchannel *channel);
55