1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** extension header file **
10 \*****************************************************************************/
12 /* maximum number of redial/powerdial and reply numbers to remember
14 #define MAX_REMEMBER 99
16 /* display of callerid on internal numbers */
19 DISPLAY_CID_ASIS, /* with type as defined */
20 DISPLAY_CID_NUMBER, /* "5551212" */
21 DISPLAY_CID_ABBREVIATION, /* "05" */
22 DISPLAY_CID_NAME, /* "Axel" */
23 DISPLAY_CID_NAME_NUMBER, /* "Axel 5551212" */
24 DISPLAY_CID_NUMBER_NAME, /* "5551212 Axel" */
25 DISPLAY_CID_ABBREV_NUMBER, /* "05 5551212" */
26 DISPLAY_CID_ABBREV_NAME, /* "05 Axel" */
27 DISPLAY_CID_ABBREV_NUMBER_NAME, /* "05 5551212 Axel" */
28 DISPLAY_CID_ABBREV_NAME_NUMBER, /* "05 Axel 5551212" */
31 DISPLAY_CID_INTERNAL_OFF, /* "20" */
32 DISPLAY_CID_INTERNAL_ON, /* "Intern 20" */
35 /* display of clear causes using display messages */
39 DISPLAY_CAUSE_ENGLISH, /* "34 - no channel" */
40 DISPLAY_CAUSE_GERMAN, /* "34 - kein Kanal" */
41 DISPLAY_LOCATION_ENGLISH, /* "34 - Network (Remote)" */
42 DISPLAY_LOCATION_GERMAN, /* "34 - Vermittlung (Gegenstelle)" */
43 DISPLAY_CAUSE_NUMBER, /* "Cause 34" */
49 CLIP_ASIS, /* use colp as presented by caller */
50 CLIP_HIDE, /* use extension's caller id */
56 COLP_ASIS, /* use colp as presented by called */
57 COLP_HIDE, /* use extension's caller id */
58 COLP_FORCE, /* use colp even if called dosn't provide or allow */
64 CODEC_OFF, /* record wave off */
65 CODEC_MONO, /* record wave mono */
66 CODEC_STEREO, /* record wave stereo */
67 CODEC_8BIT, /* record wave mono 8bit */
68 CODEC_LAW, /* record LAW */
74 VBOX_MODE_NORMAL, /* normal mode: send announcement, then record */
75 VBOX_MODE_PARALLEL, /* parallel mode: send announcement and record during announcement */
76 VBOX_MODE_ANNOUNCEMENT, /* announcement mode: send announcement and disconnect */
82 VBOX_DISPLAY_BRIEF, /* parallel mode: send announcement and record during announcement */
83 VBOX_DISPLAY_DETAILED, /* announcement mode: send announcement and disconnect */
84 VBOX_DISPLAY_OFF, /* normal mode: send announcement, then record */
90 VBOX_LANGUAGE_ENGLISH, /* display and announcements are in english */
91 VBOX_LANGUAGE_GERMAN, /* display and announcements are in german */
106 * extensions are settings saved at <extensions_dir>/<extension>/settings
107 * they carry all information and permissions about an extension
108 * they will be loaded when needed and saved when changed
112 char number[32]; /* number of extension */
115 char next[32]; /* next number to dial when pickup (temp prefix) */
123 char interfaces[128];
126 int callerid_present;
127 char id_next_call[32];
128 int id_next_call_type;
129 int id_next_call_present;
131 int clip; /* how to present caller id on forwarded calls */
132 int colp; /* how to present called line id on forwarded calls */
133 char clip_prefix[32]; /* prefix for screening incomming clip */
134 int keypad; /* support keypad for call control */
135 int centrex; /* present name of caller/called on internal extension */
136 int anon_ignore; /* ignore anonymouse calls */
138 int delete_ext; /* delete function for external dialing */
139 int noknocking; /* deny knocking of incoming call */
140 char last_out[MAX_REMEMBER][64]; /* numbers to redail */
141 char last_in[MAX_REMEMBER][64]; /* numbers to reply */
144 int display_cause; /* clear cause using display message */
145 int display_ext; /* display external caller ids */
146 int display_int; /* display internal caller ids */
147 int display_fake; /* display fake caller ids */
148 int display_anon; /* display anonymouse caller ids */
149 int display_menu; /* display menu */
150 int display_dialing; /* display interpreted digits while dialing */
151 int display_name; /* display caller's name if available (CNIP) */
152 char tones_dir[64]; /* directory of all tones/patterns */
153 int record; /* SEE RECORD_* */
154 char password[64]; /* callback / login password */
156 int vbox_mode; /* see VBOX_MODE_* */
157 int vbox_codec; /* see CODEC_* */
158 int vbox_time; /* time to recorde, 0=infinite */
159 int vbox_display; /* see VBOX_DISPLAY_* */
160 int vbox_language; /* see VBOX_LANGUAGE_* */
161 char vbox_email[128]; /* send mail if given */
162 int vbox_email_file; /* set, if also the audio fille will be attached */
163 int vbox_free; /* if vbox shall connect after announcment */
177 int facility; /* must be set to forward facility to terminal */
178 int datacall; /* data calls are handled as voice calls */
179 int no_seconds; /* don't include seconds in the connect message */
182 int read_extension(struct extension *ext, char *number);
183 int write_extension(struct extension *ext, char *number);
184 int write_log(char *number, char *callerid, char *calledid, time_t start, time_t stop, int aoce, int cause, int location);
185 int parse_phonebook(char *number, char **abbrev_pointer, char **phone_pointer, char **name_pointer);
186 int parse_secrets(char *number, char *remote_id, char **auth_pointer, char **crypt_pointer, char **key_pointer);
187 char *parse_directory(char *number, int type);
188 int parse_callbackauth(char *number, struct caller_info *callerinfo);
189 void append_callbackauth(char *number, struct caller_info *callerinfo);