1 /*****************************************************************************\
3 ** Linux Call Router **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** mISDN channel handlin for remote application **
10 \*****************************************************************************/
12 /* this test produces a test tone to test gaps in audio stream */
13 //#define SEAMLESS_TEST
15 #define QUEUE_BUFFER_SIZE 8192 /* must be the power of two */
16 #define QUEUE_BUFFER_MAX 4096 /* half of size */
19 struct bchannel *next;
20 struct chan_call *call; /* link to call process */
21 unsigned int handle; /* handle for stack id */
22 int b_sock; /* socket for b-channel */
23 struct lcr_fd lcr_fd; /* socket register */
24 int b_mode; /* dsp, raw, dsphdlc */
29 int b_tx_gain, b_rx_gain;
38 unsigned char b_bf_key[128];
39 int nodsp_queue; /* enables nodsp_queue_buffer */
40 unsigned char nodsp_queue_buffer[QUEUE_BUFFER_SIZE];
41 /* buffer for seamless transmission */
42 unsigned int nodsp_queue_in, nodsp_queue_out;
43 /* in and out pointers */
44 int queue_sent; /* data for mISDN was not confrmed yet */
51 extern struct bchannel *bchannel_first;
52 extern pid_t bchannel_pid;
54 int bchannel_initialize(void);
55 void bchannel_deinitialize(void);
56 void bchannel_destroy(struct bchannel *bchannel);
57 int bchannel_create(struct bchannel *channel, int mode, int queue);
58 void bchannel_activate(struct bchannel *channel, int activate);
59 void bchannel_transmit(struct bchannel *channel, unsigned char *data, int len);
60 void bchannel_join(struct bchannel *channel, unsigned short id);
61 void bchannel_dtmf(struct bchannel *channel, int on);
62 void bchannel_blowfish(struct bchannel *bchannel, unsigned char *key, int len);
63 void bchannel_pipeline(struct bchannel *bchannel, char *pipeline);
64 void bchannel_gain(struct bchannel *bchannel, int gain, int tx);
65 struct bchannel *find_bchannel_handle(unsigned int handle);
66 //struct bchannel *find_bchannel_ref(unsigned int ref);
67 struct bchannel *alloc_bchannel(unsigned int handle);
68 void free_bchannel(struct bchannel *channel);