⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 ipt网关源码
💻 H
字号:
/**********************************************************************************************
* 
* $ProjectName: X:\SIPROJ\VOIP\HOST\WIN_NT\DEMOS\VOIPGATE\PROJECT.PJ $
* $ProjectRevision: 1.1 $
* $Label$
* $Revision: 1.4 $ - $Date: 1997/07/14 14:54:05 $
* 
**********************************************************************************************/

#ifndef _MAIN_H
#define  _MAIN_H              

#ifdef __cplusplus
extern "C" {
#endif /* def __cplusplus */

#ifdef EXTERN
#undef EXTERN
#endif

/* Dialogic header files  */
#include <srllib.h>
#include <dxxxlib.h>
#include <dm3tsc.h>

#ifdef __cplusplus
extern "C" {
#endif /* def __cplusplus */



/*****FUNCTION***************************************************
*        NAME : getChannel
* DESCRIPTION : Gets the active channel to send message to
*       INPUT : None  
*      OUTPUT : None
*     RETURNS : int - Channel number
*    CAUTIONS : None
****************************************************************/
int getChannel();


/*****FUNCTION***************************************************
*        NAME : waitForKey
* DESCRIPTION : Thread waiting for key: q , ctrl+c to end application
*                                       u - to send user input indication
*                                       n - to send non standard command
*                                       c - get channel information
*                                       f - send Q931 Facility information
*       INPUT : None
*      OUTPUT : None
*     RETURNS : DWORD '0' - success
*    CAUTIONS : getch() func disable detection of 
*               interrupts from the keyboard
****************************************************************/
DWORD waitForKey();


/*****FUNCTION***************************************************
*        NAME : printChanInfo
* DESCRIPTION : Prints channel information
*       INPUT : void
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void printChanInfo();


/*****FUNCTION***************************************************
*        NAME : banner
* DESCRIPTION : Prints program banner
*       INPUT : void
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void banner(void);


/*****FUNCTION***************************************************
*        NAME : usage
* DESCRIPTION : Command line option ? for help
*       INPUT : None
*      OUTPUT : Prints help text
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void usage();


/*****FUNCTION***************************************************
*        NAME : checkArg
* DESCRIPTION : Checks arguments from command line
*       INPUT : int argc
*               char *argv[]
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void checkArg(int argc, char *argv[]);


/*****FUNCTION***************************************************
*        NAME : attachSRLToIOCP
* DESCRIPTION : Attaches SRL to  IOCP
*       INPUT : Needed for SRL to IOCP 
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
BOOL attachSRLToIOCP(HANDLE hPort, 
                     LPSRLWIN32INFO pSrlWin32Info,
                     LPOVERLAPPED pOverlapped);


/*****FUNCTION***************************************************
*        NAME : completionPorts
* DESCRIPTION : Create completion port 
*               and attach srl key to it.
*       INPUT : None
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void completionPorts();


/*****FUNCTION***************************************************
*        NAME : IPTGetNumBoards
* DESCRIPTION : Gets the number of DM3 boards in the system
*       INPUT : ULONG * NumOfBoards - Number of DM3 boards
*      OUTPUT : ULONG * NumOfBoards - Number of DM3 boards
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
BOOL IPTGetNumBoards(ULONG * NumOfBoards);


///////////////////////////////////////////////////////////////////////
//        NAME : IPTEnableAllEvts()
// DESCRIPTION : Enable the reporting of multiple events for 
//               NetTsc component instance
//       INPUT : LPDM3TSC lpTsc - pointer to TSC structure 
//      OUTPUT : None.
//     RETURNS : success or fail
//    CAUTIONS : None.
///////////////////////////////////////////////////////////////////////
BOOL IPTEnableAllEvts(LPDM3TSC lpTsc);


///////////////////////////////////////////////////////////////////////
//        NAME : IPTDisableAllEvts()
// DESCRIPTION : Disable the reporting of multiple events for 
//               NetTsc component instance
//       INPUT : LPDM3TSC lpTsc - pointer to TSC structure 
//      OUTPUT : None.
//     RETURNS : success or fail
//    CAUTIONS : None.
///////////////////////////////////////////////////////////////////////
BOOL IPTDisableAllEvts(LPDM3TSC lpTsc);


/*****FUNCTION***************************************************
*        NAME : IPTResetSession
* DESCRIPTION : Resets session structure to default values
*       INPUT : int ch     -   Channel to reset
*               BOOL clear -   Boolean to know if reset totally
*                              TRUE - clear totaly
*                              FALSE - clear the related fields of this call
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void IPTResetSession(int ch, BOOL clear);


/*****FUNCTION***************************************************
*        NAME : ClusterInit
* DESCRIPTION : Make all cluster initialization
*       INPUT : USHORT  *pNumTSC   Number of IPT channels
                USHORT VOXChannels  PSTN available channels
*      OUTPUT : USHORT  *pNumTSC   Number of IPT channels
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
USHORT ClusterInit(USHORT *pNumNetTSC,
                   USHORT VOXChannels);


/*****FUNCTION***************************************************
*        NAME : NetTSCCompInit
* DESCRIPTION : Initialize IPT component, Set async parameters
*				    and enable list of events.
*       INPUT : None
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
USHORT NetTSCCompInit();


/*****FUNCTION***************************************************
*        NAME : IPTCloseNetTSC
* DESCRIPTION : Closes NetTSC instances
*       INPUT : USHORT rc
*				USHORT channels
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
BOOL IPTCloseNetTSC(USHORT rc,
                    USHORT channel);


/*****FUNCTION***************************************************
*        NAME : gateRoute
* DESCRIPTION : Routes DM3 to D/xx and D/xx to DM3
*       INPUT : USHORT channel   -  Channel to route 
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
BOOL gateRoute(USHORT channel);


/*****FUNCTION***************************************************
*        NAME : gateUnRoute
* DESCRIPTION : Make DM3 Unlisten to D/xx (Deactivate and Unassign), 
*               D/xx Unlisten to DM3.
*       INPUT : USHORT channel
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void gateUnRoute(USHORT channel);


/*****FUNCTION***************************************************
*        NAME : closeDM3Channel
* DESCRIPTION : Closes an active channel
*               Disable events and free allocated cluster
*       INPUT : USHORT rc 
*				    USHORT channel
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
BOOL closeDM3Channel(USHORT rc,USHORT channel);


/*****FUNCTION***************************************************
*        NAME : allChannelsNotActive
* DESCRIPTION : Checks if all available channels in the system are 
*               not active
*       INPUT : None
*      OUTPUT : None
*     RETURNS : DM3SUCCESS - all channels not active,
*               DM3FAIL - at least one channel is active
*    CAUTIONS : None
****************************************************************/
BOOL allChannelsNotActive();


/*****FUNCTION***************************************************
*        NAME : gateExit
* DESCRIPTION : Exit one or more channels
*       INPUT : USHORT rc        -     Exit code
*               USHORT channel   -     hannel number or ALL_CHANNELS
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void gateExit(USHORT rc, USHORT channel);
  

/*****FUNCTION***************************************************
*        NAME : getGateChannels
* DESCRIPTION : Gets the gateChannels number to be the minimum
*               of PSTN channels and available IPT clusters
*       INPUT : None
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void getGateChannels();


/*****FUNCTION***************************************************
*        NAME : enableKBInput
* DESCRIPTION : Create thread - waitForKey,
*               enable detection of CTRL_CLOSE_EVENT
*       INPUT : None
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void enableKBInput();


/*****FUNCTION***************************************************
*        NAME : printConfiguration
* DESCRIPTION : Print information from confoguration file
*       INPUT : None
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void printConfiguration();


/*****FUNCTION***************************************************
*        NAME : gateInit
* DESCRIPTION : Initializes the Camel Gateway demo:
*               gets argument from command line,
*               opens NetTSC instances,
*               gets information from configuration file,
*               opens VOX channels.
*       INPUT : int argc 
*               char *argv[]
*      OUTPUT : None
*     RETURNS : void
*    CAUTIONS : None
****************************************************************/
void gateInit(int argc, 
			     char *argv[]);


/*****FUNCTION***************************************************
*        NAME : X_routine
* DESCRIPTION : Routine to handle CTRL_CLOSE_EVENT (closing window)
*       INPUT : DWORD crtlType   -  Event type
*      OUTPUT : None
*     RETURNS : TRUE - success, FALSE - fail
*    CAUTIONS : None
****************************************************************/
BOOL X_routine(DWORD crtlType);
   

/*****FUNCTION***************************************************
*        NAME : gateGetEvent
* DESCRIPTION : Gets Next Event from IO completion port
*       INPUT : DWORD timeout    -  Timeout to wait for event
*      OUTPUT : None
*     RETURNS : Success or fail
*    CAUTIONS : None
****************************************************************/
USHORT gateGetEvent(DWORD timeout);



#ifdef __cplusplus                /* close C++ brackets */
}   
#endif /* def __cplusplus */

#endif /* ndef _GATEMAIN_H */
/*** End of File ***/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -