chan_lcr work
[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         void                    *ast;   /* current asterisk channel */
19         struct bchannel         *bchannel;
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         int                     bridge_id;
28                                         /* current ID or 0 */
29         struct chan_call        *bridge_call;
30                                         /* remote instance or NULL */
31 };
32
33 enum {
34         CHAN_LCR_STATE_IN_PREPARE = 0,
35         CHAN_LCR_STATE_IN_SETUP,
36         CHAN_LCR_STATE_IN_DIALING,
37         CHAN_LCR_STATE_IN_PROCEEDING,
38         CHAN_LCR_STATE_IN_ALERTING,
39         CHAN_LCR_STATE_OUT_PREPARE,
40         CHAN_LCR_STATE_OUT_SETUP,
41         CHAN_LCR_STATE_OUT_DIALING,
42         CHAN_LCR_STATE_OUT_PROCEEDING,
43         CHAN_LCR_STATE_OUT_ALERTING,
44         CHAN_LCR_STATE_CONNECT,
45         CHAN_LCR_STATE_IN_DISCONNECT,
46         CHAN_LCR_STATE_OUT_DISCONNECT,
47         CHAN_LCR_STATE_RELEASE,
48 };
49
50 #define CHAN_LCR_STATE static const struct chan_lcr_state { \
51         char *name; \
52         char *meaning; \
53 } chan_lcr_state[] = { \
54         { "IN_PREPARE", \
55           "New call from ISDN is waiting for setup." }, \
56         { "IN_SETUP", \
57           "Call from ISDN is currently set up." }, \
58         { "IN_DIALING", \
59           "Call from ISDN is currently waiting for digits to be dialed." }, \
60         { "IN_PROCEEDING", \
61           "Call from ISDN is complete and proceeds to ring." }, \
62         { "IN_ALERTING", \
63           "Call from ISDN is ringing." }, \
64         { "OUT_PREPARE", \
65           "New call to ISDN is wating for setup." }, \
66         { "OUT_SETUP", \
67           "Call to ISDN is currently set up." }, \
68         { "OUT_DIALING", \
69           "Call to ISDN is currently waiting for digits to be dialed." }, \
70         { "OUT_PROCEEDING", \
71           "Call to ISDN is complete and proceeds to ring." }, \
72         { "OUT_ALERTING", \
73           "Call to ISDN is ringing." }, \
74         { "CONNECT", \
75           "Call has been answered." }, \
76         { "IN_DISCONNECT", \
77           "Call has been hung up on ISDN side." }, \
78         { "OUT_DISCONNECT", \
79           "Call has been hung up on Asterisk side." }, \
80         { "RELEASE", \
81           "Call is waiting for complete release." }, \
82 };
83
84