1 /*****************************************************************************\
3 ** Linux Call Router **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** Administration tool header file **
10 \*****************************************************************************/
12 #define SOCKET_NAME "/var/run/LCR.socket"
14 /* structures that define message between admin-tool and pbx */
17 ADMIN_REQUEST_CMD_INTERFACE,
18 ADMIN_RESPONSE_CMD_INTERFACE,
19 ADMIN_REQUEST_CMD_ROUTE,
20 ADMIN_RESPONSE_CMD_ROUTE,
21 ADMIN_REQUEST_CMD_DIAL,
22 ADMIN_RESPONSE_CMD_DIAL,
23 ADMIN_REQUEST_CMD_RELEASE,
24 ADMIN_RESPONSE_CMD_RELEASE,
25 ADMIN_REQUEST_CMD_BLOCK,
26 ADMIN_RESPONSE_CMD_BLOCK,
29 ADMIN_RESPONSE_S_REMOTE,
30 ADMIN_RESPONSE_S_INTERFACE,
31 ADMIN_RESPONSE_S_PORT,
32 ADMIN_RESPONSE_S_EPOINT,
33 ADMIN_RESPONSE_S_JOIN,
36 ADMIN_CALL_PROCEEDING,
39 ADMIN_CALL_DISCONNECT,
47 struct admin_response_cmd {
48 int error; /* error code 0 = ok*/
49 char message[256]; /* info / response text */
54 struct admin_response_state {
55 char version_string[64];
65 struct admin_response_interface {
66 char interface_name[32];
73 int use; /* number of ports that use this interface */
74 int l1link; /* down(0) or up(1) */
75 int l2link; /* down(0) or up(1) */
76 int los, ais, rdi, slip_tx, slip_rx;
78 char busy[256]; /* if port is idle(0) busy(1) */
79 unsigned int port[256]; /* current port */
82 struct admin_response_remote {
83 char name[32]; /* name of remote application */
86 struct admin_response_join {
87 unsigned int serial; /* join serial number */
88 char remote[32]; /* remote application name */
89 unsigned int partyline;
92 struct admin_response_epoint {
94 unsigned int join; /* link to join */
95 // int join_notify; /* if relation notified on hold */
96 // int join_hold; /* if relation on hold */
104 int park; /* if parked */
106 unsigned char park_callid[8];
107 int crypt; /* crypt state */
110 struct admin_response_port {
111 unsigned int serial; /* port serial number */
112 char name[64]; /* name of port */
113 unsigned int epoint; /* link to epoint */
115 int isdn; /* if port is isdn */
116 int isdn_chan; /* bchannel number */
117 int isdn_hold; /* on hold */
118 int isdn_ces; /* ces to use (>=0)*/
122 char interface[64]; /* name of port */
123 char callerid[64]; /* use caller id */
124 char dialing[64]; /* number to dial */
125 int present; /* presentation */
126 int cause; /* cause to send */
136 struct admin_trace_req {
145 struct admin_trace_rsp {
150 int type; /* type of message */
151 unsigned int ref; /* reference to individual endpoints */
152 union parameter param; /* parameter union */
155 struct admin_message {
156 int message; /* type of admin message */
158 struct admin_response_cmd x;
159 struct admin_response_state s;
160 struct admin_response_interface i;
161 struct admin_response_port p;
162 struct admin_response_epoint e;
163 struct admin_response_join j;
164 struct admin_response_remote r;
165 struct admin_call call;
166 struct admin_msg msg;
167 struct admin_trace_req trace_req;
168 struct admin_trace_rsp trace_rsp;
175 ADMIN_STATE_IN_SETUP,
176 ADMIN_STATE_OUT_SETUP,
177 ADMIN_STATE_IN_OVERLAP,
178 ADMIN_STATE_OUT_OVERLAP,
179 ADMIN_STATE_IN_PROCEEDING,
180 ADMIN_STATE_OUT_PROCEEDING,
181 ADMIN_STATE_IN_ALERTING,
182 ADMIN_STATE_OUT_ALERTING,
184 ADMIN_STATE_IN_DISCONNECT,
185 ADMIN_STATE_OUT_DISCONNECT,