www.pudn.com > RadiusSrv.rar > GKCommon.h, change:2003-10-27,size:2240b


#ifndef _GK_COMMON_H 
#define _GK_COMMON_H 
 
#pragma warning(disable:4786) 
 
#include <string> 
#include <list> 
using namespace std; 
 
 
typedef unsigned char uint8; 
typedef unsigned short uint16; 
typedef unsigned long uint32; 
 
typedef unsigned char uint8_t; 
typedef unsigned short uint16_t; 
typedef unsigned long uint32_t; 
 
typedef unsigned short u_short; 
typedef unsigned char u_char; 
 
typedef unsigned short socklen_t; 
//typedef unsigned long u_int; 
 
 
struct _DB_INFO { 
	string connection; 
	string user; 
	string passwd; 
}; 
 
struct _EP_INFO 
{ 
	string h323_ID;			//呼叫者帐号 
	string dialedDigits;	//呼叫者号码 
	uint16 groupID; 
	string passwd; 
}; 
 
//typedef _EP_INFO _RRQ ; 
 
struct _CDR 
{ 
	uint32 duration;		//用时 
	string startTime;		//开始时间 
	string endTime;			//结束时间 
	string callerIP;		//呼叫者IP 
	string calledIP;		//被呼叫IP 
	string dialedDigits;    //呼叫号码 
	_EP_INFO EPInfo;	 
	float bill; 
	uint8 type; 
}; 
 
struct _ACF 
{ 
	string callerIP; 
	string dialedDigits;    //呼叫号码 //for ACF request 
	_EP_INFO EPInfo; 
}; 
 
typedef _ACF _ARQ; 
 
struct _DCF 
{ 
	string callerIP; 
 	_EP_INFO EPInfo; 
}; 
 
struct _RCF 
{ 
	string callerIP; 
	_EP_INFO EPInfo; 
}; 
 
struct _UCF 
{ 
	string callerIP; 
	_EP_INFO EPInfo; 
}; 
 
struct _STATISTICS 
{ 
	uint32 TotalEPs; 
	uint32 Terminals; 
	uint8  Gateways; 
	uint16 NATed; 
	uint32 CachedEPs; 
	uint32 C_Terminals; 
	uint8  C_Gateways; 
	uint32 CurrentCalls; 
	uint32 Acitve; 
	uint32 FromNeighbor; 
	uint32 FromParent; 
	uint32 TotalCalls; 
	uint32 Successful; 
	uint32 S_FromNeighbor; 
	uint32 S_FromParent; 
	string Startup; 
	string Running; 
}; 
 
#define CONFIG_FILE		"GKCharge.cfg" 
 
typedef list<void *>	PtrList; 
typedef list<uint16>	Uint16List; 
 
 
//用户当前状态信息 
enum USER_STATE 
{ 
	USER_STATE_ERROR, 
	USER_STATE_OFFLINE, 
	USER_STATE_ONLINE, 
	USER_STATE_CALL, 
}; 
 
//呼叫类型 
enum CALL_TYPE 
{ 
	CALL_TYPE_ERROR, 
	CALL_TYPE_IN_NET, 
	CALL_TYPE_OUT_NET, 
	CALL_TYPE_internal 
}; 
 
//这个枚举和实际返回给gnugk的durationlimit数一起 
//当durationlimit少于60,为枚举参数 
//大于60为durationlimit 
enum DURATION_LIMIT 
{ 
	DURATION_LIMIT_ERROR=0, 
	DURATION_LIMIT_NO_FEE, 
	DURATION_LIMIT_UNLIMIT, 
}; 
#endif