1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** interface header file **
10 \*****************************************************************************/
12 #define FLAG_PORT_USE 1
13 #define FLAG_PORT_PTP (1<<1)
15 enum { /* interface type */
20 /* channel selection -1 is reserved for "no ie" */
22 #define CHANNEL_ANY -3
23 #define CHANNEL_FREE -100
26 enum { HUNT_LINEAR = 0,
36 enum { IS_DEFAULT = 0,
41 struct select_channel {
42 struct select_channel *next;
46 struct interface_port {
47 struct interface_port *next;
48 struct interface *interface; /* link to interface */
49 struct mISDNport *mISDNport; /* link to port */
50 int portnum; /* port number */
51 int ptp; /* force load stack in PTP mode */
52 int ptmp; /* force load stack in PTP mode */
53 int nt; /* load stack in NT-mode */
54 int channel_force; /* forces channel by protocol */
55 int nodtmf; /* disables DTMF */
56 struct select_channel *out_channel; /* list of channels to select */
57 struct select_channel *in_channel; /* the same for incoming channels */
58 int block; /* set if interface is blocked */
68 struct interface_msn {
69 struct interface_msn *next;
70 char msn[64]; /* msn */
73 struct interface_screen {
74 struct interface_screen *next;
75 char match[64]; /* what caller id to match */
76 int match_type; /* number type */
77 int match_present; /* presentation type */
78 char result[64]; /* what caller id to change to */
79 int result_type; /* number type */
80 int result_present; /* presentation type */
84 struct interface *next;
85 char name[64]; /* name of interface */
86 int extension; /* calls are handled as extension */
87 int is_tones; /* generate tones */
88 int is_earlyb; /* bridge tones during call setup */
89 int hunt; /* select algorithm */
90 int hunt_next; /* ifport index to start hunt */
91 struct interface_port *ifport; /* link to interface port list */
92 struct interface_msn *ifmsn; /* link to interface msn list */
93 struct interface_screen *ifscreen_in; /* link to screening list */
94 struct interface_screen *ifscreen_out; /* link to screening list */
95 int gain_tx, gain_rx; /* filter gain */
96 char pipeline[256]; /* filter pipeline */
97 unsigned char bf_key[56]; /* filter blowfish */
98 int bf_len; /* filter length of blowfish */
101 struct interface_param {
103 /* return value (pointer of function)(args ...) */
104 int (*func)(struct interface *, char *, int, char *, char*);
110 extern struct interface *interface_first;
111 extern struct interface *interface_newlist;
113 extern char interface_error[256];
114 struct interface *read_interfaces(void);
115 void free_interfaces(struct interface *interface_start);
116 void relink_interfaces(void);
117 void load_port(struct interface_port *ifport);
118 void doc_interface(void);
119 void do_screen(int out, char *id, int idsize, int *type, int *present, struct interface *interface);