📄 divacapi.h
字号:
/* * Copyright (c) Eicon Networks, 2002. * This source file is supplied for the use with Eicon Networks range of DIVA Server Adapters. * Eicon File Revision : 2.1 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *//*#define DEBUG */ #define IMPLEMENT_DTMF 1#define IMPLEMENT_LINE_INTERCONNECT2 1#define IMPLEMENT_ECHO_CANCELLER 1#define IMPLEMENT_RTP 1#define IMPLEMENT_T38 1#define IMPLEMENT_FAX_SUB_SEP_PWD 1#define IMPLEMENT_V18 1#define IMPLEMENT_DTMF_TONE 1#define IMPLEMENT_PIAFS 1#define IMPLEMENT_FAX_PAPER_FORMATS 1#define IMPLEMENT_VOWN 1#define IMPLEMENT_CAPIDTMF 1#define IMPLEMENT_FAX_NONSTANDARD 1#define VSWITCH_SUPPORT 1#define IMPLEMENT_LINE_INTERCONNECT 0#define IMPLEMENT_MARKED_OK_AFTER_FC 1#include "capidtmf.h"/*------------------------------------------------------------------*//* Common API internal definitions *//*------------------------------------------------------------------*/#define MAX_APPL 240#define MAX_NCCI 127#define MSG_IN_QUEUE_SIZE ((4096 + 3) & 0xfffc) /* must be multiple of 4 */#define MSG_IN_OVERHEAD sizeof(APPL *)#define MAX_NL_CHANNEL 255#define MAX_DATA_B3 8#define MAX_DATA_ACK MAX_DATA_B3#define MAX_MULTI_IE 6#define MAX_MSG_SIZE 256#define MAX_MSG_PARMS 10#define MAX_CPN_MASK_SIZE 16#define MAX_MSN_CONFIG 10#define EXT_CONTROLLER 0x80#define CODEC 0x01#define CODEC_PERMANENT 0x02#define ADV_VOICE 0x03#define MAX_CIP_TYPES 5 /* kind of CIP types for group optimization */#define C_IND_MASK_DWORDS ((MAX_APPL+32) >> 5)#define FAX_CONNECT_INFO_BUFFER_SIZE 256#define NCPI_BUFFER_SIZE 256#define MAX_CHANNELS_PER_PLCI 8#define MAX_INTERNAL_COMMAND_LEVELS 4#define INTERNAL_REQ_BUFFER_SIZE 272#define INTERNAL_IND_BUFFER_SIZE 768#define DTMF_PARAMETER_BUFFER_SIZE 12#define ADV_VOICE_COEF_BUFFER_SIZE 50#define LI_PLCI_B_QUEUE_ENTRIES 256typedef struct _APPL APPL;typedef struct _PLCI PLCI;typedef struct _NCCI NCCI;typedef struct _DIVA_CAPI_ADAPTER DIVA_CAPI_ADAPTER;typedef struct _DATA_B3_DESC DATA_B3_DESC;typedef struct _DATA_ACK_DESC DATA_ACK_DESC;typedef struct manufacturer_profile_s MANUFACTURER_PROFILE;typedef struct fax_ncpi_s FAX_NCPI;typedef struct api_parse_s API_PARSE;typedef struct api_save_s API_SAVE;typedef struct msn_config_s MSN_CONFIG;typedef struct msn_config_max_s MSN_CONFIG_MAX;typedef struct msn_ld_s MSN_LD;struct manufacturer_profile_s { dword private_options; dword rtp_primary_payloads; dword rtp_additional_payloads;};struct fax_ncpi_s { word options; word format;};struct msn_config_s { byte msn[MAX_CPN_MASK_SIZE];};struct msn_config_max_s { MSN_CONFIG msn_conf[MAX_MSN_CONFIG];};struct msn_ld_s { dword low; dword high;};struct api_parse_s { word length; byte * info;};struct api_save_s { API_PARSE parms[MAX_MSG_PARMS+1]; byte info[MAX_MSG_SIZE];};struct _DATA_B3_DESC { word Handle; word Number; word Flags; word Length; void * P;};struct _DATA_ACK_DESC { word Handle; word Number;};typedef void (* t_std_internal_command)(dword Id, PLCI *plci, byte Rc);/************************************************************************//* Don't forget to adapt dos.asm after changing the _APPL structure!!!! */struct _APPL { word Id; word NullCREnable; word CDEnable; dword S_Handle; LIST_ENTRY s_function; dword s_context; word s_count; APPL * s_next; byte * xbuffer_used; void ** xbuffer_internal; void ** xbuffer_ptr; byte * queue; word queue_size; word queue_free; word queue_read; word queue_write; word queue_signal; byte msg_lost; byte appl_flags; word Number; word MaxBuffer; byte MaxNCCI; byte MaxNCCIData; word MaxDataLength; word NCCIDataFlowCtrlTimer; byte * ReceiveBuffer; word * DataNCCI; word * DataFlags;};struct _PLCI { ENTITY Sig; ENTITY NL; word RNum; word RFlags; BUFFERS RData[2]; BUFFERS XData[1]; BUFFERS NData[2]; DIVA_CAPI_ADAPTER *adapter; APPL *appl; PLCI *relatedPTYPLCI; byte Id; byte State; byte sig_req; byte nl_req; byte SuppState; byte channels; byte tel; byte B1_resource; byte B2_prot; byte B3_prot; word command; word m_command; word internal_command; word number; word req_in_start; word req_in; word req_out; word msg_in_write_pos; word msg_in_read_pos; word msg_in_wrap_pos; void * data_sent_ptr; byte data_sent; byte send_disc; byte sig_global_req; byte sig_remove_id; byte nl_global_req; byte nl_remove_id; byte b_channel; byte adv_nl; byte manufacturer; byte call_dir; byte hook_state; byte spoofed_msg; byte ptyState; byte cr_enquiry; word hangup_flow_ctrl_timer; word ncci_ring_list; byte inc_dis_ncci_table[MAX_CHANNELS_PER_PLCI]; t_std_internal_command internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS]; dword c_ind_mask_table[C_IND_MASK_DWORDS]; dword group_optimization_mask_table[C_IND_MASK_DWORDS]; byte RBuffer[200]; dword msg_in_queue[MSG_IN_QUEUE_SIZE/sizeof(dword)]; API_SAVE saved_msg; API_SAVE B_protocol; byte fax_connect_info_length; byte fax_connect_info_buffer[FAX_CONNECT_INFO_BUFFER_SIZE]; byte fax_edata_ack_length; word nsf_control_bits; byte ncpi_state; byte ncpi_buffer[NCPI_BUFFER_SIZE]; byte internal_req_buffer[INTERNAL_REQ_BUFFER_SIZE]; byte internal_ind_buffer[INTERNAL_IND_BUFFER_SIZE + 3]; dword requested_options_conn; dword requested_options; word B1_facilities; API_SAVE *adjust_b_parms_msg; word adjust_b_facilities; word adjust_b_command; word adjust_b_ncci; word adjust_b_mode; word adjust_b_state; byte adjust_b_restore; byte dtmf_rec_active; word dtmf_rec_pulse_ms; word dtmf_rec_pause_ms; byte dtmf_send_requests; word dtmf_send_pulse_ms; word dtmf_send_pause_ms; word dtmf_cmd; word dtmf_msg_number_queue[8]; byte dtmf_parameter_length; byte dtmf_parameter_buffer[DTMF_PARAMETER_BUFFER_SIZE]; t_capidtmf_state capidtmf_state; byte li_bchannel_id; /* BRI: 1..2, PRI: 1..32 */ byte li_channel_bits; byte li_notify_update; word li_cmd; word li_write_command; word li_write_channel; word li_plci_b_write_pos; word li_plci_b_read_pos; word li_plci_b_req_pos; dword li_plci_b_queue[LI_PLCI_B_QUEUE_ENTRIES]; word ec_cmd; word ec_idi_options; word ec_tail_length; byte tone_last_indication_code; byte vswitchstate; byte vsprot; byte vsprotdialect; byte notifiedcall; /* Flag if it is a spoofed call */ int rx_dma_descriptor; dword rx_dma_magic;};struct _NCCI { byte data_out; byte data_pending; byte data_ack_out;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -