📄 t38fax.h
字号:
/*-----------------------------
* t38Fax.h - T.38 FAX相关功能头文件
*
* Description:
*
* Author: ZhengQishan
*
* Modified history
*------------------------------
* 2006-3-15 16:13 ZhengaQishan Created.
*
**/
#ifndef _INCLUDE_T38_FAX_H
#define _INCLUDE_T38_FAX_H
#include "vxWorks.h"
#include "ctype.h"
#include "sysLib.h"
#include "bootLib.h"
#include "stdio.h"
#include "fioLib.h"
#include "private/vmLibP.h"
#include "taskLib.h"
#include "garlib.h"
#include "inetLib.h"
#include "ioLib.h"
#include "logLib.h"
#include "string.h"
#include "m803xx.h"
#include "driver/drvlib/include/drv_comm.h"
#include "typedef.h"
#include "voip\VoIPService\voipoam\include\voip_class.h" /*added by fengya,for fax debug*/
#if INSTALL_LFXS_DRIVER
/*网关检测到与直连的G3 FAX机的信号*/
#define T38_FAX_DEMODULATION 0x06
/*网关再次调制通过IP网传过来的G3 FAX机的信号*/
#define T38_FAX_REMODULATION 0x07
#define T38_FAX_V21_DE 0x06 /* V.21 Ch 2 demodulation */
#define T38_FAX_V21_RE 0x07 /* V.21 Ch 2 remodulation */
#define T38_FAX_SPEED_2400_DE 0x08 /* V.27 ter 2400 demodulation */
#define T38_FAX_SPEED_2400_RE 0x09 /* V.27 ter 2400 remodulation */
#define T38_FAX_SPEED_4800_DE 0x0A /* V.27 ter 4800 demodulation */
#define T38_FAX_SPEED_4800_RE 0x0B /* V.27 ter 4800 remodulation */
#define T38_FAX_SPEED_7200_DE 0x0C /* V.29 7200 demodulation */
#define T38_FAX_SPEED_7200_RE 0x0D /* V.29 7200 remodulation */
#define T38_FAX_SPEED_9600_DE 0x0E /* V.29 9600 demodulation */
#define T38_FAX_SPEED_9600_RE 0x0F /* V.29 9600 remodulation */
#define T38_FAX_SPEED_7200_S_DE 0x10 /* V.17 7200 short train demodulation */
#define T38_FAX_SPEED_7200_S_RE 0x11 /* V.17 7200 short train remodulation */
#define T38_FAX_SPEED_7200_L_DE 0x12 /* V.17 7200 long train demodulation (V.33) */
#define T38_FAX_SPEED_7200_L_RE 0x13 /* V.17 7200 long train remodulation (V.33) */
#define T38_FAX_SPEED_9600_S_DE 0x14 /* V.17 9600 short train demodulation */
#define T38_FAX_SPEED_9600_S_RE 0x15 /* V.17 9600 short train remodulation */
#define T38_FAX_SPEED_9600_L_DE 0x16 /* V.17 9600 long train demodulation (V.33) */
#define T38_FAX_SPEED_9600_L_RE 0x17 /* V.17 9600 long train demodulation (V.33) */
#define T38_FAX_SPEED_12000_S_DE 0x18 /* V.17 12000 short train demodulation */
#define T38_FAX_SPEED_12000_S_RE 0x19 /* V.17 12000 short train remodulation */
#define T38_FAX_SPEED_12000_L_DE 0x1A /* V.17 12000 long train demodulation (V.33) */
#define T38_FAX_SPEED_12000_L_RE 0x1B /* V.17 12000 long train remodulation (V.33) */
#define T38_FAX_SPEED_14400_S_DE 0x1C /* V.17 14400 short train demodulation */
#define T38_FAX_SPEED_14400_S_RE 0x1D /* V.17 14400 short train remodulation */
#define T38_FAX_SPEED_14400_L_DE 0x1E /* V.17 14400 long train demodulation (V.33) */
#define T38_FAX_SPEED_14400_L_RE 0x1F /* V.17 14400 long train remodulation (V.33) */
#define T38_FAX_STATE_CFR0 0x21 /* Confirmation to receive x010 0001 */
#define T38_FAX_STATE_CFR1 0xa1
#define T38_FAX_STATE_CIG 0x82 /* Calling subscriber identification 1000 0010 */
#define T38_FAX_STATE_CRP0 0x58 /* Command repeat x101 1000 */
#define T38_FAX_STATE_CRP1 0xd8
#define T38_FAX_STATE_CSI 0x02 /* Called subscriber identification 0000 0010 */
#define T38_FAX_STATE_CTC0 0x48 /* Continue to correct x100 1000 */
#define T38_FAX_STATE_CTC1 0xc8
#define T38_FAX_STATE_CTR0 0x23 /* Response for continue to correct x010 0011 */
#define T38_FAX_STATE_CTR1 0xa3
#define T38_FAX_STATE_DCN0 0x5f /* Disconnect x101 1111 */
#define T38_FAX_STATE_DCN1 0xdf
#define T38_FAX_STATE_DCS0 0x41 /* Digital command signal X100 0001 */
#define T38_FAX_STATE_DCS1 0xc1
#define T38_FAX_STATE_DIS 0x01 /* Digital identification signal 0000 0001 */
#define T38_FAX_STATE_DTC 0x81 /* Digital transmit command 1000 0001 */
#define T38_FAX_STATE_EOM0 0x71 /* End of message x111 0001 */
#define T38_FAX_STATE_EOM1 0xf1
#define T38_FAX_STATE_EOP0 0x74 /* End of procedure x111 0100 */
#define T38_FAX_STATE_EOP1 0xf4
#define T38_FAX_STATE_EOR0 0x73 /* End of retransmission x111 0011 */
#define T38_FAX_STATE_EOR1 0xf3
#define T38_FAX_STATE_ERR0 0x38 /* Response for end of retransmission x011 1000 */
#define T38_FAX_STATE_ERR1 0xb8
#define T38_FAX_STATE_FCD 0x60 /* Facsimile coded data 0110 0000 */
#define T38_FAX_STATE_FDM0 0x3f /* File diagnostic message x011 1111 */
#define T38_FAX_STATE_FDM1 0xbf
#define T38_FAX_STATE_FTT0 0x22 /* Failure to train x010 0010 */
#define T38_FAX_STATE_FTT1 0xa2
#define T38_FAX_STATE_MCF0 0x31 /* Message confirmation x011 0001 */
#define T38_FAX_STATE_MCF1 0xb1
#define T38_FAX_STATE_MPS0 0x72 /* Multipage signal x111 0010 */
#define T38_FAX_STATE_MPS1 0xf2
#define T38_FAX_STATE_NSC 0x84 /* Non-standard facilities command 1000 0100 */
#define T38_FAX_STATE_NSF 0x04 /* Non-standard facilities 0000 0100 */
#define T38_FAX_STATE_NSS0 0x44 /* Non-standard set up x100 0100 */
#define T38_FAX_STATE_NSS1 0xc4
#define T38_FAX_STATE_PID0 0x36 /* Procedure interrupt disconnect x011 0110 */
#define T38_FAX_STATE_PID1 0xb6
#define T38_FAX_STATE_PIN0 0x34 /* Procedure interrupt negative x011 0100 */
#define T38_FAX_STATE_PIN1 0xb4
#define T38_FAX_STATE_PIP0 0x35 /* Procedure interrupt positive x011 0101 */
#define T38_FAX_STATE_PIP1 0xb5
#define T38_FAX_STATE_PPS0 0x7d /* Partial page signal x111 1101 */
#define T38_FAX_STATE_PPS1 0xfd
#define T38_FAX_STATE_PPR0 0x3d /* Partial page request x011 1101 */
#define T38_FAX_STATE_PPR1 0xbd
#define T38_FAX_STATE_PRI_EOM0 0x79 /* Procedure interrupt-EOM x111 1001 */
#define T38_FAX_STATE_PRI_EOM1 0xf9
#define T38_FAX_STATE_PRI_EOP0 0x7c /* Procedure interrupt-EOP x111 1100 */
#define T38_FAX_STATE_PRI_EOP1 0xfc
#define T38_FAX_STATE_PRI_MPS0 0x7a /* Procedure interrupt-MPS x111 1010 */
#define T38_FAX_STATE_PRI_MPS1 0xfa
#define T38_FAX_STATE_PWD 0x83 /* Password (for polling) 1000 0011 */
#define T38_FAX_STATE_PaWD0 0x45 /* Password (for transmission) x100 0101 */
#define T38_FAX_STATE_PaWD1 0xc5
#define T38_FAX_STATE_RCP 0x61 /* Return to control for partial page 0110 0001 */
#define T38_FAX_STATE_RNR0 0x37 /* Receive not ready x011 0111 */
#define T38_FAX_STATE_RNR1 0xb7
#define T38_FAX_STATE_RR0 0x76 /* Receive ready x111 0110 */
#define T38_FAX_STATE_RR1 0xf6
#define T38_FAX_STATE_RTN0 0x32 /* Retrain negative x011 0010 */
#define T38_FAX_STATE_RTN1 0xb2
#define T38_FAX_STATE_RTP0 0x33 /* Retrain positive x011 0011 */
#define T38_FAX_STATE_RTP1 0xb3
#define T38_FAX_STATE_SEP 0x85 /* Selective polling 1000 0101 */
#define T38_FAX_STATE_SUB0 0x43 /* Subaddress x100 0011 */
#define T38_FAX_STATE_SUB1 0xc3
#define T38_FAX_STATE_TSI0 0x42 /* Transmitting subscriber identification x100 0010 */
#define T38_FAX_STATE_TSI1 0xc2
typedef enum
{
SWITCH_TO_T38_FAX = 0,
SWITCH_TO_VOICE = 1
}TYPE_OF_SWITCH;
typedef enum
{
VOICE_CHAN = 0,
T38_FAX_CHAN
}TYPE_OF_CHANNEL;
typedef struct tagT38FaxStatistic
{
UINT32 formatVer;
UINT16 reserved;
UINT32 callTimer; /*seconds*/
UINT32 currPlayOutDelay;
UINT32 minPlayOutDelay;
UINT32 maxPlayOutDelay;
UINT32 bufOverFlow;
UINT32 bufUnderFlow;
UINT32 reserved1;
UINT32 TxPkt;
UINT32 TxDuration; /*发送持续时间*/
UINT32 RxPkt;
UINT32 RxDuration; /*收包持续时间*/
UINT32 TxPage;
UINT32 RxPage;
UINT32 pktOutOfSequence;
UINT32 badProtocolHeader;
UINT16 dataPumpMode;
UINT16 rxLevel;
UINT16 phaseJitter;
UINT16 freqOffset;
UINT16 eyeQualityMonitor;
UINT32 pktLossConceament; /*隐藏处的数据丢包个数*/
UINT32 TxBytes;
UINT32 RxBytes;
UINT16 hsModulation;
}T38_FAX_STATISTIC;
extern int M80320_OpenChanMsgFlag ;
extern int drv_DebugPortNo ;
extern SEM_ID M803xxQueueSem[];
extern M80320_QUEUE m_OpenChannelMailboxQueue[];
extern M80320_QUEUE m_TxDataQueue[];
extern M80320_QUEUE m_txmbox[];
extern M803xx_PORT_STATE m_port[];
extern BOOL PinStatus[];
extern M803xx_PORT CON_TO_DP[];
extern UINT8 SendFlag[];
extern int M80320_Printf;
extern UINT8 M80320_Debug[];
extern UINT32 OpenChanMsgFull[];
extern UINT16 RemainedTxCmdNum[];
extern PortStatusParameter Parameter[];
extern UINT8 M803xx_Stop_PciReq[];
extern void * PciReadBuf[];
extern UINT32 BUFNULL;
extern unsigned long RecordRTPTimeStamp[];
extern PortStatusParameter * gpT38FaxParameter[];
extern void SendMBoxMessage(UINT8 PinNo,int flag,UINT8 PP);
extern void showFaxSttInfo(int slotNo, void *pBuf);
extern void faxRelayStateChangeProcess(UINT8 PortNo, UINT16* ptr, UINT8 len);
extern int changeChanType(UINT8 portNo, TYPE_OF_SWITCH type);
extern int setT38FaxOperation(UINT8 portNo);
extern void constructIpUdpHeader(UINT8 portNo, int type);
extern void receiveT38FaxPkt(M803xx_PORT_STATE *PortPtr, UINT8 PortNo, UINT16 Len, UINT32 Addr, UINT8 Eof);
extern STATUS initT38FaxArgVar(int slot);
extern int sendSuperMsg(UINT16 msg, UINT16 p0, UINT16 p1, UINT16 p2, UINT8 PortNo);
#endif /*#if INSTALL_LFXS_DRIVER*/
#endif /*_INCLUDE_T38_FAX_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -