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

📄 gatedefs.h

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

#ifndef _GATEDEFS_H
#define  _GATEDEFS_H            

#ifdef __cplusplus
extern "C" {
#endif 

#include <srllib.h>
#include <dxxxlib.h>
#include <dtilib.h>	
#include <dm3ntsc.h>


/* General defines */

#define  NUM_EVENTS           9     /* For Msg Detect or cancel x Events */

#define  MAX_BOARDS           10    /* Max DM3 boards */

#define  GATE_MAX_SESSIONS    120    /* maximum GATE calls to support */

#define ALL_CHANNELS    0		    /* Exit all channels */

#define MAX_PSTN_DEVICES  500       /* Max number of device the dx_open or dt_open
	                                   can return */

/* Configuration file */
#define GATE_CONFIG_FILE   "IPTgate.cfg" /* the configuration file */

/* Number of coders configuration file can recognize */
#define IPT_NUMBER_OF_CODERS    5

/* Definition for routing (gateRoute) */
#define ROUTE_ALL             0
#define ROUTE_DM3_TO_VOICE    1
#define ROUTE_VOICE_TO_DM3    2

/* Keys to IOCompletion port */
#define SRL_KEY       1
#define DM3_IPT_KEY   2
#define END_KEY       3

/* Definition connected to D/xxx */
#define DisconnectToneID	101
#define GATE_RINGS         1     /* default number of rings to detect DE_RINGS*/


/* Parsing sizing */
#define PARSE_MAX_TOKEN    10
#define PARSE_MAX_STRING   (IPT_MAX_STRING-PARSE_MAX_TOKEN)
#define PARSE_MAX_NUM      10

	
/* State definitions */
typedef enum {
  GATE_WAIT_DETECT_CMPLT,        /* Waiting for detect event complete */
  GATE_WAIT_CALL,                /* Waiting for Incomimg call or Outgoing call */
  GATE_WAIT_CONNECT,             /* Waiting for NET Connection */
  //new state definitions
  GATE_WAIT_OFFHOOK_CMPLT,
  GATE_WAIT_WELCOME_CMPLT,
  GATE_WAIT_GETUSERNAME_CMPLT,
  GATE_WAIT_PROMPTPASSWD_CMPLT,
  GATE_WAIT_GETPASSWD_CMPLT,
  GATE_WAIT_PROMPTPHONENUM_CMPLT,
  GATE_WAIT_NOTMATCH_CMPLT,
  GATE_WAIT_GETPHONENUM_CMPLT,
  //Ip inbound call
  GATE_WAIT_IPINBOUND_OFFHOOK_CMPLT,
  GATE_WAIT_IPINBOUND_DIALOUT_CMPLT,
  //end of new state definitions
  PSTN_INIT,
  GATE_WAIT_DISCONNECT,          /* Waiting for NET Disconnect or phone hang-up*/
  GATE_WAIT_IDLE,                /* Waiting for NET Idle state */
  GATE_WAIT_RELEASE,             /* Waiting for NET Null state */
  PSTN_RELEASE,
  GATE_WAIT_DONE
} gateSessionState; 


/* Offhook/Onhook */
typedef enum {
  PSTN_OFFHOOK = DL_OFFHOOK,
  PSTN_ONHOOK = DL_ONHOOK
};

#define DIGITAL_ONHOOK	100
#define DIGITAL_OFFHOOK	101

#define T1_SLOTS			24
#define VOX_CH				4

typedef enum 
{
   GATE_LEGACY_ANALOG,            /* the network front end is a D/xxx analog card */
   GATE_LEGACY_T1,           /* the network front end is a D/xxx digital card */
   GATE_LEGACY_E1,           /* the network front end is a D/xxx digital card */
   GATE_UNKNOWN                   /* the network front end is unknown */
} gateFrontEnd;					  /* enum gateFrontEnd */

/* For use as a default reference: must be set 
   according to the coder definitions in  ntscdefs.h */
#ifdef _GATEMAIN_C
   const char IPTCoderListing[IPT_NUMBER_OF_CODERS][IPT_MAX_STRING]=
   {
      "g723",
      "gsm",
      "g711mulaw",
	   "g711alaw",
	   "msgsm"
   };
#else  /* notdef _GATEMAIN_C */
   extern const char IPTCoderListing[IPT_NUMBER_OF_CODERS][IPT_MAX_STRING];
#endif /* elsedef _GATEMAIN_C */


/* Our state machine function definition */
typedef USHORT (*gateStateFxn)(LPDM3NetTSC lpNetTSC, LONG event,void * EvtData);


#ifdef __cplusplus
}
#endif /* def __cplusplus */

#endif /* ndef _GATEDEFS_H */



⌨️ 快捷键说明

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