www.pudn.com > dialogic_IVR.rar > Pansr.h


#if !defined(PANSR_H) 
#define PANSR_H 
 
#include "vocinfo.h" 
#include "dtmftone.h" 
/** 
 **   Data structure which defines the states for each fax channel 
 **/ 
typedef struct fx_info 
{ 
	int fxdev;					/* Fax Channel Device Descriptor    */ 
	int channum;				/* Correspond Voice Channel Number  */ 
	int status;					/* Fax Channel status               */ 
}FX_INFO; 
 
typedef struct ms_info 
{ 
	int msdev;					/* MSI Channel Device Descriptor    */ 
	int channum;				/* Correspond Voice Channel Number  */ 
	int status;					/* MSI Channel status               */ 
}MS_INFO; 
 
/** 
 **   Data structure which defines the states for each voc channel 
 **/ 
typedef struct dx_info { 
   LINEDEV  g_dev;					/* Line Device Identifier       */ 
   CRN      g_crn;					/* Call Reference Number        */ 
   int	    chdev;					/* Channel Device Descriptor    */ 
   int      tsdev;					/* Timeslot Device Descriptor   */ 
   int      fxdev;					/* Fax Device Descriptor        */ 
   int      msdev;					/* MSI Device Descriptor        */ 
   int      conch;					/* Connected channel            */ 
   int      ctype;					/* ChanelType(Inbound/Outbound) */ 
   int	    state;					/* Run State of Channel         */ 
   int	    msg_fd;					/* File Desc for Message Files  */ 
   char     *msg_buf;				/* Voice message buffer         */ 
   int      msg_len;				/* Voice message buffer length  */ 
   DV_DIGIT digbuf;					/* Buffer for DTMF Digits       */ 
   DX_IOTT  iott[ 45 ];				/* I/O Transfer Table		    */ 
   DV_TPT	tpt[ 4 ];               /* Termination parameter table  */ 
   DX_CAP   capp;                   /* Needed for call analysis.    */ 
   char     msg_path[ MAXPATH+1 ];  /* Message File path            */ 
   char		msg_name[ MAXMSG+1 ];	/* Message Filename             */ 
   char		ac_code[ MAXDTMF+1 ];	/* Access Code for this Channel */ 
   int		ac_count;				/* Voicelist count              */ 
   int      ac_mask;				/* Getdigit mask condition      */ 
   int      ac_time;				/* Getdigit time condition      */ 
   VOCINFO  *ac_voice;				/* Voicelist point              */ 
   char     *ac_infotone;			/* Info tone point              */ 
   int      ac_point;	            /* Current position             */ 
   char     anis_buf[GC_ADDRSIZE];	/* Automa Number Identification */ 
   char     dnis_buf[GC_ADDRSIZE];	/* Dialed Number Identification */ 
   char     outc_buf[GC_ADDRSIZE];	/* Outcomming Caller            */ 
   int      service;                /* Channel service command      */ 
   int		reqid;					/* Channel request ID           */ 
   BOOL     bIsIVR;					/* whether it is IVR command	*/ 
   BOOL     bCanStop;				/* whether it can be stoped     */ 
   BOOL     bIsClear;				/* Whether clear digbuf or not  */ 
   BOOL		bIsInfotone;			/* whether it is Infotone       */ 
   char     language;				/* what language is used        */ 
   char     protocol[12];			/* what protocal is used        */ 
   int      nokeypressed;			/* nokey pressed count          */ 
   long     warnTime;				/* warning time                 */ 
   long     stopTime;				/* stop time                    */ 
   long     warnType;				/* warn type                    */ 
} DX_INFO; 
 
 
FX_INFO     fxinfo[ FAXCHANS+1 ]; 
MS_INFO     msinfo[ MSICHANS+1 ]; 
DX_INFO		dxinfo[ MAXCHANS+1 ]; 
CObList		dxlist[ MAXCHANS+1 ]; 
 
TN_GEN  tngen[16];			/* DTMF tone generation array         */ 
 
int frontend = CT_NTANALOG;	/* Default network frontend is ANALOG */ 
 
int maxchans = 30;			/* Default Number of D/4x Channels to use */ 
int faxchans = 0;           /* Default Number of FAX Channels to use  */   
int msichans = 0;           /* Default Number of MSI Channels to use  */ 
int d4xbdnum = 1;			/* Default D/4x Board Number to Start use */ 
int dtibdnum = 1;			/* Default DTI Board Number to Start use  */ 
int faxbdnum = 0;			/* Default FAX Board Number to Start use  */ 
int msibdnum = 0;			/* Default MSI Board Number to Start use  */ 
int scbus    = TRUE;		/* Default Bus mode is SCbus              */ 
int routeag  = FALSE;		/* Route analog frontend to resource ???  */ 
int boardtag = FALSE;		/* Default type is CCM                    */ 
int gammfax  = 0; 
 
//Add at 2001/11/13 by xyw 
long warntype = 0; 
long warnspan = 0; 
long stopspan = 0; 
//add end 
 
char tmpbuff[ 256 ];		/* Temporary Buffer */ 
 
char SVocDir[128]; 
char GVocDir[128]; 
char SFaxDir[128]; 
char VScript[128]; 
 
int      CombCount[3]; 
IDXINFO  * pCombIdx[3]; 
char     * pCombBuf[3]; 
char     * pSilenceBuf; 
 
HANDLE ghDLGCEvent; // controls stopping of Dialogic stuff 
HWND   hWnd; // handle of our dialog 
 
char *BuildName( int channum, char *path, char *name ); 
int  PlayFile(int channum, char * voicefile, int maxdigs=1, BOOL isclear=TRUE); 
int  PlayComb(int channum, char * comstring, int maxdigs=1, BOOL isclear=TRUE); 
 
int  set_hkstate(int channum, int state); 
 
int  get_digits( int channum, DV_DIGIT *digbufp , int maxdigs=1, int maskdig=0, int seconds= 30); 
 
void ShowAccesscode(int channum,int secrecy=0); 
 
#endif