00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _ASTERISK_ADSI_H
00024 #define _ASTERISK_ADSI_H
00025
00026 #include "asterisk/callerid.h"
00027
00028
00029
00030
00031
00032 #define ADSI_MSG_DISPLAY 132
00033 #define ADSI_MSG_DOWNLOAD 133
00034
00035
00036 #define ADSI_LOAD_SOFTKEY 128
00037 #define ADSI_INIT_SOFTKEY_LINE 129
00038 #define ADSI_LOAD_VIRTUAL_DISP 130
00039 #define ADSI_LINE_CONTROL 131
00040 #define ADSI_INFORMATION 132
00041 #define ADSI_DISC_SESSION 133
00042 #define ADSI_SWITCH_TO_DATA 134
00043 #define ADSI_SWITCH_TO_VOICE 135
00044 #define ADSI_CLEAR_SOFTKEY 136
00045 #define ADSI_INPUT_CONTROL 137
00046 #define ADSI_INPUT_FORMAT 138
00047 #define ADSI_SWITCH_TO_PERIPH 139
00048 #define ADSI_MOVE_DATA 140
00049 #define ADSI_LOAD_DEFAULT 141
00050 #define ADSI_CONNECT_SESSION 142
00051 #define ADSI_CLEAR_TYPE_AHEAD 143
00052 #define ADSI_DISPLAY_CALL_BUF 144
00053 #define ADSI_CLEAR_CALL_BUF 145
00054 #define ADSI_SWITCH_TO_ALT 146
00055 #define ADSI_SWITCH_TO_GRAPHICS 147
00056 #define ADSI_CLEAR_SCREEN 148
00057 #define ADSI_QUERY_CONFIG 149
00058 #define ADSI_QUERY_CPEID 150
00059 #define ADSI_SWITCH_TO_APP 151
00060
00061
00062 #define ADSI_LOAD_SOFTKEY_TABLE 128
00063 #define ADSI_LOAD_PREDEF_DISP 129
00064 #define ADSI_LOAD_SCRIPT 130
00065 #define ADSI_DOWNLOAD_CONNECT 131
00066 #define ADSI_DOWNLOAD_DISC 132
00067
00068
00069 #define ADSI_ENCODED_DTMF 0x80
00070 #define ADSI_ON_HOOK 0x81
00071 #define ADSI_OFF_HOOK 0x82
00072 #define ADSI_FLASH 0x83
00073 #define ADSI_DIAL_TONE_DETECT 0x84
00074 #define ADSI_LINE_NUMBER 0x85
00075 #define ADSI_BLANK 0x86
00076 #define ADSI_SEND_CHARS 0x87
00077 #define ADSI_CLEAR_CHARS 0x88
00078 #define ADSI_BACKSPACE 0x89
00079 #define ADSI_TAB_COLUMN 0x8A
00080 #define ADSI_GOTO_LINE 0x8B
00081 #define ADSI_GOTO_LINE_REL 0x8C
00082 #define ADSI_PAGE_UP 0x8D
00083 #define ADSI_PAGE_DOWN 0x8E
00084 #define ADSI_EXTENDED_DTMF 0x8F
00085 #define ADSI_DELAY 0x90
00086 #define ADSI_DIAL_PULSE_ONE 0x91
00087 #define ADSI_SWITCH_TO_DATA2 0x92
00088 #define ADSI_SWITCH_TO_VOICE2 0x93
00089 #define ADSI_DISP_CALL_BUF 0x94
00090 #define ADSI_CLEAR_CALL_B 0x95
00091
00092 #ifdef __ADSI_CPE
00093
00094 #define ADSI_DISPLAY_CONTROL 0x98
00095 #define ADSI_DISPLAY_SOFT_KEYS 0x99
00096 #define ADSI_CHANGE_STATE 0x9A
00097 #define ADSI_START_CLEAR_TIMER 0x9B
00098 #define ADSI_SET_SCRIPT_FLAG 0x9C
00099 #define ADSI_JUMP_TO_SUBSCRIPT 0x9D
00100 #define ADSI_EVENT_22_TRIGGER 0x9E
00101 #define ADSI_EVENT_23_TRIGGER 0x9f
00102 #define ADSI_EXIT 0xA0
00103 #endif
00104
00105
00106 #define ADSI_INFO_PAGE 0x0
00107 #define ADSI_COMM_PAGE 0x1
00108
00109 #define ADSI_KEY_APPS 16
00110
00111
00112 #define ADSI_JUST_LEFT 0x2
00113 #define ADSI_JUST_RIGHT 0x1
00114 #define ADSI_JUST_CENT 0x0
00115 #define ADSI_JUST_IND 0x3
00116
00117 #define ADSI_KEY_SKT 0x80
00118 #define ADSI_KEY_HILITE 0x40
00119
00120 #define ADSI_DIR_FROM_LEFT (0)
00121 #define ADSI_DIR_FROM_RIGHT (1)
00122
00123 #define AST_ADSI_VERSION 1
00124
00125
00126
00127 int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
00128
00129 int ast_adsi_end_download(struct ast_channel *chan);
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 int ast_adsi_channel_restore(struct ast_channel *chan);
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 int ast_adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data);
00166 int ast_adsi_unload_session(struct ast_channel *chan);
00167
00168
00169 int ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
00170 int ast_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
00171
00172
00173
00174 int ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen);
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 int ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
00189
00190
00191
00192
00193 int ast_adsi_query_cpeid(unsigned char *buf);
00194 int ast_adsi_query_cpeinfo(unsigned char *buf);
00195
00196
00197
00198
00199
00200
00201 int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice);
00202
00203 int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 int ast_adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
00218
00219
00220
00221
00222
00223
00224
00225
00226 int ast_adsi_disconnect_session(unsigned char *buf);
00227
00228
00229
00230
00231
00232
00233
00234
00235 int ast_adsi_download_disconnect(unsigned char *buf);
00236
00237
00238
00239
00240
00241
00242
00243
00244 int ast_adsi_data_mode(unsigned char *buf);
00245 int ast_adsi_clear_soft_keys(unsigned char *buf);
00246 int ast_adsi_clear_screen(unsigned char *buf);
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256 int ast_adsi_voice_mode(unsigned char *buf, int when);
00257
00258
00259
00260
00261
00262 int ast_adsi_available(struct ast_channel *chan);
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 int ast_adsi_set_line(unsigned char *buf, int page, int line);
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304 int ast_adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data);
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 int ast_adsi_set_keys(unsigned char *buf, unsigned char *keys);
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329 int ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just);
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343 int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
00344
00345 struct adsi_funcs {
00346 unsigned int version;
00347 int (*begin_download)(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
00348 int (*end_download)(struct ast_channel *chan);
00349 int (*channel_restore) (struct ast_channel *chan);
00350 int (*print) (struct ast_channel *chan, char **lines, int *align, int voice);
00351 int (*load_session) (struct ast_channel *chan, unsigned char *app, int ver, int data);
00352 int (*unload_session) (struct ast_channel *chan);
00353 int (*transmit_message) (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
00354 int (*transmit_message_full) (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
00355 int (*read_encoded_dtmf) (struct ast_channel *chan, unsigned char *buf, int maxlen);
00356 int (*connect_session) (unsigned char *buf, unsigned char *fdn, int ver);
00357 int (*query_cpeid) (unsigned char *buf);
00358 int (*query_cpeinfo) (unsigned char *buf);
00359 int (*get_cpeid) (struct ast_channel *chan, unsigned char *cpeid, int voice);
00360 int (*get_cpeinfo) (struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
00361 int (*download_connect) (unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
00362 int (*disconnect_session) (unsigned char *buf);
00363 int (*download_disconnect) (unsigned char *buf);
00364 int (*data_mode) (unsigned char *buf);
00365 int (*clear_soft_keys) (unsigned char *buf);
00366 int (*clear_screen) (unsigned char *buf);
00367 int (*voice_mode) (unsigned char *buf, int when);
00368 int (*available) (struct ast_channel *chan);
00369 int (*display) (unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
00370 int (*set_line) (unsigned char *buf, int page, int line);
00371 int (*load_soft_key) (unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data);
00372 int (*set_keys) (unsigned char *buf, unsigned char *keys);
00373 int (*input_control) (unsigned char *buf, int page, int line, int display, int format, int just);
00374 int (*input_format) (unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
00375 };
00376
00377 void ast_adsi_install_funcs(const struct adsi_funcs *funcs);
00378
00379 #endif
00380