17406ce94dfd1fbfd6caef1352fbe5993529c3ff
[lcr.git] / chan_lcr.h
1 /*****************************************************************************\
2 **                                                                           **
3 ** Linux Call Router                                                         **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** Asterisk socket client header                                             **
9 **                                                                           **
10 \*****************************************************************************/
11
12 /* structure for all calls */
13 struct bchannel;
14 struct chan_call {
15         struct chan_call        *next;  /* link to next call instance */
16         int                     state;  /* current call state CHAN_LCR_STATE */
17         unsigned long           ref;    /* callref for this channel */
18         struct ast_channel      *ast;   /* current asterisk channel */
19         struct bchannel         *channel;
20                                         /* reference to bchannel, if set */
21         int                     cause, location;
22                                         /* store cause from lcr */
23         unsigned char           dialque[64];
24                                         /* queue dialing prior setup ack */
25         struct connect_info     connectinfo;
26                                         /* store connectinfo form lcr */
27 };
28
29 enum {
30         CHAN_LCR_STATE_IN_PREPARE = 0,
31         CHAN_LCR_STATE_IN_SETUP,
32         CHAN_LCR_STATE_IN_DIALING,
33         CHAN_LCR_STATE_IN_PROCEEDING,
34         CHAN_LCR_STATE_IN_ALERTING,
35         CHAN_LCR_STATE_OUT_PREPARE,
36         CHAN_LCR_STATE_OUT_SETUP,
37         CHAN_LCR_STATE_OUT_DIALING,
38         CHAN_LCR_STATE_OUT_PROCEEDING,
39         CHAN_LCR_STATE_OUT_ALERTING,
40         CHAN_LCR_STATE_CONNECT,
41         CHAN_LCR_STATE_IN_DISCONNECT,
42         CHAN_LCR_STATE_OUT_DISCONNECT,
43         CHAN_LCR_STATE_RELEASE,
44 };
45
46 #define CHAN_LCR_STATE static const struct chan_lcr_state { \
47         char *name; \
48         char *meaning; \
49 } chan_lcr_state[] = { \
50         { "IN_PREPARE", \
51           "New call from ISDN is waiting for setup." }, \
52         { "IN_SETUP", \
53           "Call from ISDN is currently set up." }, \
54         { "IN_DIALING", \
55           "Call from ISDN is currently waiting for digits to be dialed." }, \
56         { "IN_PROCEEDING", \
57           "Call from ISDN is complete and proceeds to ring." }, \
58         { "IN_ALERTING", \
59           "Call from ISDN is ringing." }, \
60         { "OUT_PREPARE", \
61           "New call to ISDN is wating for setup." }, \
62         { "OUT_SETUP", \
63           "Call to ISDN is currently set up." }, \
64         { "OUT_DIALING", \
65           "Call to ISDN is currently waiting for digits to be dialed." }, \
66         { "OUT_PROCEEDING", \
67           "Call to ISDN is complete and proceeds to ring." }, \
68         { "OUT_ALERTING", \
69           "Call to ISDN is ringing." }, \
70         { "CONNECT", \
71           "Call has been answered." }, \
72         { "IN_DISCONNECT", \
73           "Call has been hung up on ISDN side." }, \
74         { "OUT_DISCONNECT", \
75           "Call has been hung up on Asterisk side." }, \
76         { "RELEASE", \
77           "Call is waiting for complete release." }, \
78 };
79
80