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

📄 smgpapi.h

📁 电信短信应用smgp1.3协议网关,中兴开发包
💻 H
字号:
/********************************************************************
ModuleName: 	SMGW Client API
FileName:		smgpapi.h 
DESCRIPTION:    The Function ProtoType And Struct Definition Of API       
History:                                                        
Date       	Version			Modifier			 	Activies
2002/02/27	1.0			Zhang Jiebin			        Create
2002/10/18	3.5			Li Jianfu   			        Modify
********************************************************************/
#ifndef _SMGP_API_H_
#define _SMGP_API_H_

/*#define SMGP_CLIENT_VERSION10*/
#ifdef SMGP_API_EXPORTS
#define SMGPAPI_EXPORTS int __stdcall
#else
#define SMGPAPI_EXPORTS int 
#endif


#ifdef _WIN32
  #pragma pack(push,1)
#elif defined _AIX
  #pragma options align=packed
#elif defined _HPUX
  #pragma pack 1
#else
  #pragma pack (1)
#endif


/* Send Batch Message Responce Which Is Written In File */
typedef struct
{
	char	sMsgID[10+1];			
	int		nErrorCode;
	char	sPhoneNo[21+1];
}SendBatchResp;

/* Query Message Responce Struct */
typedef struct
{
	int		nMT_TLMsg;
	int		nMT_TLusr;
	int		nMT_Scs;
	int		nMT_WT;
	int		nMT_FL;
	int		nMO_Scs;
	int		nMO_WT;
	int		nMO_FL;
}QueryResp;
/*wdw add*/
typedef struct
{
	char	destId[11];
	char	command[11];
}WdwAdd;
/* Receive Message Responce Struct */
#ifdef SMGP_API_EXPORTS
/*DLL VERSION*/
typedef struct
{
	unsigned int	nIsReport;
	unsigned int	nMsgFormat;
	unsigned int	nMsgLength;
	char		sMsgID[10+1];
	char		sRecvTime[14+1];
	char		sSrcTermID[21+1];
	char		sDestTermID[21+1];
	char		sMsgContent[252+1];
}DeliverResp;

#else
/*NOT DLL VERSION*/
typedef struct
{
	char		sMsgID[10+1];
	unsigned int	nIsReport;
	unsigned int	nMsgFormat;
	char		sRecvTime[14+1];
	char		sSrcTermID[21+1];
	char		sDestTermID[21+1];
	unsigned int	nMsgLength;
	char		sMsgContent[252+1];
}DeliverResp;

#endif /*SMGP_API_EXPORTS*/

#ifdef _WIN32
  #pragma pack(pop)
#elif defined _AIX
  #pragma options align=reset
#elif defined _HPUX
  #pragma pack 4
#else
  #pragma pack ()
#endif


#ifdef __cplusplus 
extern "C"{
#endif

/********************************************************************
The Function Prototype
********************************************************************/

/********************************************************************
FunctionName:	InitSMGPAPI 
DESCRIPTION:    Must call this initiate function before 
				calling others SMGP API functions if standard c is 
				used, param sINIFile must be specfied.       
Input:			sINIFile:The address of init file name 
Output:			None
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS InitSMGPAPI(const char *sINIFile);


/********************************************************************
FunctionName:	SMGPSendSingle 
DESCRIPTION:    Send a short message to single user,if succeed, message
				id is filled in sMsgID.if fail, error code is filled in 
				nErrorCode.  
Input:			nNeedReply:Need reply the status?0:no,1:yes
				nMsgLevel:Message level:0:the lowest,	1:normal,
										2:above normal	3:the highest
				sServiceID:Server type
				nMsgFormat:Message format
				sFeeType:Fee type
				sFeeCode:Fee code
				sValidTime:Valid time,format following smpp3.3
				sAtTime:The time of sending,format following smpp3.3
				sChargeTermID:Paying User number
				sDestTermID:Reveive Message number
				sReplyPath:User reply number
				nMsgLen:Message length
				sMsgContent:Message Content
													
Output:			sMsgID:If succeed, message id is filled in sMsgID
				nErrorCode:If fail, error code is filled in nErrorCode
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS SMGPSendSingle(	const int nNeedReply, const int nMsgLevel,
		const char *sServiceID, const int nMsgFormat,
		const char *sFeeType, const char *sFeeCode, const char *sFixedFee,
		const char *sValidTime, const char *sAtTime,
		const char *sChargeTermID, const char *sDestTermID,
		const char *sReplyPath, const int nMsgLen,
		const char *sMsgContent,char *sMsgID, 
		int *nErrorCode,const int nMsgType);

/********************************************************************
FunctionName:	SMGPSendBatch 
DESCRIPTION:    Send a short message to multiple users,if succeed, message
				id is filled in sMsgID.if fail, error code is filled in 
				nErrorCode.
			   	If nMsgLen is 0, then sMsgFile is the filename which contains 
   				message content, if not, then sMsgFile contains the message. 
   				If Both of them are 0, SMGPSendBatch fail.

Input:			nNeedReply:Need reply the status?0:no,1:yes
				nMsgLevel:Message level:0:the lowest,	1:normal,
										2:above normal	3:the highest
				sServiceID:Server type
				nMsgFormat:Message format
				sFeeType:Fee type
				sFeeCode:Fee code
				sValidTime:Valid time,format following smpp3.3
				sAtTime:The time of sending,format following smpp3.3
				sChargeTermID:Paying User number
				sDestTermID:Reveive Message number
				sReplyPath:User reply number
				nMsgLen:Message length
				sMsgFile:The file which contains the message content or
						 message Content,see description.
				sMsgIDFile:The file name which save the all message id
							or error code.
													
Output:			None
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS SMGPSendBatch( const int nNeedReply, const int nMsgLevel,
		const char *sServiceID, const int nMsgFormat,
		const char *sFeeType, const char *sFeeCode,const char *sFixedFee,
		const char *sValidTime, const char *sAtTime,
		const char *sChargeTermID, const char *sDestTermIDFile,
		const char *sReplyPath, const int nMsgLen,
		const char *sMsgFile, const char *sMsgIDFile,const int nMsgType);

/********************************************************************
FunctionName:	GetSendBatchResp 
DESCRIPTION:    Give a MSGID file which is created by Batch send,  
				specify position of the record,	then get response from 
				the file. each field of the param SendBatchResp will
				filled.	nPos start from 0
Input:			sMsgIDFile:The file name which save the all message id
							or error code.
													
Output:			pSendBatchResp:The message id and error code
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS GetSendBatchResp(char *sMsgIDFile, int nPos, SendBatchResp *pSendBatchResp);

/********************************************************************
FunctionName:	SMGPDeliver 
DESCRIPTION:    Get ShortMessage from SMGW
Input:			nTimeout:how many seconds the function keep waiting short
				message, 0 means wait forever.													
Output:			pDeliverResp:the delivered short message is filled in pDeliverResp
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS SMGPDeliver(const int nTimeoutIn, DeliverResp *pDeliverResp);

/********************************************************************
FunctionName:	CMMPActiveTest 
DESCRIPTION:    See if the SMGW is available
Input:			
Output:			nErrorCode:Response error code,0 is ok 
Return:			0=OK, 1=fail
History:                                                        
Date       	Version			Modifier			 	Activies

*******************************************************************/
SMGPAPI_EXPORTS SMGPActiveTest(int *nErrorCode);

#ifdef __cplusplus
}
#endif


#endif   /* _SMGP_API_H_ */

⌨️ 快捷键说明

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