summaryrefslogtreecommitdiffstats
path: root/lcrsocket.h
diff options
context:
space:
mode:
authorSuper User2008-02-03 13:47:33 +0100
committerSuper User2008-02-03 13:47:33 +0100
commit5ad4c41dc406a15beaa0a7b73d9dada1df74f939 (patch)
tree4c46478eb2ed26258b4d4727ebf47b62318c6794 /lcrsocket.h
parentwork on asterisk channel driver (diff)
downloadlcr-5ad4c41dc406a15beaa0a7b73d9dada1df74f939.tar.gz
lcr-5ad4c41dc406a15beaa0a7b73d9dada1df74f939.tar.xz
lcr-5ad4c41dc406a15beaa0a7b73d9dada1df74f939.zip
now gives warning if mISDN branch is wrong.
also some work on chan_lcr. modified: Makefile modified: apppbx.cpp modified: bchannel.c modified: chan_lcr.c modified: chan_lcr.h modified: dss1.cpp modified: dss1.h modified: extension.c modified: extension.h modified: genrc.c modified: ie.cpp renamed: admin_client.c -> lcradmin.c renamed: admin.h -> lcrsocket.h modified: mISDN.cpp modified: main.h renamed: admin_server.c -> socket_server.c renamed: admin_server.h -> socket_server.h modified: todo.txt
Diffstat (limited to 'lcrsocket.h')
-rw-r--r--lcrsocket.h185
1 files changed, 185 insertions, 0 deletions
diff --git a/lcrsocket.h b/lcrsocket.h
new file mode 100644
index 0000000..a34820d
--- /dev/null
+++ b/lcrsocket.h
@@ -0,0 +1,185 @@
+/*****************************************************************************\
+** **
+** Linux Call Router **
+** **
+**---------------------------------------------------------------------------**
+** Copyright: Andreas Eversberg **
+** **
+** Administration tool header file **
+** **
+\*****************************************************************************/
+
+#define SOCKET_NAME "/var/run/LCR.socket"
+
+/* structures that define message between admin-tool and pbx */
+
+enum { /* messages */
+ ADMIN_REQUEST_CMD_INTERFACE,
+ ADMIN_RESPONSE_CMD_INTERFACE,
+ ADMIN_REQUEST_CMD_ROUTE,
+ ADMIN_RESPONSE_CMD_ROUTE,
+ ADMIN_REQUEST_CMD_DIAL,
+ ADMIN_RESPONSE_CMD_DIAL,
+ ADMIN_REQUEST_CMD_RELEASE,
+ ADMIN_RESPONSE_CMD_RELEASE,
+ ADMIN_REQUEST_CMD_BLOCK,
+ ADMIN_RESPONSE_CMD_BLOCK,
+ ADMIN_REQUEST_STATE,
+ ADMIN_RESPONSE_STATE,
+ ADMIN_RESPONSE_S_REMOTE,
+ ADMIN_RESPONSE_S_INTERFACE,
+ ADMIN_RESPONSE_S_PORT,
+ ADMIN_RESPONSE_S_EPOINT,
+ ADMIN_RESPONSE_S_JOIN,
+ ADMIN_CALL_SETUP,
+ ADMIN_CALL_SETUP_ACK,
+ ADMIN_CALL_PROCEEDING,
+ ADMIN_CALL_ALERTING,
+ ADMIN_CALL_CONNECT,
+ ADMIN_CALL_DISCONNECT,
+ ADMIN_CALL_RELEASE,
+ ADMIN_CALL_NOTIFY,
+ ADMIN_TRACE_REQUEST,
+ ADMIN_TRACE_RESPONSE,
+ ADMIN_MESSAGE,
+};
+
+struct admin_response_cmd {
+ int error; /* error code 0 = ok*/
+ char message[256]; /* info / response text */
+ int block;
+ int portnum;
+};
+
+struct admin_response_state {
+ char version_string[64];
+ struct tm tm;
+ char logfile[128];
+ int interfaces;
+ int remotes;
+ int joins;
+ int epoints;
+ int ports;
+};
+
+struct admin_response_interface {
+ char interface_name[32];
+ int portnum;
+ int block;
+ int ntmode;
+ int ptp;
+ int pri;
+ int extension;
+ int use; /* number of ports that use this interface */
+ int l1link; /* down(0) or up(1) */
+ int l2link; /* down(0) or up(1) */
+ int channels;
+ char busy[256]; /* if port is idle(0) busy(1) */
+ unsigned long port[256]; /* current port */
+};
+
+struct admin_response_remote {
+ char name[32]; /* name of remote application */
+};
+
+struct admin_response_join {
+ unsigned long serial; /* join serial number */
+ char remote[32]; /* remote application name */
+ unsigned long partyline;
+};
+
+struct admin_response_epoint {
+ unsigned long serial;
+ unsigned long join; /* link to join */
+// int join_notify; /* if relation notified on hold */
+// int join_hold; /* if relation on hold */
+ int rx_state;
+ int tx_state;
+ int state;
+ char terminal[16];
+ char callerid[64];
+ char dialing[64];
+ char action[32];
+ int park; /* if parked */
+ int park_len;
+ unsigned char park_callid[8];
+ int crypt; /* crypt state */
+};
+
+struct admin_response_port {
+ unsigned long serial; /* port serial number */
+ char name[64]; /* name of port */
+ unsigned long epoint; /* link to epoint */
+ int state;
+ int isdn; /* if port is isdn */
+ int isdn_chan; /* bchannel number */
+ int isdn_hold; /* on hold */
+ int isdn_ces; /* ces to use (>=0)*/
+};
+
+struct admin_call {
+ char interface[64]; /* name of port */
+ char callerid[64]; /* use caller id */
+ char dialing[64]; /* number to dial */
+ int present; /* presentation */
+ int cause; /* cause to send */
+ int location;
+ int notify;
+ int bc_capa;
+ int bc_mode;
+ int bc_info1;
+ int hlc;
+ int exthlc;
+};
+
+struct admin_trace_req {
+ int detail;
+ char category;
+ int port;
+ char interface[64];
+ char caller[34];
+ char dialing[64];
+};
+
+struct admin_trace_rsp {
+ char text[1024];
+};
+
+struct admin_msg {
+ int type; /* type of message */
+ unsigned long ref; /* reference to individual endpoints */
+ union parameter param; /* parameter union */
+};
+
+struct admin_message {
+ int message; /* type of admin message */
+ union u {
+ struct admin_response_cmd x;
+ struct admin_response_state s;
+ struct admin_response_interface i;
+ struct admin_response_port p;
+ struct admin_response_epoint e;
+ struct admin_response_join j;
+ struct admin_response_remote r;
+ struct admin_call call;
+ struct admin_msg msg;
+ struct admin_trace_req trace_req;
+ struct admin_trace_rsp trace_rsp;
+ } u;
+};
+
+/* call states */
+enum {
+ ADMIN_STATE_IDLE,
+ ADMIN_STATE_IN_SETUP,
+ ADMIN_STATE_OUT_SETUP,
+ ADMIN_STATE_IN_OVERLAP,
+ ADMIN_STATE_OUT_OVERLAP,
+ ADMIN_STATE_IN_PROCEEDING,
+ ADMIN_STATE_OUT_PROCEEDING,
+ ADMIN_STATE_IN_ALERTING,
+ ADMIN_STATE_OUT_ALERTING,
+ ADMIN_STATE_CONNECT,
+ ADMIN_STATE_IN_DISCONNECT,
+ ADMIN_STATE_OUT_DISCONNECT,
+};