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