00001
00013 #ifndef GITKR_CAPI_H
00014 #define GITKR_CAPI_H
00015
00017 #define CAPI_DEFAULT_MAX_B_DATA_SIZE 2048
00018
00019 #define CAPI_DEFAULT_MAX_B_DATA_BLOCKS 8
00020
00021 #define CAPI_DEFAULT_LOGICAL_CONNECTIONS 30
00022
00023 #define CAPI_DEFAULT_CONTROLLER 0x00000001
00024
00025 #define CAPI_DEFAULT_INFOMASK 0x00000144
00026
00027 #define CAPI_DEFAULT_CIPMASK 0x1FFF03FF
00028
00029 #define CAPI_DEFAULT_CIPMASK2 0x00000000
00030
00032 #define CAPI_NO_MEMORY 0x0001
00033
00034 #define CAPI_NO_FACILITY 0x0002
00035
00037 gboolean capi_incoming_connected;
00038
00042 typedef struct CAPI_Info{
00043 unsigned capi_data_buf_size;
00044 unsigned capi_num_bufs;
00045 unsigned capi_num_logical_conn;
00046
00047 unsigned capi_appid;
00048 unsigned long controller;
00049 unsigned long plci;
00050 unsigned long ncci;
00051
00052 int provide_dtmf;
00053 int listen;
00054 short msg_number;
00055 } CAPI_Info;
00056
00060 typedef struct CAPI_Dtmf{
00061 union{
00062 struct _CAPI_Dtmf{
00063 int msg_number;
00064 int timediff;
00065 char signcode;
00066 } dtmf_sign;
00067 int member_count;
00068 }member;
00069 } CAPI_Dtmf;
00070
00074 typedef struct CAPI_Data{
00075 int data_length;
00076 void *data_addr;
00077 } CAPI_Data;
00078
00079
00080 #ifdef GITKR_CAPI_C
00081 CAPI_Info *capi_initialize(int max_logical_conn, int max_Bdata_blocks, int max_Bdata_length);
00082 void capi_done(CAPI_Info *info);
00083 gint capi_listen(CAPI_Info *info, unsigned long controller, unsigned long infomask, unsigned long cipmask, unsigned long cipmask2);
00084 gboolean capi_wait_for_incoming_calls(CAPI_Info *info);
00085 CAPI_Dtmf *capi_detect_dtmf(CAPI_Info *info, unsigned char *data);
00086 gint capi_dtmf_input_text(CAPI_Info *info, unsigned char *ucbuf);
00087 gint capi_dtmf_input_arrow(CAPI_Info *info, unsigned char *ucbuf);
00088 gint capi_text_output(CAPI_Info *info, unsigned char *ucbuf, FT_Info *ftinfo);
00089 gint capi_send_message(CAPI_Info *info, FT_Alaw *alaw, int breakable);
00090
00091 CAPI_Data *capi_receive_message(CAPI_Info *info, unsigned char *data);
00092 void capi_exception(CAPI_Info *info, gint status);
00093 gboolean capi_sound_output(CAPI_Info *info, gchar *filename, FT_Info *ftinfo);
00094
00095 void capi_sound_beep(CAPI_Info *info, FT_Info *ftinfo);
00096 void capi_sound_ding(CAPI_Info *info, FT_Info *ftinfo);
00097 void capi_sound_dong(CAPI_Info *info, FT_Info *ftinfo);
00098 void capi_sound_standard(CAPI_Info *info, FT_Info *ftinfo);
00099 void capi_sound_error(CAPI_Info *info, FT_Info *ftinfo);
00100 void capi_sound_indication(CAPI_Info *info, FT_Info *ftinfo);
00101 void capi_sound_question(CAPI_Info *info, FT_Info *ftinfo);
00102 void capi_sound_notify(CAPI_Info *info, FT_Info *ftinfo);
00103 void capi_sound_critical(CAPI_Info *info, FT_Info *ftinfo);
00104
00105
00106 void capi_active_disconnect(CAPI_Info *info);
00107 gint capi_passive_disconnect(CAPI_Info *info, unsigned char *data);
00108 #else
00109 extern CAPI_Info *capi_initialize(int max_logical_conn, int max_Bdata_blocks, int max_Bdata_length);
00110 extern void capi_done(CAPI_Info *info);
00111 extern gint capi_listen(CAPI_Info *info, unsigned long controller, unsigned long infomask, unsigned long cipmask, unsigned long cipmask2);
00112 extern gboolean capi_wait_for_incoming_calls(CAPI_Info *info);
00113 extern gint capi_dtmf_input_text(CAPI_Info *info, unsigned char *ucbuf);
00114 extern gint capi_dtmf_input_arrow(CAPI_Info *info, unsigned char *ucbuf);
00115 extern gint capi_text_output(CAPI_Info *info, unsigned char *ucbuf, FT_Info *ftinfo);
00116 extern gint capi_send_message(CAPI_Info *info, FT_Alaw *alaw, int breakable);
00117
00118 extern gboolean capi_sound_output(CAPI_Info *info, gchar *filename, FT_Info *ftinfo);
00119
00120 extern void capi_sound_beep(CAPI_Info *info, FT_Info *ftinfo);
00121 extern void capi_sound_ding(CAPI_Info *info, FT_Info *ftinfo);
00122 extern void capi_sound_dong(CAPI_Info *info, FT_Info *ftinfo);
00123 extern void capi_sound_standard(CAPI_Info *info, FT_Info *ftinfo);
00124 extern void capi_sound_error(CAPI_Info *info, FT_Info *ftinfo);
00125 extern void capi_sound_indication(CAPI_Info *info, FT_Info *ftinfo);
00126 extern void capi_sound_question(CAPI_Info *info, FT_Info *ftinfo);
00127 extern void capi_sound_notify(CAPI_Info *info, FT_Info *ftinfo);
00128 extern void capi_sound_critical(CAPI_Info *info, FT_Info *ftinfo);
00129 #endif
00130
00131 #endif