//public constant define
#ifndef	_SMPP_CONST_h
#define	_SMPP_CONST_h


#define MAX_SMPP_LINK			32
#define	SMPP_LINK_QUEUE_NUM		32	//queue number per link
#define	MAX_PACKET_SIZE			1500
#define	MAX_MSG_SIZE			1300
#define	SMPP_MSG_LEN			512
#define	MAX_ASCOUT_BUF_LEN		4096
#define	MAX_ASCIN_BUF_LEN		1024
#define	SMPP_MAX_MULTI_ADDRESS	5
#define	CMD_BUF_SIZE			8
#define SMPP_PORT				2775
#define SMPP_MODULE_VERSION		"V1.0.01"//merge R9v0_02 p4 ot R90v0_12 p4
#define SMPP_MODULE_PATCH		2
#define	TITLE_CHAR				2048	
#define	SMPP_PPS_SSN			19
#define SMPP_SMSC_SSN			20
#define	SMPP_PPS_USERTYPE		1
#define SMPP_SMSC_USERTYPE		2
#define	SMPP_CONF_FILE			"./conf/smpp.conf"
#define	SMPP_CONF_FILE_w		"./conf/smpp_w.conf"
#define	SMPP_UDP				0
#define	SMPP_TCP				1
#define SMPP_OID				{1,3,6,1,4,1,1373,1,3,2,3,4}
#define SMPP_OIDLEN				12
#define	MAX_SME					1
#define	SMPP_VERSION			0x34
#define SMPP_OPT_PARAM_NUM		64

#define	SMPP_SYSID_LEN			16
#define	SMPP_PASSWD_LEN			9
#define	SMPP_SYSTYPE_LEN		13
#define	SMPP_GTT_LEN			16

/* time interval */
#define	SESSION_INIT_INTERVAL	(50*5)				/* 5s */

/* debug id */
#define	SMPP_DEBUG_ID				15
#define	SMPP_HEARTBEAT_COMPONENT_ID	9

// define if print screen and debug needed.
//#define	SMPP_PRINT_SCREEN		TRUE
#define	SMPP_DEBUG				true

/* Define server mode */
#define	SMPP_CLIENT		0
#define	SMPP_SERVER		1

/* Define session type */
#define	BIND_TX			0
#define	BIND_RX			1
#define	BIND_TRX		2

/* Define message mode */
#define	STORE_AND_FORWARD	0
#define	DATAGRAM			1
#define	TRANSACTION			2

//command ID define
#define GENERIC_NAK				0x80000000
#define BIND_RECEIVER			0x00000001
#define BIND_RECEIVER_RESP		0x80000001
#define BIND_TRANSMITTER		0x00000002
#define BIND_TRANSMITTER_RESP	0x80000002
#define QUERY_SM				0x00000003
#define QUERY_SM_RESP			0x80000003
#define SUBMIT_SM				0x00000004
#define SUBMIT_SM_RESP			0x80000004
#define DELIVER_SM				0x00000005
#define DELIVER_SM_RESP			0x80000005
#define UNBIND					0x00000006
#define UNBIND_RESP				0x80000006
#define REPLACE_SM				0x00000007
#define REPLACE_SM_RESP			0x80000007
#define CANCEL_SM				0x00000008
#define CANCEL_SM_RESP			0x80000008
#define	BIND_TRANSCEIVER		0x00000009
#define	BIND_TRANSCEIVER_RESP	0x80000009
#define	OUTBIND					0x0000000B
#define	ENQUIRE_LINK			0x00000015
#define	ENQUIRE_LINK_RESP		0x80000015
#define SUBMIT_MULTI			0x00000021
#define	SUBMIT_MULTI_RESP		0x80000021
#define	ALERT_NOTIFICATION		0x00000102
#define	DATA_SM					0x00000103
#define	DATA_SM_RESP			0x80000103

