1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** interface header file **
10 \*****************************************************************************/
11 enum { /* interface type */
16 /* channel selection -1 is reserved for "no ie" */
18 #define CHANNEL_ANY -3
19 #define CHANNEL_FREE -100
22 enum { HUNT_LINEAR = 0,
32 enum { IS_DEFAULT = 0,
37 struct select_channel {
38 struct select_channel *next;
42 struct interface_port {
43 struct interface_port *next;
44 struct interface *interface; /* link to interface */
45 struct mISDNport *mISDNport; /* link to port */
46 int portnum; /* port number */
47 char portname[64]; /* alternately: port name */
48 int ptp; /* force load stack in PTP mode */
49 int ptmp; /* force load stack in PTP mode */
50 int nt; /* load stack in NT-mode */
51 int tespecial; /* special TE-mode behavior */
52 int l1hold; /* hold layer 1 (1=on, 0=off) */
53 int l2hold; /* hold layer 2 (1=force, -1=disable, 0=default) */
54 unsigned int ss5; /* set, if SS5 signalling enabled, also holds feature bits */
55 int channel_force; /* forces channel by protocol */
56 int nodtmf; /* disables DTMF */
57 int dtmf_threshold; /* DTMF level threshold */
58 struct select_channel *out_channel; /* list of channels to select */
59 struct select_channel *in_channel; /* the same for incoming channels */
60 int block; /* set if interface is blocked */
68 int dialmax; /* maximum number of digits to dial */
69 int nonotify; /* blocks outgoing notify messages */
70 int pots_flash; /* allow flash button / keypulse to hold active call */
71 int pots_ring; /* after hangup let calls on hold ring the phone */
72 int pots_transfer; /* after hangup, two calls are transfered */
75 struct interface_msn {
76 struct interface_msn *next;
77 char msn[64]; /* msn */
80 struct interface_screen {
81 struct interface_screen *next;
82 char match[64]; /* what caller id to match */
83 int match_type; /* number type */
84 int match_present; /* presentation type */
85 char result[64]; /* what caller id to change to */
86 int result_type; /* number type */
87 int result_present; /* presentation type */
91 struct interface *next;
92 char name[64]; /* name of interface */
93 int app; /* application to use for interface (0 = PBX) */
94 char bridge_if[64]; /* name of destination interface for bridge application */
95 int external; /* interface used for external calls */
96 int extension; /* calls are handled as extension */
97 int is_tones; /* generate tones */
98 int is_earlyb; /* bridge tones during call setup */
99 int shutdown; /* interface will not automatically be loaded */
100 int hunt; /* select algorithm */
101 int hunt_next; /* ifport index to start hunt */
102 struct interface_port *ifport; /* link to interface port list */
103 struct interface_msn *ifmsn; /* link to interface msn list */
104 struct interface_screen *ifscreen_in; /* link to screening list */
105 struct interface_screen *ifscreen_out; /* link to screening list */
106 int tx_gain, rx_gain; /* filter gain */
108 char pipeline[256]; /* filter pipeline */
109 unsigned char bf_key[56]; /* filter blowfish */
110 int bf_len; /* filter length of blowfish */
111 int remote; /* interface is a remote app interface */
112 char remote_app[32]; /* name of remote application */
113 char remote_context[128]; /* context feld to use for remote application */
115 int gsm_bs; /* interface is an GSM BS interface */
116 char gsm_bs_name[32]; /* name of bs */
117 int gsm_bs_hr; /* prefer half rate for MOT calls */
120 unsigned char gsm_bs_payload_types[8];
124 int gsm_ms; /* interface is an GSM MS interface */
125 char gsm_ms_name[32]; /* name of ms */
128 int sip; /* interface is a SIP interface */
129 char sip_local_peer[128];
130 char sip_remote_peer[128];
131 char sip_asserted_id[128];
132 char sip_auth_user[128];
133 char sip_auth_password[128];
134 char sip_auth_realm[128];
136 char sip_register_user[128];
137 char sip_register_host[128];
138 int sip_register_interval; /* interval to register */
139 int sip_options_interval; /* timer to keepalive invite/register transactions */
140 char sip_public_ip[128];
141 char sip_stun_server[128];
142 int sip_stun_interval; /* timer to check own IP address */
143 void *sip_inst; /* sip instance */
144 unsigned short rtp_port_from;
145 unsigned short rtp_port_to;
147 int rtp_bridge; /* bridge RTP directly (for calls comming from interface) */
150 struct interface_param {
152 /* return value (pointer of function)(args ...) */
153 int (*func)(struct interface *, char *, int, char *, char*);
159 extern struct interface *interface_first;
160 extern struct interface *interface_newlist;
162 extern char interface_error[256];
163 struct interface *read_interfaces(void);
164 void free_interfaces(struct interface *interface_start);
165 void relink_interfaces(void);
166 void load_mISDN_port(struct interface_port *ifport);
167 void doc_interface(void);
168 void do_screen(int out, char *id, int idsize, int *type, int *present, const char *interface_name);
169 struct interface *getinterfacebyname(const char *name);