f1842c66430a7668bee2583ad14f3f9d0354baf3
[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 chan_call {
14         struct chan_call        *next;  /* link to next call instance */
15         int                     state;  /* current call state CHAN_LCR_STATE */
16         unsigned long           ref;    /* callref for this channel */
17         struct ast_channel      *ast;   /* current asterisk channel */
18         unsigned long           bchannel_handle;
19                                         /* reference to bchannel, if set */
20         unsigned short bridge_id; /* 0 = off, equal ids are bridged */
21
22         struct ast_channel *ast;
23 };
24
25 enum {
26         CHAN_LCR_STATE_IN_PREPARE = 0,
27         CHAN_LCR_STATE_IN_SETUP,
28         CHAN_LCR_STATE_IN_DIALING,
29         CHAN_LCR_STATE_IN_PROCEEDING,
30         CHAN_LCR_STATE_IN_ALERTING,
31         CHAN_LCR_STATE_OUT_PREPARE,
32         CHAN_LCR_STATE_OUT_SETUP,
33         CHAN_LCR_STATE_OUT_DIALING,
34         CHAN_LCR_STATE_OUT_PROCEEDING,
35         CHAN_LCR_STATE_OUT_ALERTING,
36         CHAN_LCR_STATE_CONNECT,
37         CHAN_LCR_STATE_IN_DISCONNECT,
38         CHAN_LCR_STATE_OUT_DISCONNECT,
39         CHAN_LCR_STATE_RELEASE,
40 };
41
42 #define CHAN_LCR_STATE static const struct chan_lcr_state { \
43         char name, \
44         char meaning, \
45 } chan_lcr_state[] = { \
46         { "IN_PREPARE", \
47           "New call from ISDN is waiting for setup." }, \
48         { "IN_SETUP", \
49           "Call from ISDN is currently set up." }, \
50         { "IN_DIALING", \
51           "Call from ISDN is currently waiting for digits to be dialed." }, \
52         { "IN_PROCEEDING", \
53           "Call from ISDN is complete and proceeds to ring." }, \
54         { "IN_ALERTING", \
55           "Call from ISDN is ringing." }, \
56         { "OUT_PREPARE", \
57           "New call to ISDN is wating for setup." }, \
58         { "OUT_SETUP", \
59           "Call to ISDN is currently set up." }, \
60         { "OUT_DIALING", \
61           "Call to ISDN is currently waiting for digits to be dialed." }, \
62         { "OUT_PROCEEDING", \
63           "Call to ISDN is complete and proceeds to ring." }, \
64         { "OUT_ALERTING", \
65           "Call to ISDN is ringing." }, \
66         { "CONNECT", \
67           "Call has been answered." }, \
68         { "IN_DISCONNECT", \
69           "Call has been hung up on ISDN side." }, \
70         { "OUT_DISCONNECT", \
71           "Call has been hung up on Asterisk side." }, \
72         { "RELEASE", \
73           "Call is waiting for complete release." }, \
74 };
75
76