/* Optional parameter tag definitions */
#define	DEST_ADDR_SUBUNIT		0x0005
#define	DEST_NETWORK_TYPE		0x0006
#define	DEST_BEARER_TYPE		0x0007
#define	DEST_TELEMATICS_ID		0x0008
#define	SOURCE_ADDR_SUBUNIT		0x000D
#define	SOURCE_NETWORK_TYPE		0x000E
#define	SOURCE_BEARER_TYPE		0x000F
#define	SOURCE_TELEMATICS_ID	0x0010
#define	QOS_TIME_TO_LIVE		0x0017
#define	PAYLOAD_TYPE			0x0019
#define	ADDITIONAL_STATUS_INFO_TEXT	0x001D
#define	RECEIPTED_MESSAGE_ID	0x001E
#define	MS_MSG_WAIT_FACILITIES	0x0030
#define	PRIVACY_INDICATOR		0x0201
#define	SOURCE_SUBADDRESS		0x0202
#define	DEST_SUBADDRESS			0x0203
#define	USER_MESSAGE_REFERENCE	0x0204
#define	USER_RESPONSE_CODE		0x0205
#define	SOURCE_PORT				0x020A
#define	DESTINATION_PORT		0x020B
#define	SAR_MSG_REF_NUM			0x020C
#define	LANGUAGE_INDICATOR		0x020D
#define	SAR_TOTAL_SEGMENTS		0x020E
#define	SAR_SEGMENT_SEQNUM		0x020F
#define	SC_INTERFACE_VERSION	0x0210
#define	CALLBACK_NUM_PRES_IND	0x0302
#define	CALLBACK_NUM_ATAG		0x0303
#define	NUMBER_OF_MESSAGES		0x0304
#define	CALLBACK_NUM			0x0381
#define	DPF_RESULT				0x0420
#define	SET_DPF					0x0421
#define	MS_AVAILABILITY_STATUS	0x0422
#define	NETWORK_ERROR_CODE		0x0423
#define	MESSAGE_PAYLOAD			0x0424
#define	DELIVERY_FAILURE_REASON	0x0425
#define	MORE_MESSAGES_TO_SEND	0x0426
#define	MESSAGE_STATE			0x0427
#define	USSD_SERVICE_OP			0x0501
#define	DISPLAY_TIME			0x1201
#define	SMS_SIGNAL				0x1203
#define	MS_VALIDITY				0x1204
#define	ALERT_ON_MESSAGE_DELIVERY	0x130C
#define	ITS_REPLY_TYPE			0x1380
#define	ITS_SESSION_INFO		0x1383

