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 channel_force; /* forces channel by protocol */
54 int nodtmf; /* disables DTMF */
55 struct select_channel *out_channel; /* list of channels to select */
56 struct select_channel *in_channel; /* the same for incoming channels */
57 int block; /* set if interface is blocked */
60 struct interface_msn {
61 struct interface_msn *next;
62 char msn[64]; /* msn */
65 struct interface_screen {
66 struct interface_screen *next;
67 char match[64]; /* what caller id to match */
68 int match_type; /* number type */
69 int match_present; /* presentation type */
70 char result[64]; /* what caller id to change to */
71 int result_type; /* number type */
72 int result_present; /* presentation type */
75 struct interface_filter {
76 struct interface_filter *next;
77 int filter; /* filter to use */
78 char parameter[256]; /* filter parameter */
82 struct interface *next;
83 char name[64]; /* name of interface */
84 int extension; /* calls are handled as extension */
85 int is_tones; /* generate tones */
86 int is_earlyb; /* bridge tones during call setup */
87 int hunt; /* select algorithm */
88 int hunt_next; /* ifport index to start hunt */
89 struct interface_port *ifport; /* link to interface port list */
90 struct interface_msn *ifmsn; /* link to interface msn list */
91 struct interface_screen *ifscreen_in; /* link to screening list */
92 struct interface_screen *ifscreen_out; /* link to screening list */
93 struct interface_filter *iffilter; /* link to filter list */
96 struct interface_param {
98 /* return value (pointer of function)(args ...) */
99 int (*func)(struct interface *, char *, int, char *, char*);
105 extern struct interface *interface_first;
106 extern struct interface *interface_newlist;
108 extern char interface_error[256];
109 struct interface *read_interfaces(void);
110 void free_interfaces(struct interface *interface_start);
111 void relink_interfaces(void);
112 void load_port(struct interface_port *ifport);
113 void doc_interface(void);