/* Command status definition. */
#define	ESME_ROK				0x00000000
#define	ESME_RINVMSGLEN			0x00000001
#define	ESME_RINVCMDLEN			0x00000002
#define	ESME_RINVCMDID			0x00000003
#define	ESME_RINVBNDSTS			0x00000004
#define	ESME_RALYBND			0x00000005
#define	ESME_RINVPRTFLG			0x00000006
#define	ESME_RINVREGDLVFLG		0x00000007
#define	ESME_RSYSERR			0x00000008
/* #define	Reserved			0x00000009				*/
#define	ESME_RINVSRCADR			0x0000000A
#define	ESME_RINVDSTADR			0x0000000B
#define	ESME_RINVMSGID			0x0000000C
#define	ESME_RBINDFAIL			0x0000000D
#define	ESME_RINVPASWD			0x0000000E
#define	ESME_RINVSYSID			0x0000000F
/* #define	Reserved			0x00000010				*/
#define	ESME_RCANCELFAIL		0x00000011
/*#define	Reserved			0x00000012				*/
#define	ESME_RREPLACEFAIL		0x00000013
#define	ESME_RMSGQFUL			0x00000014
#define	ESME_RINVSERTYP			0x00000015
/* #define	Reserved			0x00000016-0x00000032	*/
#define	ESME_RINVNUMDESTS		0x00000033
#define ESME_RINVDLNAME			0x00000034
/* #define	Reserved			0x00000035-0x0000003F	*/
#define	ESME_RINVDESTFLAG		0x00000040
/* #define	Reserved			0x00000041				*/
#define	ESME_RINVSUBREP			0x00000042
#define	ESME_RINVESMCLASS		0x00000043
#define	ESME_RCNTSUBDL			0x00000044
#define	ESME_RSUBMITFAIL		0x00000045
/* #define	Reserved			0x00000046-0x00000047	*/
#define	ESME_RINVSRCTON			0x00000048
#define	ESME_RINVSRCNPI			0x00000049
/* #define	Reserved			0x0000004A-0x0000004F	*/
#define	ESME_RINVDSTTON			0x00000050
#define	ESME_RINVDSTNPI			0x00000051
/* #define	Reserved			0x00000052				*/
#define	ESME_RINVSYSTYP			0x00000053
#define	ESME_RINVREPFLAG		0x00000054
#define	ESME_RINVNUMMSGS		0x00000055
/* #define	Reserved			0x00000056-0x00000057	*/
#define	ESME_RTHROTTLED			0x00000058
/* #define	Reserved			0x00000059-0x00000060	*/
#define	ESME_RINVSCHED			0x00000061
#define	ESME_RINVEXPIRY			0x00000062
#define	ESME_RINVDFTMSGID		0x00000063
#define	ESME_RX_T_APPN			0x00000064
#define	ESME_RX_P_APPN			0x00000065
#define	ESME_RX_R_APPN			0x00000066
#define	ESME_RQUERYFAIL			0x00000067
/* #define	Reserved			0x00000068-0x000000BF	*/
#define	ESME_RINVOPTPARSTREAM	0x000000C0
#define	ESME_ROPTPARNOTALLWD	0x000000C1
#define	ESME_RINVPARSLEN		0x000000C2
#define	ESME_RMISSINGOPTPARAM	0x000000C3
#define	ESME_RINVOPTPARAMVAL	0x000000C4
/* #define	Reserved			0x000000C5-0x000000FD	*/
#define	ESME_RDELIVERYFAILURE	0x000000FE
#define	ESME_RUNKNOWNERR		0x000000FF
/* #define	Reserved_for_SMPP_extention		0x00000100-0x000003FF	*/
/* #define	Reserved_for_SMSC_vendor_specific_errors	0x00000100-0x000003FF	*/
/* #define	Reserved			0x00000500-0xFFFFFFFF	*/

/* define dest_network_type optional parameters */
#define	DEST_NETWORK_TYPE_UNKNOWN			0x00
#define	DEST_NETWORK_TYPE_GSM				0x01
#define	DEST_NETWORK_TYPE_ANSI136_TDMA		0x02
#define	DEST_NETWORK_TYPE_IS95_CDMA			0x03
#define	DEST_NETWORK_TYPE_PDC				0x04
#define	DEST_NETWORK_TYPE_PHS				0x05
#define	DEST_NETWORK_TYPE_IDEN				0x06
#define	DEST_NETWORK_TYPE_AMPS				0x07
#define	DEST_NETWORK_TYPE_PAGING_NETWORK	0x08

/* define destination address type */
#define	DESTINATION_ADDRESS_SME_ADDRESS				0x01
#define	DESTINATION_ADDRESS_DISTRIBUTION_LIST_NAME	0x02

/* define Type of Number(TON)	*/
#define TON_UNKNOWN				0x0
#define	TON_INTERNATIONAL		0x1
#define	TON_NATIONAL			0x2
#define	TON_NETWORK_SPECIFIC	0x3
#define	TON_SUBSCRIBER_NUMBER	0x4
#define	TON_ALPHANUMERIC		0x5
#define	TON_ABBREVIATE			0x6

/* define Numeric Plan Indicator(NPI) */
#define NPI_UNKNOWN				0x0
#define	NPI_ISDN				0x1
#define	NPI_DATA				0x3
#define	NPI_TELEX				0x4
#define	NPI_LAND_MOBILE			0x6
#define	NPI_NATIONAL			0x8
#define	NPI_PRIVATE				0x9
#define	NPI_ERMES				0xa
#define	NPI_INTERNET			0xe

#endif

