This commit is contained in:
zhangsz
2025-03-03 11:01:26 +08:00
parent 5f1710dc22
commit dae6fc93f7
1057 changed files with 519829 additions and 0 deletions

98
plat/smpp/Makefile Normal file
View File

@@ -0,0 +1,98 @@
##----------------------------------------------------------##
## ##
## Universal Makefile for module template : V1.6.3 ##
## ##
## Created : Wei Liu 07/04/11 ##
## Revision: [Last]Wei Liu 07/07/07 ##
## ##
##----------------------------------------------------------##
##---------------------------------------------------------------------##
##--------------------------------------
##
## Project correlation(Customer define)
##
##--------------------------------------
## MODULE= [Module Name]
## TYPE = app/plat => Module Type
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Debug ]
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Release]
## BUILD = lib/exef => Output file format
## CFG = debug/release => Build Configuration
## SRC_PATH = [Source file path]
## INC_PATH = [Include file path]
## APP_PATH = [App Module path]
## PLT_PATH = [Plat Module path]
## PLT_LIB = [Needed plat lib for Link] => just for test or wxc2main
## APP_LIB = [Needed app lib for Link] => just for test or wxc2main
## LIB_ADD = [Needed Extend lib for Link] => just for test or wxc2main
## PLT_LIB e.g. = haepub fsm mng proto kernel aif mgc mgcp sip rtp \
## 8ecp bicc smpp xapp tcap mtp3 m2ua \
## snmp iptrans debug sccp public
##
## APP_LIB e.g. = msc vlr ssf hlr ae pps mnp smsc vms aas
## LIB_ADD e.g. = -liba3a8 -lm
## OBJ_ADD = [Extend third party object files needed]
## TEST_OBJ_PATH = [module object files Path for test ] => just for test
##---------------------------------------------------------------------##
MODULE = smpp
TYPE = plat
DBUG_FLAGS_ADD =
RELS_FLAGS_ADD =
##Default commonly as below
BUILD = lib
CFG = debug
PLT_LIB =
APP_LIB =
LIB_ADD =
SRC_PATH = ./src
INC_PATH = ./src/include
PLT_PATH = ../../plat
APP_PATH = ../../mss
OBJ_ADD =
TEST_OBJ_PATH =
PREPROC_CMD =
POSTPROC_CMD =
##---------------------------------------------------------------------##
##--------------------------------------
##
## Make configuration(Customer define)
##
##--------------------------------------
## CCFLAG_SWITCH = on/off => gcc flag show on/off
## COVER_NEED = yes/no => PTF cover report needed
## COVER_REPORT_PATH = [path ] => PTF cover report path
CCFLAG_SWITCH = off
COVER_NEED = no
COVER_REPORT_PATH = ./output
##---------------------------------------------------------------------##
##--------------------------------------
##
## include makefile.rules (Do not change)
##
##--------------------------------------
include Makefile.rules

View File

@@ -0,0 +1,187 @@
/*
** CDMA 2000 project, SMPP module
**
** File name: smpp.h
** Written by Li Long at 2004-11-25
** CVS $Id: smpp.h,v0.1 2004/11/25 17:03:14 lilong Exp $
**
*/
#ifndef _SMPP_h
#define _SMPP_h
#include "smpp_public.h"
#include "smpp_const.h"
#include "../../../debug/src/include/debug.h"
#include "../../../sccp/src/include/sccp.h"
#include "../../../iptrans/src/include/iptrans.h"
#include "../../../mtp3/src/include/mtp3.h"
#include "../../../snmp/src/include/snmp.h"
#include "../../../public/src/include/public.h"
#include "smpp_msg.h"
enum SMPP_State_Constant {INIT, IDLE, WAITING, ESTABLISHED, SUSPEND};
enum SMPP_APIEvent {APIEventReversed, Register, Setup, Close};
enum SMPP_InterEvent {InterEventReserved, Outbind, Unbind, UnbindResp,
BindTransmitter, BindReceiver, BindTransceiver, //4
BindTransmitterResp, BindReceiverResp, BindTransceiverResp, //7
EnquireLink, EnquireLinkResp, //10
SubmitSM, SubmitSMResp, //12
SubmitMulti, SubmitMultiResp, //14
DeliverSM, DeliverSMResp, //16
DataSM, DataSMResp, //18
GenericNak, //20
SessionInitTimeout, EnquireLinkTimeout, InactivityTimeout, ResponseTimeOut, //21
QuerySM, QuerySMResp, //25
CancelSM, CancelSMResp, //27
ReplaceSM, ReplaceSMResp, //29
AlertNotification, //31
UnknownCommandID}; //32
typedef struct SMPP_LINK
{
DWORD seq_num;
DWORD command_status;
}SMPP_LINK;
typedef struct SMPP_DEBUG_STRUCT
{
BYTE debug_switch;
BYTE link_switch[MAX_SMPP_LINK];
}SMPP_DEBUG_STRUCT;
typedef struct SMPP_PARAM
{
BYTE link_no; //0~31
BYTE link_enable; //0-Disable, 1-Enable
BYTE link_type; //0-UDP 1-TCP
BYTE server_type; //0-SMPP_CLIENT; 1-SMPP_SERVER
BYTE session_type; //0-BIND_TX; 1-BIND_RX; 2-BIND_TRX
char sys_id[16];
char password[9];
char system_type[13];
char localGTT[16];
char remoteGTT[16];
DWORD local_ip;
DWORD remote_ip;
DWORD session_init_timer;
DWORD enquire_link_timer;
DWORD inactivity_timer;
DWORD response_timer;
char service_number[8];
BYTE localSSN;
BYTE remoteSSN;
BYTE message_mode;
} SMPP_PARAM;
// Inter-Function define
int smpp_Register(BYTE);
void smpp_PrimitiveSend(int linkNo, int command_id);
void smpp_initTCPClient();
void smpp_initTCPServer();
void smpp_tcp_connect(int link);
void smpp_debugInit();
void smpp_stateInit();
void smpp_msgInit();
void smpp_debugTimer();
char *smpp_getLocalIP();
void smpp_setupTCPLink(int);
void smpp_rvMsgOverSCCP(BYTE sccp_usertype);
void smpp_rvMsgOverTCP();
WORD smpp_getServerPort();
DWORD smpp_getSequenceNumber(int);
int smpp_decode_msg(int, SMPP_GENERAL*, int);
int smpp_closeTCPConnection(int);
int smpp_encode_msg(int, SMPP_MSG *, int);
void smpp_setSccpAddr(int, SCCP_ADDR *, SCCP_ADDR *);
BYTE smpp_ascii2GTAI(BYTE *pGTAI, char *pGTT);
void smpp_GTAI2ascii(char *, BYTE *, BYTE);
void smpp_send_ascout(char *);
void smpp_send_error(char *);
void smpp_display_hex_msg(BYTE* disp_ptr, int len);
void smpp_command_id_to_string(char *comm_str, DWORD command_id);
void smpp_command_status_to_string(char* status_str, DWORD command_status);
void smpp_ton_to_string(char* ton_str, BYTE ton);
void smpp_npi_to_string(char* npi_str, BYTE npi);
void smpp_sendBindResp(int, int, DWORD command_status);
void smpp_sendUnbind(int);
void smpp_sendUnbindResp(int);
void smpp_sendEnquireLink(int);
void smpp_sendEnquireLinkResp(int);
void smpp_sendOutbind(int);
void smpp_sendBind(int, int);
void smpp_sendGenericNack(int, DWORD, DWORD);
void smpp_sendResponse(int , DWORD , DWORD , DWORD );
void smpp_addTLV(BYTE *, WORD, BYTE *, WORD);
int smpp_loadParam();
int smpp_writeParam();
void smpp_checkParam();
int smpp_setParam(DWORD *oid, BYTE *pdata, WORD datalen);
void smpp_reset();
void smpp_debug(DWORD mask, const char *fmt, ...);
void smpp_close(BYTE linkNo);
void smpp_mibInit();
int smpp_decode_optional_parameter(SMPP_OPTIONAL_PARAMETER* opt_ptr, BYTE* msg_ptr, int t_len);
int smpp_check_sysid_route(char* sysid_rv, BYTE sysidlen_rv, BYTE server_type, BYTE session_type);
int smpp_decode_setup(BYTE link_type, int tcp_linkNo, BYTE src_ref, SMPP_GENERAL *pData, int len);
/* TCP connection */
typedef struct SocketsMsg
{
int AcceptNum;
int ReadNum;
int ReadQueue[MAX_SMPP_LINK];
int WriteNum;
int WriteQueue[MAX_SMPP_LINK];
int ExceptNum;
int ExceptQueue[MAX_SMPP_LINK];
}SocketsMsg;
typedef struct SocketsInUse
{
int DaemonSock;
int SockNum;
int Sockets[MAX_SMPP_LINK];
int client_sock[MAX_SMPP_LINK];
int server_sock[MAX_SMPP_LINK];
u32 remote_ip[MAX_SMPP_LINK];
fd_set readfds,writefds,exceptfds;
int Port;
}SocketsInUse;
//SocketsMsg SockMsg;
int QuerySocketsMsg();
// Call back function define
//param1:linkNo; param2:msg mode; param3: pData; param4:pDataLen
typedef int (*smpp_callBack_dataProc) (BYTE, SMPP_MSG*, WORD);
//param1:linkNo; param2:link status
typedef int (*smpp_callBack_linkProc) (BYTE, BYTE);
typedef struct SMPP_CALLBACK
{
smpp_callBack_dataProc data_proc;
smpp_callBack_linkProc link_proc;
} SMPP_CALLBACK;
// API
int smpp_init_new(u8 sys_id); //call in main program.
void smpp_fsm_new();
BYTE smpp_registerLink(BYTE server_type, BYTE session_type, char* service_number_ptr, BYTE message_mode);
void smpp_attach_link(BYTE linkNo,
smpp_callBack_dataProc onDataRecv,
smpp_callBack_linkProc onLinkStateChange);
/* return sequence number */
WORD smpp_send(BYTE linkNo, SMPP_MSG* pMsg, WORD dataLen);
void init_link(u32 link);
#endif

View File

@@ -0,0 +1,240 @@
//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

View File

@@ -0,0 +1,39 @@
#ifndef _SMPP_DEF_h
#define _SMPP_DEF_h
/*SMPP_CALLBACK callBackFunc[MAX_SMPP_LINK];
SMPP_PARAM smpp_param[MAX_SMPP_LINK];
SMPP_LINK smpp_link[MAX_SMPP_LINK];
struct SocketsInUse Mysock;
SMPP_DEBUG_STRUCT smppDebug;
BYTE exterEvent[MAX_SMPP_LINK][CMD_BUF_SIZE];
BYTE interEvent[MAX_SMPP_LINK][CMD_BUF_SIZE];
BYTE exter_head[MAX_SMPP_LINK];
BYTE exter_tail[MAX_SMPP_LINK];
BYTE inter_head[MAX_SMPP_LINK];
BYTE inter_tail[MAX_SMPP_LINK];
BYTE smpp_state[MAX_SMPP_LINK];
BYTE smpp_hearbeat_status[MAX_SMPP_LINK/4];
BYTE interface_mode[MAX_SMPP_LINK];
BYTE data_mode[MAX_SMPP_LINK];
BYTE linkAttachFlag[MAX_SMPP_LINK];
BYTE smpp_TCPClientFlag[MAX_SMPP_LINK];
char smpp_debug_asciiIn[MAX_ASCIN_BUF_LEN];
char smpp_debug_asciiOut[MAX_ASCOUT_BUF_LEN];
BYTE smppDebugFull = 0;
BYTE src_ref[MAX_SMPP_LINK];
BYTE dst_ref[MAX_SMPP_LINK];
BYTE smpp_msg[MAX_PACKET_SIZE];
BYTE smpp_system_no;*/
#endif

View File

@@ -0,0 +1,38 @@
#ifndef _SMPP_EXT_h
#define _SMPP_EXT_h
extern SMPP_CALLBACK callBackFunc[MAX_SMPP_LINK];
extern SMPP_PARAM smpp_param[MAX_SMPP_LINK];
extern SMPP_LINK smpp_link[MAX_SMPP_LINK];
extern struct SocketsInUse Mysock;
extern SMPP_DEBUG_STRUCT smppDebug;
extern BYTE exterEvent[MAX_SMPP_LINK][CMD_BUF_SIZE];
extern BYTE interEvent[MAX_SMPP_LINK][CMD_BUF_SIZE];
extern BYTE exter_head[MAX_SMPP_LINK];
extern BYTE exter_tail[MAX_SMPP_LINK];
extern BYTE inter_head[MAX_SMPP_LINK];
extern BYTE inter_tail[MAX_SMPP_LINK];
extern BYTE smpp_state[MAX_SMPP_LINK];
extern BYTE smpp_hearbeat_status[MAX_SMPP_LINK/4];
extern BYTE interface_mode[MAX_SMPP_LINK];
extern BYTE data_mode[MAX_SMPP_LINK];
extern BYTE linkAttachFlag[MAX_SMPP_LINK];
extern BYTE smpp_TCPClientFlag[MAX_SMPP_LINK];
extern char smpp_debug_asciiIn[MAX_ASCIN_BUF_LEN];
extern char smpp_debug_asciiOut[MAX_ASCOUT_BUF_LEN];
extern BYTE smppDebugFull;
extern BYTE src_ref[MAX_SMPP_LINK];
extern BYTE dst_ref[MAX_SMPP_LINK];
extern BYTE smpp_msg[MAX_PACKET_SIZE];
extern BYTE smpp_system_no;
#endif

View File

@@ -0,0 +1,465 @@
#ifndef _SMPP_MSG_h
#define _SMPP_MSG_h
typedef struct SMPP_HEAD
{
DWORD command_length;
DWORD command_id;
DWORD command_status;
DWORD sequence_number;
}SMPP_HEAD;
typedef struct SMPP_GENERAL
{
SMPP_HEAD head;
BYTE msg[SMPP_MSG_LEN];
}SMPP_GENERAL;
typedef struct PDU_BIND
{
SMPP_HEAD head;
char system_id[16];
char password[9];
char system_type[13];
BYTE interface_version;
BYTE addr_ton;
BYTE addr_npi;
char address_range[41];
}PDU_BIND;
typedef struct PDU_BIND_RESP
{
SMPP_HEAD head;
char system_id[16];
/* optional parameter */
BYTE sc_interface_version;
}PDU_BIND_RESP;
typedef struct PDU_OUTBIND
{
SMPP_HEAD head;
char system_id[16];
char password[9];
}PDU_OUTBIND;
typedef struct PDU_UNBIND
{
SMPP_HEAD head;
}PDU_UNBIND;
typedef struct PDU_UNBIND_RESP
{
SMPP_HEAD head;
}PDU_UNBIND_RESP;
typedef struct PDU_GENERIC_NACK
{
SMPP_HEAD head;
}PDU_GENERIC_NACK;
typedef struct PDU_SUBMIT_SM
{
SMPP_HEAD head;
/* define mandatory parameters */
char service_type[6];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[21];
BYTE esm_class;
BYTE protocol_id;
BYTE priority_flag;
char schedule_delivery_time[17];
char validity_period[17];
BYTE registered_delivery;
BYTE replace_if_present_flag;
BYTE data_coding;
BYTE sm_default_msg_id;
BYTE sm_length;
BYTE short_message[254];
/* define optional parameters */
/* total: 28 parameters. */ /* param_flag1 */
WORD user_message_reference; /* 0x0000 0001 */
WORD source_port; /* 0x0000 0002 */
BYTE source_addr_subunit; /* 0x0000 0004 */
WORD destination_port; /* 0x0000 0008 */
BYTE dest_addr_subunit; /* 0x0000 0010 */
WORD sar_msg_ref_num; /* 0x0000 0020 */
BYTE sar_total_segments; /* 0x0000 0040 */
BYTE sar_segment_seqnum; /* 0x0000 0080 */
BYTE more_messages_to_send; /* 0x0000 0100 */
BYTE payload_type; /* 0x0000 0200 */
char message_payload[MAX_MSG_SIZE]; /* 0x0000 0400 */
BYTE privacy_indicator; /* 0x0000 0800 */
char callback_num[19]; /* 0x0000 1000 */
BYTE callback_num_pres_ind; /* 0x0000 2000 */
char callback_num_atag[65]; /* 0x0000 4000 */
char source_subaddress[23]; /* 0x0000 8000 */
char dest_subaddress[23]; /* 0x0001 0000 */
BYTE user_response_code; /* 0x0002 0000 */
BYTE display_time; /* 0x0004 0000 */
WORD sms_signal; /* 0x0008 0000 */
BYTE ms_validity; /* 0x0010 0000 */
BYTE ms_msg_wait_facilities; /* 0x0020 0000 */
BYTE number_of_messages; /* 0x0040 0000 */
BYTE alert_on_message_delivery; /* 0 byte. */ /* 0x0080 0000 */
BYTE language_indicator; /* 0x0100 0000 */
BYTE its_reply_type; /* 0x0200 0000 */
BYTE its_session_info[2]; /* 0x0400 0000 */
BYTE ussd_service_op; /* 0x0800 0000 */
BYTE dest_network_type; /* 0x1000 0000 */ /* smpp v5.0 */
}PDU_SUBMIT_SM;
typedef struct PDU_SUBMIT_SM_RESP
{
SMPP_HEAD head;
char message_id[65];
}PDU_SUBMIT_SM_RESP;
typedef struct SME_DEST_ADDRESS
{
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[21];
}SME_DEST_ADDRESS;
typedef struct DL_NAME
{
char dl_name[21];
}DL_NAME;
typedef union DEST_ADDR
{
SME_DEST_ADDRESS sme_dest_address;
DL_NAME dl_name;
}DEST_ADDR;
typedef struct DESTINATION_ADDRESS_DEFINITION
{
BYTE dest_flag;
DEST_ADDR dest_addr;
}DESTINATION_ADDRESS_DEFINITIAON;
typedef struct PDU_SUBMIT_MULTI
{
SMPP_HEAD head;
/* define mandatory parameters */
char service_type[6];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
BYTE number_of_dests;
DESTINATION_ADDRESS_DEFINITIAON dest_address[SMPP_MAX_MULTI_ADDRESS];
BYTE esm_class;
BYTE protocol_id;
BYTE priority_flag;
char schedule_delivery_time[17];
char validity_period[17];
BYTE registered_delivery;
BYTE replace_if_present_flag; /* set to NULL */
BYTE data_coding;
BYTE sm_default_msg_id;
BYTE sm_length;
BYTE short_message[254];
/* define optional parameters */
/* total: 22 parameters. */ /* param_flag1 */
WORD user_message_reference; /* 0x0000 0001 */
WORD source_port; /* 0x0000 0002 */
BYTE source_addr_subunit; /* 0x0000 0004 */
WORD destination_port; /* 0x0000 0008 */
BYTE dest_addr_subunit; /* 0x0000 0010 */
WORD sar_msg_ref_num; /* 0x0000 0020 */
BYTE sar_total_segments; /* 0x0000 0040 */
BYTE sar_segment_seqnum; /* 0x0000 0080 */
BYTE payload_type; /* 0x0000 0100 */
char message_payload[MAX_MSG_SIZE]; /* 0x0000 0200 */
BYTE privacy_indicator; /* 0x0000 0400 */
char callback_num[19]; /* 0x0000 0800 */
BYTE callback_num_pres_ind; /* 0x0000 1000 */
char callback_num_atag[65]; /* 0x0000 2000 */
char source_subaddress[23]; /* 0x0000 4000 */
char dest_subaddress[23]; /* 0x0000 8000 */
BYTE display_time; /* 0x0001 0000 */
WORD sms_signal; /* 0x0002 0000 */
BYTE ms_validity; /* 0x0004 0000 */
BYTE ms_msg_wait_facilities; /* 0x0008 0000 */
BYTE alert_on_message_delivery;/* 0byte */ /* 0x0010 0000 */
BYTE language_indicator; /* 0x0020 0000 */
BYTE dest_network_type; /* 0x0040 0000 */
}PDU_SUBMIT_MULTI;
typedef struct UNSUCCESS_SME
{
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[21];
DWORD error_status_code;
}UNSUCCESS_SME;
typedef struct PDU_SUBMIT_MULTI_RESP
{
SMPP_HEAD head;
char message_id[65];
BYTE no_unsuccess;
UNSUCCESS_SME unsuccess_sme[MAX_SME];
}PDU_SUBMIT_MULTI_RESP;
typedef struct PDU_DELIVER_SM
{
SMPP_HEAD head;
/* define mandatory parameter. */
char service_type[6];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[21];
BYTE esm_class;
BYTE protocol_id;
BYTE priority_flag;
char schedule_delivery_time; /* set to NULL */
char validity_period; /* set to NULL */
BYTE registered_delivery;
BYTE replace_if_present_flag; /* set to NULL */
BYTE data_coding;
BYTE sm_default_msg_id; /* set to NULL */
BYTE sm_length;
BYTE short_message[254];
/* define optional parameter. */
/* total: 19 parameters. */ /* param_flag1 */
WORD user_message_reference; /* 0x0000 0001 */
WORD source_port; /* 0x0000 0002 */
WORD destination_port; /* 0x0000 0004 */
WORD sar_msg_ref_num; /* 0x0000 0008 */
BYTE sar_total_segments; /* 0x0000 0010 */
BYTE sar_segment_seqnum; /* 0x0000 0020 */
BYTE user_response_code; /* 0x0000 0040 */
BYTE privacy_indicator; /* 0x0000 0080 */
BYTE payload_type; /* 0x0000 0100 */
char message_payload[MAX_MSG_SIZE]; /* 0x0000 0200 */
char callback_num[49]; /* 0x0000 0400 */
char source_subaddress[23]; /* 0x0000 0800 */
char dest_subaddress[23]; /* 0x0000 1000 */
BYTE language_indicator; /* 0x0000 2000 */
BYTE its_session_info[2]; /* 0x0000 4000 */
char network_error_code[3]; /* 0x0000 8000 */
BYTE message_state; /* 0x0001 0000 */
char receipted_message_id[65]; /* 0x0002 0000 */
BYTE ussd_service_op; /* 0x0004 0000 */ /* smpp v5.0 */
}PDU_DELIVER_SM;
typedef struct PDU_DELIVER_SM_RESP
{
SMPP_HEAD head;
char message_id;
}PDU_DELIVER_SM_RESP;
typedef struct PDU_DATA_SM
{
SMPP_HEAD head;
/* define mandatory paramter. */
char service_type[6];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[65];
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[65];
BYTE esm_class;
BYTE registered_delivery;
BYTE data_coding;
/* define optional parameter. */
/* total: 38 paramters. */ /* param_flag */
WORD source_port; /* 0x0000 0001 */ /* param_flag1 start. */
BYTE source_addr_subunit; /* 0x0000 0002 */
BYTE source_network_type; /* 0x0000 0004 */
BYTE source_bearer_type; /* 0x0000 0008 */
WORD source_telematics_id; /* 0x0000 0010 */
WORD destination_port; /* 0x0000 0020 */
BYTE dest_addr_subunit; /* 0x0000 0040 */
BYTE dest_network_type; /* 0x0000 0080 */
BYTE dest_bearer_type; /* 0x0000 0100 */
WORD dest_telematics_id; /* 0x0000 0200 */
WORD sar_msg_ref_num; /* 0x0000 0400 */
BYTE sar_total_segments; /* 0x0000 0800 */
BYTE sar_segment_seqnum; /* 0x0000 1000 */
BYTE more_messages_to_send; /* 0x0000 2000 */
DWORD qos_time_to_live; /* 0x0000 4000 */
BYTE payload_type; /* 0x0000 8000 */
char message_payload[MAX_MSG_SIZE]; /* 0x0001 0000 */
BYTE set_dpf; /* 0x0002 0000 */
char receipted_message_id[65]; /* 0x0004 0000 */
BYTE message_state; /* 0x0008 0000 */
char network_error_code[3]; /* 0x0010 0000 */
WORD user_message_reference; /* 0x0020 0000 */
BYTE privacy_indicator; /* 0x0040 0000 */
char callback_num[19]; /* 0x0080 0000 */
BYTE callback_num_pres_ind; /* 0x0100 0000 */
char callback_num_atag[65]; /* 0x0200 0000 */
char source_subaddress[23]; /* 0x0400 0000 */
char dest_subaddress[23]; /* 0x0800 0000 */
BYTE user_response_code; /* 0x1000 0000 */
BYTE display_time; /* 0x2000 0000 */
WORD sms_signal; /* 0x4000 0000 */
BYTE ms_validity; /* 0x8000 0000 */ /* param_flag1 end. */
BYTE ms_msg_wait_facilities; /* 0x0000 0001 */ /* param_flag2 start. */
BYTE number_of_messages; /* 0x0000 0002 */
BYTE alert_on_message_delivery;/* 0byte */ /* 0x0000 0004 */
BYTE language_indicator; /* 0x0000 0008 */
BYTE its_reply_type; /* 0x0000 0010 */
BYTE its_session_info[2]; /* 0x0000 0020 */
}PDU_DATA_SM;
typedef struct PDU_DATA_SM_RESP
{
SMPP_HEAD head;
char message_id[65];
}PDU_DATA_SM_RESP;
typedef struct PDU_QUERY_SM
{
SMPP_HEAD head;
char message_id[65];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
}PDU_QUERY_SM;
typedef struct PDU_QUERY_SM_RESP
{
SMPP_HEAD head;
char message_id[65];
char final_date[17];
BYTE message_state;
BYTE error_code;
}PDU_QUERY_SM_RESP;
typedef struct PDU_CANCEL_SM
{
SMPP_HEAD head;
char service_type[6];
char message_id[65];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
BYTE dest_addr_ton;
BYTE dest_addr_npi;
char destination_addr[21];
}PDU_CANCEL_SM;
typedef struct PDU_CANCEL_SM_RESP
{
SMPP_HEAD head;
}PDU_CANCEL_SM_RESP;
typedef struct PDU_REPLACE_SM
{
SMPP_HEAD head;
/* define mandatory parameter */
char message_id[65];
BYTE source_addr_ton;
BYTE source_addr_npi;
char source_addr[21];
char schedule_delivery_time[17];
char validity_period[17];
BYTE registered_delivery;
BYTE sm_default_msg_id;
BYTE sm_length;
BYTE short_message[254];
}PDU_REPLACE_SM;
typedef struct PDU_REPLACE_SM_RESP
{
SMPP_HEAD head;
}PDU_REPLACE_SM_RESP;
typedef struct PDU_ENQUIRE_LINK
{
SMPP_HEAD head;
}PDU_ENQUIRE_LINK;
typedef struct PDU_ENQUIRE_LINK_RESP
{
SMPP_HEAD head;
}PDU_ENQUIRE_LINK_RESP;
typedef struct PDU_ALERT_NOTIFICATION
{
SMPP_HEAD head;
BYTE source_addr_ton;
BYTE source_addr_npi;
BYTE source_addr[65];
BYTE esme_addr_ton;
BYTE esme_addr_npi;
BYTE esme_addr[65];
BYTE ms_availability_status;
}PDU_ALERT_NOTIFICATION;
typedef union SMPP_PDU
{
PDU_BIND bind_transmitter; /* message_type = 0x01 */
PDU_BIND_RESP bind_transmitter_resp; /* message_type = 0x02 */
PDU_BIND bind_receiver; /* message_type = 0x03 */
PDU_BIND_RESP bind_receiver_resp; /* message_type = 0x04 */
PDU_BIND bind_transceiver; /* message_type = 0x05 */
PDU_BIND_RESP bind_transceiver_resp; /* message_type = 0x06 */
PDU_OUTBIND outbind; /* message_type = 0x07 */
PDU_UNBIND unbind; /* message_type = 0x08 */
PDU_UNBIND_RESP unbind_resp; /* message_type = 0x09 */
PDU_GENERIC_NACK generic_nack; /* message_type = 0x0A */
PDU_SUBMIT_SM submit_sm; /* message_type = 0x0B */
PDU_SUBMIT_SM_RESP submit_sm_resp; /* message_type = 0x0C */
PDU_SUBMIT_MULTI submit_multi; /* message_type = 0x0D */
PDU_SUBMIT_MULTI_RESP submit_multi_resp; /* message_type = 0x0E */
PDU_DELIVER_SM deliver_sm; /* message_type = 0x0F */
PDU_DELIVER_SM_RESP deliver_sm_resp; /* message_type = 0x10 */
PDU_DATA_SM data_sm; /* message_type = 0x11 */
PDU_DATA_SM_RESP data_sm_resp; /* message_type = 0x12 */
PDU_QUERY_SM query_sm; /* message_type = 0x13 */
PDU_QUERY_SM_RESP query_sm_resp; /* message_type = 0x14 */
PDU_CANCEL_SM cancel_sm; /* message_type = 0x15 */
PDU_CANCEL_SM_RESP cancel_sm_resp; /* message_type = 0x16 */
PDU_REPLACE_SM replace_sm; /* message_type = 0x17 */
PDU_REPLACE_SM_RESP replace_sm_resp; /* message_type = 0x18 */
PDU_ENQUIRE_LINK enquire_link; /* message_type = 0x19 */
PDU_ENQUIRE_LINK_RESP enquire_link_resp; /* message_type = 0x1A */
PDU_ALERT_NOTIFICATION alert_notification; /* message_type = 0x1B */
}SMPP_PDU;
typedef struct SMPP_MSG
{
BYTE message_type;
DWORD optional_param_flag1; /* for optional parameter 1~32 */
DWORD optional_param_flag2; /* for optional parameter 33~64 */
SMPP_PDU pdu;
}SMPP_MSG;
typedef struct SMPP_OPTIONAL_PARAMETER
{
WORD tag;
WORD len;
BYTE value[MAX_MSG_SIZE];
}SMPP_OPTIONAL_PARAMETER;
//BYTE smpp_msg_buf[MAX_SMPP_LINK][MAX_PACKET_SIZE];
//int smpp_msg_buf_len[MAX_SMPP_LINK];
#endif

View File

@@ -0,0 +1,62 @@
/*
** CDMA 2000 project, SMPP module
**
** File name: public.h
** Written by Li Long at 2004-11-25
** CVS $Id: public.h,v0.1 2004/11/25 17:03:14 lilong Exp $
**
*/
#ifndef _SMPP_PUBLIC_h
#define _SMPP_PUBLIC_h
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef NULL
#define NULL 0
#endif
#ifndef _T_BYTE
#define _T_BYTE
typedef unsigned char BYTE;
#endif
#ifndef _T_WORD
#define _T_WORD
typedef unsigned short WORD;
#endif
#ifndef _T_DWORD
#define _T_DWORD
typedef unsigned int DWORD;
#endif
#ifndef _T_BOOL
#define _T_BOOL
typedef int BOOL;
#endif
#ifndef SUCCESS
#define SUCCESS (0)
#endif
#ifndef FAILURE
#define FAILURE (-1)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#endif

471
plat/smpp/src/smpp_debug.c Normal file
View File

@@ -0,0 +1,471 @@
/*
** CDMA 2000 project, smpp module
**
** File name: smpp_debug.c
** Written by Li Long at 2004-11-25
** CVS $Id: smpp_debug.c,v0.1 2004/11/25 17:03:14 lilong Exp $
**
*/
#include "./include/smpp.h"
#include "./include/smpp_ext.h"
static char smpp_debug_status = 1;
static WORD disp_page[10];
static char *disp_ptr = (char *) disp_page;
static DWORD smpp_status_id[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,1
};
static DWORD smpp_version_id[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,2
};
static DWORD smpp_ascii_in_id[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,3
};
static DWORD smpp_ascii_out_id[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,4
};
static DWORD smpp_page_title[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,1,1
};
static DWORD smpp_page_line[20] =
{
1,3,6,1,4,1,1373,1,1,2,3,1,2,SMPP_DEBUG_ID+2,1,2,1
};
const static BYTE PAGE_POINT = 14;
const static BYTE LINE_POINT = 15;
const static BYTE BASE_ID_LEN = 15;
static char title1_p[] =
{
" SMPP R9 Page 01 link status (32 links)\n\r\
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
link_status\n\r\
\n\r\
daemon sock\r\n\
tcp_client_flag\r\n\
\r\n\
sock_fd\r\n\
\r\n\
\r\n\
\r\n\
\r\n\
\r\n\
\r\n\
\r\n\
\r\n\
\tLink status:\r\n\
\t\t00 -- Not init\r\n\
\t\t01 -- IDLE\r\n\
\t\t02 -- WAITING\r\n\
\t\t03 -- ESTABLISHED\r\n\
\t\t04 -- SUSPEND"
};
static char title2_p[] =
{
" SMPP R9 Page 02 debug struct (32 links)\n\r\
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
debug_switch\n\r\
link_switch\n\r"
};
static char title3_p[] =
{
" SMPP R9 Page 03 link type (link 0~21)\n\r\
type\t\t00 -- UDP,\t01 -- TCP\n\r\
link 0\n\r\
link 1\n\r\
link 2\n\r\
link 3\n\r\
link 4\n\r\
link 5\n\r\
link 6\n\r\
link 7\n\r\
link 8\n\r\
link 9\n\r\
link 10\n\r\
link 11\n\r\
link 12\n\r\
link 13\n\r\
link 14\n\r\
link 15\n\r\
link 16\n\r\
link 17\n\r\
link 18\n\r\
link 19\n\r\
link 20\n\r\
link 21\n\r"
};
static char title4_p[] =
{
" SMPP R9 Page 04 link type (link 22~31)\n\r\
type\t\t00 -- UDP,\t01 -- TCP\n\r\
link 22\n\r\
link 23\n\r\
link 24\n\r\
link 25\n\r\
link 26\n\r\
link 27\n\r\
link 28\n\r\
link 29\n\r\
link 30\n\r\
link 31\n\r"
};
static char title5_p[] =
{
" SMPP R9 Page 05 server_sock & client_sock\n\r\
\r\n\
server_sock\n\r\
\n\r\
\n\r\
\n\r\
\n\r\
\n\r\
\n\r\
\n\r\
client_sock\n\r\
\n\r"
};
BYTE smpp_disp_line(BYTE page, BYTE line)
{
BYTE disp_length;
disp_length = 16;
disp_ptr = (char *) disp_page;
switch (page)
{
case 1:
switch (line)
{
case 0:
case 1:
disp_ptr = (char *) &smpp_state[disp_page[page]] + (line * 16);
break;
case 2:
disp_ptr = (char *) &(Mysock.DaemonSock);
disp_length = 1;
break;
case 3:
case 4:
disp_ptr = (char *) &smpp_TCPClientFlag[disp_page[page]]+(line-3)*16;
break;
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
disp_ptr = (char *) &(Mysock.Sockets[disp_page[page]]) + ((line-5)*16);
break;
default:
disp_length = 0;
break;
}
break;
case 2: // Page 2: link debug status
if (line == 0)
{
disp_ptr = (char *) &smppDebug.debug_switch;
disp_length = 1;
}
else if (line < 3)
disp_ptr = (char *) &smppDebug.link_switch[disp_page[page]] + ((line - 1) * 16);
else
disp_length = 0;
break;
case 3: //page 3: link type
if (line<22)
{
disp_ptr = (char *) &smpp_param[line].link_type;
disp_length = 1;
}
break;
case 4: //page 3: link type(0~21)
if (line<10)
{
disp_ptr = (char *) &smpp_param[line+22].link_type;
disp_length = 1;
}else
disp_length = 0;
break;
case 5: //page 5: server_socket and client_sockets
switch (line) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
disp_ptr = (char *) &Mysock.server_sock[disp_page[page]] + line*16;
break;
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
disp_ptr = (char *) &Mysock.client_sock[disp_page[page]] + (line-8)*16;
break;
default:
disp_length = 0;
break;
}
break;
default:
disp_length = 0;
break;
}
return disp_length;
}
void smpp_disp_page(BYTE page)
{
BYTE disp_line;
BYTE disp_length;
smpp_page_line[PAGE_POINT] = page + 5;
for (disp_line = 0; disp_line < 22; disp_line++)
{
disp_length = smpp_disp_line(page, disp_line);
smpp_page_line[LINE_POINT] = disp_line + 2;
smpp_page_line[LINE_POINT + 1] = 2; // Data Pointer
debug_set_response(BASE_ID_LEN + 2, smpp_page_line, (BYTE *)disp_ptr, disp_length);
}
}
void smpp_debugInit()
{
int page;
char* ptr;
smppDebug.debug_switch = 0;
debug_set_response(15, smpp_status_id, (BYTE *)&smpp_debug_status, 1);//smpp status
debug_set_response(15, smpp_version_id, (BYTE *)SMPP_MODULE_VERSION, strlen(SMPP_MODULE_VERSION));
debug_set_response(15, smpp_ascii_in_id, (BYTE *)smpp_debug_asciiIn, MAX_ASCIN_BUF_LEN);
debug_set_response(15, smpp_ascii_out_id, (BYTE *)smpp_debug_asciiOut, MAX_ASCOUT_BUF_LEN);
for (page=1; page<=5; page++)
{
switch (page)
{
case 1:
ptr = title1_p;
break;
case 2:
ptr = title2_p;
break;
case 3:
ptr = title3_p;
break;
case 4:
ptr = title4_p;
break;
case 5:
ptr = title5_p;
break;
default:
break;
}
smpp_page_title[PAGE_POINT] = 5 + page;
debug_set_response(BASE_ID_LEN + 1, smpp_page_title, (BYTE *)ptr, strlen(ptr));
smpp_disp_page(page);
}
#ifdef SMPP_DEBUG
printf("smpp debug init.\n");
#endif //end ifdef SMPP_DEBUG
}
void smpp_list_linkparam(int linkNo) {
char debug_str[256];
struct in_addr addr;
if (linkNo >= MAX_SMPP_LINK)
{
smpp_send_error("Link number is too big.\n\r");
return;
}
sprintf(debug_str, "\r\nLink %d parameter:\r\n", linkNo);
smpp_send_ascout(debug_str);
sprintf(debug_str, "link_enable: %d\r\n", smpp_param[linkNo].link_enable);
smpp_send_ascout(debug_str);
sprintf(debug_str, "link_type: %d\r\n", smpp_param[linkNo].link_type);
smpp_send_ascout(debug_str);
sprintf(debug_str, "server_type: %d\r\n", smpp_param[linkNo].server_type);
smpp_send_ascout(debug_str);
sprintf(debug_str, "session_type: %d\r\n", smpp_param[linkNo].session_type);
smpp_send_ascout(debug_str);
sprintf(debug_str, "system_id: %s\r\n", smpp_param[linkNo].sys_id);
smpp_send_ascout(debug_str);
sprintf(debug_str, "password: %s\r\n", smpp_param[linkNo].password);
smpp_send_ascout(debug_str);
sprintf(debug_str, "system_type: %s\r\n", smpp_param[linkNo].system_type);
smpp_send_ascout(debug_str);
sprintf(debug_str, "localGTT: %s\r\n", smpp_param[linkNo].localGTT);
smpp_send_ascout(debug_str);
sprintf(debug_str, "remoteGTT: %s\r\n", smpp_param[linkNo].remoteGTT);
smpp_send_ascout(debug_str);
addr.s_addr = smpp_param[linkNo].local_ip;
sprintf(debug_str, "local_ip: %s\r\n", inet_ntoa(addr));
smpp_send_ascout(debug_str);
addr.s_addr = smpp_param[linkNo].remote_ip;
sprintf(debug_str, "remote_ip: %s\r\n", inet_ntoa(addr));
smpp_send_ascout(debug_str);
sprintf(debug_str, "session_init_timer: %u\r\n", smpp_param[linkNo].session_init_timer);
smpp_send_ascout(debug_str);
sprintf(debug_str, "enquire_link_timer: %u\r\n", smpp_param[linkNo].enquire_link_timer);
smpp_send_ascout(debug_str);
sprintf(debug_str, "inactivity_timer: %u\r\n", smpp_param[linkNo].inactivity_timer);
smpp_send_ascout(debug_str);
sprintf(debug_str, "response_timer: %u\r\n", smpp_param[linkNo].response_timer);
smpp_send_ascout(debug_str);
sprintf(debug_str, "service_number: %s\r\n", smpp_param[linkNo].service_number);
smpp_send_ascout(debug_str);
sprintf(debug_str, "localSSN: %d\r\n", smpp_param[linkNo].localSSN);
smpp_send_ascout(debug_str);
sprintf(debug_str, "remoteSSN: %d\r\n", smpp_param[linkNo].remoteSSN);
smpp_send_ascout(debug_str);
}
void smpp_debugTimer()
{
int i, linkNo = 0;
char debugBuf[1024];
if (strlen(smpp_debug_asciiIn) > 0)
{
if (strcmp(smpp_debug_asciiIn+1, "help") == 0)
{
smpp_send_ascout("SMPP Debug Monitor Help:\n\r\n\r");
smpp_send_ascout("log none Turn off all log items\n\r");
smpp_send_ascout("log all Turn on all log items\n\r");
smpp_send_ascout("log link=\x1b[34mxx\x1b[0m on/off Turn on/off link x messages\n\r");
smpp_send_ascout("list par.\x1b[34mxx\x1b[0m List link x parameter\r\n");
sprintf(debugBuf, "ver. %s T%03d\r\n",SMPP_MODULE_VERSION,SMPP_MODULE_PATCH);
smpp_send_ascout(debugBuf);
}else if (strcmp(smpp_debug_asciiIn+1, "log none") == 0)
{
smppDebug.debug_switch = 0;
for (i=0; i<MAX_SMPP_LINK; i++)
{
smppDebug.link_switch[i] = 0;
}
smpp_send_ascout("smpp turn off all log items.\n\r");
}
else if (strcmp(smpp_debug_asciiIn+1, "log all") == 0) {
smppDebug.debug_switch = 1;
smpp_send_ascout("smpp turn on all log items.\n\r");
}
else if (strncmp(smpp_debug_asciiIn+1, "list par.", 9) == 0) {
if ((smpp_debug_asciiIn[10] >= '0') && (smpp_debug_asciiIn[10] <= '9')) {
linkNo = smpp_debug_asciiIn[10] - '0';
if ((smpp_debug_asciiIn[11] >= '0') && (smpp_debug_asciiIn[11] <= '9')) {
linkNo = linkNo*10+(smpp_debug_asciiIn[11]-'0');
// if (linkNo > MAX_SMPP_LINK)
// smpp_send_error("Link number is too big.\n\r");
smpp_list_linkparam(linkNo);
}
else
smpp_list_linkparam(linkNo);
}
else
smpp_send_error("Link number is error");
}
else if (strncmp(smpp_debug_asciiIn+1, "save", 4) == 0) {
smpp_writeParam();
}
else if (strncmp(smpp_debug_asciiIn+1, "log link=", 9) == 0) {
if ((smpp_debug_asciiIn[10] >= '0') && (smpp_debug_asciiIn[10] <= '9'))
{
linkNo = smpp_debug_asciiIn[10] - '0';
if ((smpp_debug_asciiIn[11] >= '0') && (smpp_debug_asciiIn[11] <= '9'))
{
linkNo = linkNo*10+(smpp_debug_asciiIn[11]-'0');
if (linkNo > MAX_SMPP_LINK)
{
smpp_send_error("Link number is too big.\n\r");
}
else if (strncmp(smpp_debug_asciiIn+13, "on", 2) == 0)
{
smppDebug.link_switch[linkNo] = 1;
sprintf(debugBuf, "Link %d debug on.\n\r", linkNo);
smpp_send_ascout(debugBuf);
}else if (strncmp(smpp_debug_asciiIn+13, "off", 3) == 0)
{
smppDebug.link_switch[linkNo] = 0;
sprintf(debugBuf, "Link %d debug off.\n\r", linkNo);
smpp_send_ascout(debugBuf);
}else
{
smpp_send_error("Command Error.\n\r");
}
}else if (strncmp(smpp_debug_asciiIn+12, "on", 2) == 0)
{
smppDebug.link_switch[linkNo] = 1;
sprintf(debugBuf, "Link %d debug on.\n\r", linkNo);
smpp_send_ascout(debugBuf);
}else if (strncmp(smpp_debug_asciiIn+12, "off", 3) == 0)
{
smppDebug.link_switch[linkNo] = 0;
sprintf(debugBuf, "Link %d debug off.\n\r", linkNo);
smpp_send_ascout(debugBuf);
}else
{
smpp_send_error("Command Error.\n\r");
}
}
else
smpp_send_error("Link number error.\n\r");
}else
{
smpp_send_error("Command Error.\n\r");
}
smpp_debug_asciiIn[0] = '\0';
}
}
void smpp_send_ascout(char *sdBuf)
{
if (strlen(sdBuf)+strlen(smpp_debug_asciiOut) < MAX_ASCOUT_BUF_LEN)
{
strcat(smpp_debug_asciiOut, sdBuf);
}
}
void smpp_send_error(char *sdBuf)
{
if (smppDebug.debug_switch == 1)
{
smpp_send_ascout("\x1b[31m");
smpp_send_ascout(sdBuf);
smpp_send_ascout("\x1b[0m");
}
}

676
plat/smpp/src/smpp_fsm.c Normal file
View File

@@ -0,0 +1,676 @@
/*
** CDMA 2000 project, SMPP module
**
** File name: smpp_fsm.c
** Written by Li Long at 2004-11-25
** CVS $Id: smpp_fsm.c,v0.1 2004/11/25 17:03:14 lilong Exp $
**
*/
#include "./include/smpp.h"
#include "./include/smpp_ext.h"
// fix multiple definition====================================
extern int smpp_msg_buf_len[MAX_SMPP_LINK];
//
static int smpp_timerCount = 0;
//static int flag=-1;
/* Timer variable definitions. */
static BYTE session_init_flag[MAX_SMPP_LINK];
static WORD session_init_timer[MAX_SMPP_LINK];
static BYTE enquire_link_flag[MAX_SMPP_LINK];
static WORD enquire_link_timer[MAX_SMPP_LINK];
static BYTE inactivity_flag[MAX_SMPP_LINK];
static WORD inactivity_timer[MAX_SMPP_LINK];
static BYTE response_flag[MAX_SMPP_LINK];
static WORD response_timer[MAX_SMPP_LINK];
static BYTE init_tcp_client_timeout[MAX_SMPP_LINK]={0};
static WORD suspend_timer = 0;
void smpp_stateInit()
{
int i;
for (i=0; i<MAX_SMPP_LINK; i++)
{
session_init_flag[i] = 0;
enquire_link_flag[i] = 0;
inactivity_flag[i] = 0;
response_flag[i] = 0;
session_init_timer[i] = 0;
enquire_link_timer[i] = 0;
inactivity_timer[i] = 0;
response_timer[i] = 0;
smpp_state[i] = 0;
smpp_msg_buf_len[i] = 0;
if (i<MAX_SMPP_LINK/4)
{
smpp_hearbeat_status[i] = 0;
}
memset(exterEvent[i], 0, CMD_BUF_SIZE);
memset(interEvent[i], 0, CMD_BUF_SIZE);
inter_head[i] = 0;
inter_tail[i] = 0;
exter_head[i] = 0;
exter_tail[i] = 0;
}
}
void smpp_fsm_new()
{
int link;
char debugBuf[256];
BYTE temp_status;
BYTE platform_heartbeat_len;
if(smpp_timerCount++>1000)//1000*10ms=10s
{
smpp_checkParam();
smpp_timerCount = 0;
}
smpp_rvMsgOverTCP();
// smpp_rvMsgOverSCCP(SMPP_PPS_USERTYPE);
smpp_rvMsgOverSCCP(SMPP_SMSC_USERTYPE);
smpp_debugTimer();
for(link=0; link<MAX_SMPP_LINK; link++)
{
if ((smpp_param[link].link_enable&0x01) == 0) continue;
// printf("link %d tcp client flag =%d, Mysock.Sockets[%d] = %d\n",
// link, smpp_TCPClientFlag[link],
// link, Mysock.Sockets[link]);
if ((smpp_TCPClientFlag[link] == TRUE) && (Mysock.Sockets[link] == 0) && (init_tcp_client_timeout[link] == 0) ) {
// printf("link %d start TCP connect.\n", link);
smpp_tcp_connect(link);
init_tcp_client_timeout[link] = 200;
continue;
}
if (init_tcp_client_timeout[link] > 0) init_tcp_client_timeout[link]--;
/* Session init timer */
if (TRUE == session_init_flag[link])
{
session_init_timer[link]++;
if (session_init_timer[link] > 100*smpp_param[link].session_init_timer)
{
session_init_timer[link] = 0;
inter_head[link] = (inter_head[link]+1)&0x7;
interEvent[link][inter_head[link]] = SessionInitTimeout;
#ifdef SMPP_DEBUG
if ((smppDebug.debug_switch == 1) || (smppDebug.link_switch[link] == 1))
{
sprintf(debugBuf, "link %d session_init_timer TIMEOUT.\n", link);
smpp_send_ascout(debugBuf);
}
#endif
}
}
/* Enquire link timer */
if (TRUE == enquire_link_flag[link])
{
enquire_link_timer[link]++;
if (enquire_link_timer[link] > 100*smpp_param[link].enquire_link_timer)
{
enquire_link_timer[link] = 0;
inter_head[link] = (inter_head[link]+1)&0x7;
interEvent[link][inter_head[link]] = EnquireLinkTimeout;
#ifdef SMPP_DEBUG
if ((smppDebug.debug_switch == 1) || (smppDebug.link_switch[link] == 1))
{
sprintf(debugBuf, "link %d T1 (Enquire link timer) TIMEOUT.\n", link);
smpp_send_ascout(debugBuf);
}
#endif
}
}
/* Inactivity timer */
if (TRUE == inactivity_flag[link])
{
inactivity_timer[link]++;
if (inactivity_timer[link] > 100*smpp_param[link].inactivity_timer)
{
inactivity_timer[link] = 0;
inter_head[link] = (inter_head[link]+1)&0x7;
interEvent[link][inter_head[link]] = InactivityTimeout;
#ifdef SMPP_DEBUG
if ((smppDebug.debug_switch == 1) || (smppDebug.link_switch[link] == 1))
{
sprintf(debugBuf, "link %d T2 (Inactivity timer) TIMEOUT.\n", link);
smpp_send_ascout(debugBuf);
}
#endif
}
}
}
for(link=0; link<MAX_SMPP_LINK; link++)
{
if (linkAttachFlag[link] == FALSE) continue;
if ( (Mysock.Sockets[link] <= 0) && (SMPP_TCP == smpp_param[link].link_type) )
continue;
switch(smpp_state[link])
{
case INIT:
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
/*
if (exterEvent[link][exter_tail[link]] > 0)
{
if (TRUE == linkUseFlag[link])
smpp_state[link] = IDLE;
}
*/
break;
case IDLE:
//IDLE state:: external event start.
switch (exterEvent[link][exter_tail[link]]) {
case Setup:
switch (smpp_param[link].server_type) {
case SMPP_SERVER:
switch (smpp_param[link].session_type) {
case BIND_RX:
smpp_state[link] = WAITING;
smpp_PrimitiveSend(link, Outbind);
session_init_flag[link] = TRUE;
//flag = 2;
//smpp_state[link] = WAITING;//ch:if smpp_PrimitiveSend failed,that would be error
temp_status = WAITING;//ch:if smpp_PrimitiveSend failed,that would be error
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
/*
case BIND_TRX:
smpp_PrimitiveSend(link, BindTransceiver);
session_init_flag[link] = TRUE;
flag = 1;
smpp_state[link] = WAITING;
temp_status = WAITING;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
*/
default:
break;
}
break;
case SMPP_CLIENT:
switch (smpp_param[link].session_type) {
case BIND_TX:
smpp_state[link] = WAITING;
smpp_PrimitiveSend(link, BindTransmitter);
session_init_flag[link] = TRUE;
//flag = 1;
//smpp_state[link] = WAITING;
temp_status = WAITING;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
/*
case BIND_RX:
smpp_PrimitiveSend(link, BindReceiver);
session_init_flag[link] = TRUE;
flag = 0;
smpp_state[link] = WAITING;
temp_status = WAITING;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
*/
case BIND_TRX:
smpp_state[link] = WAITING;
smpp_PrimitiveSend(link, BindTransceiver);
session_init_flag[link] = TRUE;
//flag = 1;
//smpp_state[link] = WAITING;
temp_status = WAITING;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
default:
break;
}
break;
default:
break;
}
break;
default:
break;
}
exterEvent[link][exter_tail[link]] = 0;
exter_tail[link] = (exter_tail[link]+1)&0x7;
//IDLE state:: external event end.
//IDLE state:: internal event start.
switch (interEvent[link][inter_tail[link]]) {
case Outbind:
smpp_state[link] = WAITING;
smpp_PrimitiveSend(link, BindReceiver);
session_init_flag[link] = TRUE;
//flag = 0;
//smpp_state[link] = WAITING;
temp_status = WAITING;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case BindTransmitter:
smpp_state[link] = ESTABLISHED;
smpp_PrimitiveSend(link, BindTransmitterResp);
enquire_link_flag[link] = TRUE;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
break;
case BindTransceiver:
smpp_state[link] = ESTABLISHED;
smpp_PrimitiveSend(link, BindTransceiverResp);
enquire_link_flag[link] = TRUE;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
break;//fixed 2008-1-11
case BindReceiver:
smpp_state[link] = ESTABLISHED;
smpp_PrimitiveSend(link, BindReceiverResp);
session_init_flag[link] = FALSE;
enquire_link_flag[link] = TRUE;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
break;
default:
break;
}
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
//IDLE state:: internal event end.
break;
case WAITING:
switch (exterEvent[link][exter_tail[link]]) {
case Close:
smpp_state[link] = IDLE;
temp_status = IDLE;
dst_ref[link] = 0;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
default:
break;
}
exterEvent[link][exter_tail[link]] = 0;
exter_tail[link] = (exter_tail[link]+1)&0x7;
//WAITING state:: external event end.
//WAITING state:: Internal event start.
switch (interEvent[link][inter_tail[link]])
{
case SessionInitTimeout:
session_init_flag[link] = FALSE;
smpp_state[link] = IDLE;
temp_status = IDLE;
dst_ref[link] = 0;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case BindReceiverResp:
//if (0 == flag) {
session_init_flag[link] = FALSE;
enquire_link_flag[link] = TRUE;
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
/*
}
else
smpp_state[link] = WAITING;
*/
break;
case BindTransmitterResp:
case BindTransceiverResp:
//if (1 == flag) {
session_init_flag[link] = FALSE;
enquire_link_flag[link] = TRUE;
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
/*
}
else
smpp_state[link] = WAITING;
*/
break;
case BindReceiver:
//if (2 == flag) {
smpp_PrimitiveSend(link, BindReceiverResp);
session_init_flag[link] = FALSE;
enquire_link_flag[link] = TRUE;
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,TRUE);
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
return;
/*
}
else
smpp_state[link] = WAITING;
*/
break;
default:
break;
}
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
//WAITING state:: internal event end.
break;
case ESTABLISHED:
switch (exterEvent[link][exter_tail[link]])
{
case Close:
smpp_state[link] = SUSPEND;
smpp_PrimitiveSend(link, Unbind);
//smpp_state[link] = SUSPEND;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
default:
break;
}
exterEvent[link][exter_tail[link]] = 0;
exter_tail[link] = (exter_tail[link]+1)&0x7;
//ESTABLISHED state:: external event end.
//ESTABLISHED state:: internal event start.
switch (interEvent[link][inter_tail[link]])
{
//normal messages
case Unbind:
smpp_PrimitiveSend(link, UnbindResp);
dst_ref[link] = 0;
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
return;
break;
case SubmitSM:
case SubmitSMResp:
case SubmitMulti:
case SubmitMultiResp:
case DeliverSM:
case DeliverSMResp:
case DataSM:
case DataSMResp:
case QuerySM:
case QuerySMResp:
case CancelSM:
case CancelSMResp:
case ReplaceSM:
case ReplaceSMResp:
enquire_link_timer[link] = 0;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case EnquireLinkTimeout:
smpp_state[link] = ESTABLISHED;
smpp_PrimitiveSend(link, EnquireLink);
inactivity_flag[link] = TRUE;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case EnquireLink:
smpp_state[link] = ESTABLISHED;
smpp_PrimitiveSend(link, EnquireLinkResp);
enquire_link_timer[link] = 0;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case EnquireLinkResp:
enquire_link_timer[link] = 0;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case InactivityTimeout:
//smpp_PrimitiveSend(link, Unbind);
//smpp_state[link] = SUSPEND;
dst_ref[link] = 0;
if (smpp_param[link].link_type == SMPP_TCP)
{
smpp_closeTCPConnection(link);
}
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
return;
break;
/* error handing messages */
case BindTransmitter:
smpp_state[link] = ESTABLISHED;
// smpp_sendBindResp(link, BindTransmitterResp, ESME_RALYBND);
smpp_sendBindResp(link, BindTransmitterResp, 0);
enquire_link_timer[link] = 0;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case BindReceiver:
smpp_state[link] = ESTABLISHED;
// smpp_sendBindResp(link, BindReceiverResp, ESME_RALYBND);
smpp_sendBindResp(link, BindReceiverResp, 0);
enquire_link_timer[link] = 0;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case BindTransceiver:
smpp_state[link] = ESTABLISHED;
// smpp_sendBindResp(link, BindTransceiverResp, ESME_RALYBND);
smpp_sendBindResp(link, BindTransceiverResp, 0);
enquire_link_timer[link] = 0;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
//smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
default:
smpp_state[link] = ESTABLISHED;
temp_status = ESTABLISHED;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
}
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
//ESTABLISHED state:: internal event end.
break;
case SUSPEND:
//SUSPEND state:: internal event start.
suspend_timer ++;
switch (interEvent[link][inter_tail[link]])
{
case UnbindResp:
suspend_timer = 0;
dst_ref[link] = 0;
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
return;
break;
/* case InactivityTimeout://ch
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
dst_ref[link] = 0;
if (smpp_param[link].link_type == SMPP_TCP)
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break;
case SessionInitTimeout://ch
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
dst_ref[link] = 0;
if (smpp_param[link].link_type == SMPP_TCP)
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
break; */
default:
break;
}
interEvent[link][inter_tail[link]] = 0;
inter_tail[link] = (inter_tail[link]+1)&0x7;
if( suspend_timer++ > smpp_param[link].inactivity_timer)
{
suspend_timer = 0;
dst_ref[link] = 0;
if (smpp_param[link].link_type == SMPP_TCP)
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
return;
}
//SUSPEND state:: internal event end.
break;
default:
break;
} //end switch(state)
} //end for(froc...
//platform heartbeat
platform_heartbeat_len = (MAX_SMPP_LINK%4)?(MAX_SMPP_LINK/4+1):(MAX_SMPP_LINK/4);
set_status(SMPP_HEARTBEAT_COMPONENT_ID, platform_heartbeat_len, smpp_hearbeat_status);
}
void init_link(u32 link)
{
BYTE temp_status;
dst_ref[link] = 0;
smpp_closeTCPConnection(link);
enquire_link_flag[link] = FALSE;
inactivity_flag[link] = FALSE;
inactivity_timer[link] = 0;
smpp_state[link] = IDLE;
temp_status = IDLE;
temp_status = temp_status<<((link%4)*2);
smpp_hearbeat_status[link/4] |= temp_status;
if(callBackFunc[link].link_proc!= NULL)
callBackFunc[link].link_proc(link,FALSE);
return;
}

1204
plat/smpp/src/smpp_func.c Normal file

File diff suppressed because it is too large Load Diff

819
plat/smpp/src/smpp_mib.c Normal file
View File

@@ -0,0 +1,819 @@
/*
** CDMA 2000 project, SMPP module
**
** File name: smpp_mib.c
** Written by Li Long at 2004-12-6
** CVS $Id: smpp_mib.c,v0.1 2004-12-6 17:03:14 lilong Exp $
**
*/
#include "./include/smpp.h"
#include "./include/smpp_ext.h"
#include "../../../plat/snmp/src/include/macro.h"
void smpp_mibInit();
int smpp_setMib(BYTE oidlen, DWORD *oid, BYTE *pData,WORD datalen);
int smpp_getMib(BYTE oidlen, DWORD *oid, BYTE *pData,BYTE *vartype);
int smpp_get_system(u32 column, u32 *instance, u8 *pdata, u8 *vartype);
int smpp_set_system(u32 column, u32 *instance, u8 *pdata, u16 datalen);
int smpp_get_link(u32 column, u32 *instance, u8 *pdata, u8 *vartype);
int smpp_set_link(u32 column, u32 *instance, u8 *pdata, u16 datalen);
int smpp_getnext_link(u32 *instance);
int smpp_enable_link();
static u8 smpp_param_flag=0;//0:unchange 1:changed
/*
void smpp_set_smsc_param(BYTE *ptr, DWORD linkNo) {
DWORD smpp_param_oid[20] = {1,3,6,1,4,1,1373,1,3,3,5,2,2};
smpp_param_oid[13] = linkNo;
smpp_param_oid[14] = 0;
set_response(15, smpp_param_oid, ptr, 25);
}
*/
int smpp_setMib(BYTE oidlen, DWORD *oid, BYTE *pData,WORD datalen)
{
BYTE len = 0;
DWORD instance;
SMPP_PARAM *pParam;
smpp_param_flag = 1;
switch(oid[SMPP_OIDLEN]) {
case 1: //Mesurement
return (-1);
case 2: //Configuration
instance = oid[SMPP_OIDLEN+2];
if (instance > MAX_SMPP_LINK) return -1;
pParam = &smpp_param[instance];
switch(oid[SMPP_OIDLEN+1]) {
case 1:
pParam->link_enable = pData[0];
len = 1;
//link type
pParam->link_type = pData[1];
len += 1;
//server type
pParam->server_type = pData[2];
len += 1;
//session type
pParam->session_type = pData[3];
len += 1;
//system id
memset(pParam->sys_id, 0, SMPP_SYSID_LEN); //16
memcpy(pParam->sys_id, pData+len, SMPP_SYSID_LEN);
pParam->sys_id[SMPP_SYSID_LEN] = '\0';
len += SMPP_SYSID_LEN;
//password
memset(pParam->password, 0, SMPP_PASSWD_LEN); //9
memcpy(pParam->password, pData+len, SMPP_PASSWD_LEN);
pParam->password[SMPP_PASSWD_LEN] = '\0';
len += SMPP_PASSWD_LEN;
//system type
memset(pParam->system_type, 0, SMPP_SYSTYPE_LEN); //13
memcpy(pParam->system_type, pData+len, SMPP_SYSTYPE_LEN);
pParam->system_type[SMPP_SYSTYPE_LEN] = '\0';
len += SMPP_SYSTYPE_LEN;
//local gtt
memset(pParam->localGTT, 0, SMPP_GTT_LEN); //16
memcpy(pParam->localGTT, pData+len, SMPP_GTT_LEN);
pParam->localGTT[SMPP_GTT_LEN] = '\0';
len += SMPP_GTT_LEN;
//remote gtt
memset(pParam->remoteGTT, 0, SMPP_GTT_LEN);
memcpy(pParam->remoteGTT, pData+len, SMPP_GTT_LEN);
pParam->remoteGTT[SMPP_GTT_LEN] = '\0';
len += SMPP_GTT_LEN;
//local ip
memcpy(&pParam->local_ip, pData+len, 4);
len += 4;
//remote ip
memcpy(&pParam->remote_ip, pData+len, 4);
len += 4;
//session init timer
pParam->session_init_timer = bcdtou32(pData+len, 4);
len += 4;
// enquire link timer
pParam->enquire_link_timer = bcdtou32(pData+len, 4);
len += 4;
//inactivity timer
pParam->inactivity_timer = bcdtou32(pData+len, 4);
len += 4;
//response timer
pParam->response_timer = bcdtou32(pData+len, 4);
len += 4;
//remote service number
memset(pParam->service_number, 0, 8);
memcpy(pParam->service_number, pData+len, 8);
len += 8;
pParam->localSSN = pData[len];
len += 1;
pParam->remoteSSN = pData[len];
len += 1;
break;
default:
return (-1);
}
break;
case 3: //Status
switch (oid[SMPP_OIDLEN + 1]) {
case 1: //version, read only
return -1;
case 2: //command
switch (pData[0]) {
case 0: //reset
smpp_reset();
break;
case 1: //load
smpp_loadParam();
break;
case 2: //save
smpp_writeParam();
break;
}
return 1;
case 3: //status, read only
return -1;
}
break;
default:
break;
}
return datalen;
}
int smpp_getMib(BYTE oidlen, DWORD *oid, BYTE *pData, BYTE *vartype)
{
int len=0, datalen = -1;
DWORD instance;
SMPP_PARAM *pParam;
switch(oid[SMPP_OIDLEN])
{
case 1: //Measurement
break;
case 2: //Configuration
instance = oid[SMPP_OIDLEN+2];
if (instance > MAX_SMPP_LINK) return -1;
pParam = &smpp_param[instance];
switch(oid[SMPP_OIDLEN+1])
{
case 1: //smpp parameter
//link enable
pData[0] = pParam->link_enable;
len = 1;
//link type
pData[1] = pParam->link_type;
len += 1;
//server type
pData[2] = pParam->server_type;
len += 1;
//session type
pData[3] = pParam->session_type;
len += 1;
//system id
memcpy(pData+len, pParam->sys_id, SMPP_SYSID_LEN);
len += SMPP_SYSID_LEN;
//password
memcpy(pData+len, pParam->password, SMPP_PASSWD_LEN);
len += SMPP_PASSWD_LEN;
//system type
memcpy(pData+len, pParam->system_type, SMPP_SYSTYPE_LEN);
len += SMPP_SYSTYPE_LEN;
//local gtt
memcpy(pData+len, pParam->localGTT, SMPP_GTT_LEN);
len += SMPP_GTT_LEN;
//remote gtt
memcpy(pData+len, pParam->remoteGTT, SMPP_GTT_LEN);
len += SMPP_GTT_LEN;
//local ip
memcpy(pData+len, &pParam->local_ip, 4);
len += 4;
//remote ip
memcpy(pData+len, &pParam->remote_ip, 4);
len += 4;
//session init timer
u32tobyte(pData+len, pParam->session_init_timer);
len += 4;
//enquire link timer
u32tobyte(pData+len, pParam->enquire_link_timer);
len += 4;
//inactivity timer
u32tobyte(pData+len, pParam->inactivity_timer);
len += 4;
//response timer
u32tobyte(pData+len, pParam->response_timer);
len += 4;
//remote service number
memcpy(pData+len, &pParam->service_number, 8);
len += 8;
pData[len] = pParam->localSSN;
len += 1;
pData[len] = pParam->remoteSSN;
len += 1;
*vartype = 4;
datalen = len;
break;
default:
break;
}
break;
case 3: //Status
break;
default:
break;
}
return datalen;
}
int smpp_parseLine(char *str, char (*row)[128], int maxrow)
{
char *pstr = str;
int len, index = 0, i;
BOOL black = 0;
len = strlen(str);
for(i = 0; i < len && index < maxrow; i++)
{
if(isspace(str[i]))
{
if(black == 0)
pstr = str + i + 1;
else
{
str[i] = '\0';
if(strlen(pstr) > 128)
pstr[127] = 0;
sprintf(row[index++], "%s", pstr);
pstr = str + i + 1;
}
black = 0;
}
else
black = 1;
}
if(black == 1)
{
if(strlen(pstr) > 128)
pstr[127] = 0;
sprintf(row[index++], "%s", pstr);
}
return index;
}
int smpp_loadParam()
{
FILE *fp;
char str[512] = "\0", *pChr;
char info[19][128];
int rtn;
int ver[3];
BYTE linkNo;
fp = fopen(SMPP_CONF_FILE, "r");
if (fp == NULL)
{
printf("SMPP init parameters....search %s FAILED\n",SMPP_CONF_FILE);
return FAILURE;
}
while (fgets(str, 512, fp) != NULL) {
if ((pChr = strchr(str, '#')) != NULL) {
if((pChr = strstr(pChr,"SMPP Config file"))!=NULL)
{
if ((pChr = strchr(pChr, 'R')) != NULL)
{
ver[0] = atoi(pChr+1);
ver[1] = atoi(pChr+3);
ver[2] = atoi(pChr+5);
}
}
continue;
}
rtn = smpp_parseLine(str, info, 19);
if (rtn < 17) {
//smpp_debug(SCCPDB_ERR, "<001>Invalid line in Local_Node Table, field count = %d", rtn);
printf("Invalid line in ./conf/smpp.conf table, field count = %d\n", rtn);
return FALSE;
}
else if(rtn < 19)
{
sprintf(info[17],"0");
sprintf(info[18],"0");
}
linkNo = atoi(info[0]);
smpp_param[linkNo].link_enable = atoi(info[1]);
smpp_param[linkNo].link_type = atoi(info[2]);
smpp_param[linkNo].server_type = atoi(info[3]);
smpp_param[linkNo].session_type = atoi(info[4]);
if (strncmp(info[5], "--", 2) == 0)
strcpy(smpp_param[linkNo].sys_id, "");
else
sprintf(smpp_param[linkNo].sys_id, "%s", info[5]);
if (strncmp(info[6], "--", 2) == 0)
strcpy(smpp_param[linkNo].password, "");
else
sprintf(smpp_param[linkNo].password, "%s", info[6]);
if (strncmp(info[7], "--", 2) == 0)
strcpy(smpp_param[linkNo].system_type, "");
else
sprintf(smpp_param[linkNo].system_type, "%s", info[7]);
if (strncmp(info[8], "--", 2) == 0)
strcpy(smpp_param[linkNo].localGTT, "");
else
sprintf(smpp_param[linkNo].localGTT, "%s", info[8]);
if (strncmp(info[9], "--", 2) == 0)
strcpy(smpp_param[linkNo].remoteGTT, "");
else
sprintf(smpp_param[linkNo].remoteGTT, "%s", info[9]);
smpp_param[linkNo].local_ip = inet_addr(info[10]);
smpp_param[linkNo].remote_ip = inet_addr(info[11]);
smpp_param[linkNo].session_init_timer = atol(info[12]);
smpp_param[linkNo].enquire_link_timer = atol(info[13]);
smpp_param[linkNo].inactivity_timer = atol(info[14]);
smpp_param[linkNo].response_timer = atol(info[15]);
if (strncmp(info[16], "--", 2) == 0)
strcpy(smpp_param[linkNo].service_number, "");
else
sprintf(smpp_param[linkNo].service_number, "%s", info[16]);
smpp_param[linkNo].localSSN = atoi(info[17]);
smpp_param[linkNo].remoteSSN = atoi(info[18]);
if(ver[2] == 1)
if(smpp_param[linkNo].link_enable & 0x01)
smpp_param[linkNo].link_enable = 0x81;
/*
printf("link %d: link_enable=%d, link_type=%d; session_type=%d; sys_id=%s; password=%s; \
system_type=%s; localGTT=%s; retmoteGTT=%s; local_ip=%s; remote ip=%s; \
session init timer=%d; enquire link timer=%d; inactivity timer=%d; response timer=%d \
remote service number: %s\n",
linkNo, smpp_param[linkNo].link_enable, smpp_param[linkNo].link_type, smpp_param[linkNo].session_type, smpp_param[linkNo].sys_id, smpp_param[linkNo].password,
smpp_param[linkNo].system_type, smpp_param[linkNo].localGTT, smpp_param[linkNo].remoteGTT, info[8], info[9],
smpp_param[linkNo].session_init_timer, smpp_param[linkNo].enquire_link_timer, smpp_param[linkNo].inactivity_timer, smpp_param[linkNo].response_timer,
smpp_param[linkNo].service_number
);
*/
}
fclose(fp);
return TRUE;
}
int smpp_writeParam()
{
FILE *fp;
int i;
struct in_addr addr;
if((fp = fopen(SMPP_CONF_FILE,"w")) == NULL)
return FAILURE;
fprintf(fp,"#SMPP Config file (%s)\n",SMPP_MODULE_VERSION);
fprintf(fp,"#Copy this file to ./conf/smpp.conf to set global options\n");
fprintf(fp,"#No lkEn lkType serverType sessionType sysID pwd sysType LGTT RGTT LIP RIP sessionTimer enqTimer inactTimer rspTimer ServiceNum localSSN remoteSSN\n");
for(i=0; i< MAX_SMPP_LINK; i++)
{
fprintf(fp,"%d ", i);
fprintf(fp,"%d ", smpp_param[i].link_enable);
fprintf(fp,"%d ", smpp_param[i].link_type);
fprintf(fp,"%d ", smpp_param[i].server_type);
fprintf(fp,"%d ", smpp_param[i].session_type);
if (smpp_param[i].sys_id[0] == 0)
strcpy(smpp_param[i].sys_id, "--");
fprintf(fp,"%s ", smpp_param[i].sys_id);
if (smpp_param[i].password[0] == 0)
strcpy(smpp_param[i].password, "--");
fprintf(fp,"%s ", smpp_param[i].password);
if (smpp_param[i].system_type[0] == 0)
fprintf(fp,"%s ", "--");
else
fprintf(fp,"%s ", smpp_param[i].system_type);
if (smpp_param[i].localGTT[0] == 0)
strcpy(smpp_param[i].localGTT, "--");
fprintf(fp,"%s ", smpp_param[i].localGTT);
if (smpp_param[i].remoteGTT[0] == 0)
strcpy(smpp_param[i].remoteGTT, "--");
fprintf(fp,"%s ", smpp_param[i].remoteGTT);
addr.s_addr = smpp_param[i].local_ip;
fprintf(fp,"%s ", inet_ntoa(addr));
addr.s_addr = smpp_param[i].remote_ip;
fprintf(fp,"%s ", inet_ntoa(addr));
fprintf(fp,"%u ", smpp_param[i].session_init_timer);
fprintf(fp,"%u ", smpp_param[i].enquire_link_timer);
fprintf(fp,"%u ", smpp_param[i].inactivity_timer);
fprintf(fp,"%u ", smpp_param[i].response_timer);
if (smpp_param[i].service_number[0] == 0)
strcpy(smpp_param[i].service_number, "--");
fprintf(fp, "%s ", smpp_param[i].service_number);
fprintf(fp,"%d ", smpp_param[i].localSSN);
fprintf(fp,"%d\n", smpp_param[i].remoteSSN);
}
fclose(fp);
return TRUE;
}
void smpp_checkParam()
{
if(smpp_param_flag)
{
smpp_writeParam();
smpp_param_flag=0;
}
}
int smpp_enable_link()
{
int i;
for (i=0; i<MAX_SMPP_LINK; i++)
{
if ((smpp_param[i].link_enable&0x80)==0)
{
smpp_param[i].link_enable = 0x80;
memset(smpp_param[i].service_number,0,8);
smpp_param[i].link_type = SMPP_UDP;
smpp_param[i].server_type = SMPP_CLIENT;
smpp_param[i].session_type = BIND_TX;
memset(smpp_param[i].sys_id,0,SMPP_SYSID_LEN);
memset(smpp_param[i].password,0,SMPP_PASSWD_LEN);
memset(smpp_param[i].system_type,0,SMPP_SYSTYPE_LEN);
memset(smpp_param[i].localGTT,0,SMPP_GTT_LEN);
memset(smpp_param[i].remoteGTT,0,SMPP_GTT_LEN);
strcpy(smpp_param[i].sys_id,"--");
strcpy(smpp_param[i].password,"--");
strcpy(smpp_param[i].system_type, "--");
sprintf(smpp_param[i].localGTT,"%s","--");
sprintf(smpp_param[i].remoteGTT,"%s","--");
strcpy(smpp_param[i].service_number, "--");
smpp_param[i].local_ip = 0;
smpp_param[i].remote_ip = 0;
smpp_param[i].session_init_timer = 5;
smpp_param[i].enquire_link_timer = 10;
smpp_param[i].inactivity_timer = 5;
smpp_param[i].response_timer = 5;
smpp_param[i].localSSN = 0;
smpp_param[i].remoteSSN = 0;
return i;
}
}
return -1;
}
int smpp_getnext_link(u32 *instance)
{
int i;
for (i=*instance; i<MAX_SMPP_LINK; i++)
{
if (smpp_param[i].link_enable&0x80)
{
*instance = i;
return 1;
}
}
return 0;
}
int smpp_set_link(u32 column, u32 *instance, u8 *pdata, u16 datalen)
{
SMPP_PARAM *pParam;
int ret;
smpp_param_flag = 1;
if(column == 1)
{
ret = smpp_enable_link();
if(ret == -1)
{
strcpy((char*)pdata,"Maximum Link is 32.");
return -2;
}
else
{
pdata[0] = ret;
return datalen;
}
}
if (instance[0] >= MAX_SMPP_LINK)
return -1;
pParam = &smpp_param[instance[0]];
switch(column)
{
case 2: //remote service number
if (datalen > 8)
return -1;
memset(pParam->service_number,0,8);
SET_OCTETSTRING(pParam->service_number, datalen);
break;
case 3: //link type
SET_INTEGER(pParam->link_type);
break;
case 4: //server type
SET_INTEGER(pParam->server_type);
break;
case 5: //session type
SET_INTEGER(pParam->session_type);
break;
case 6: //system id
if (datalen > SMPP_SYSID_LEN)
return -1;
memset(pParam->sys_id,0,SMPP_SYSID_LEN);
SET_OCTETSTRING(pParam->sys_id, datalen);
break;
case 7: //password
if (datalen > SMPP_PASSWD_LEN)
return -1;
memset(pParam->password,0,SMPP_PASSWD_LEN);
SET_OCTETSTRING(pParam->password, datalen);
break;
case 8: //system type
if (datalen > SMPP_SYSTYPE_LEN)
return -1;
memset(pParam->system_type,0,SMPP_SYSTYPE_LEN);
SET_OCTETSTRING(pParam->system_type, datalen);
break;
case 9: //local gtt
if (datalen > SMPP_GTT_LEN)
return -1;
memset(pParam->localGTT,0,SMPP_GTT_LEN);
SET_OCTETSTRING(pParam->localGTT, datalen);
break;
case 10: //remote gtt
if (datalen > SMPP_GTT_LEN)
return -1;
memset(pParam->remoteGTT,0,SMPP_GTT_LEN);
SET_OCTETSTRING(pParam->remoteGTT, datalen);
break;
case 11: //local ip
SET_IP(&pParam->local_ip);
break;
case 12: //remote ip
SET_IP(&pParam->remote_ip);
break;
case 13: //session init timer
SET_INTEGER(pParam->session_init_timer);
break;
case 14: // enquire link timer
SET_INTEGER(pParam->enquire_link_timer);
break;
case 15: //inactivity timer
SET_INTEGER(pParam->inactivity_timer);
break;
case 16: //response timer
SET_INTEGER(pParam->response_timer);
break;
case 17:
SET_INTEGER(pParam->localSSN);
break;
case 18:
SET_INTEGER(pParam->remoteSSN);
break;
case 19://enable/disable flag
{
u8 temp8;
SET_U8(temp8);
temp8 &= 0x01;
if(temp8 == 1)//enable
pParam->link_enable |= 0x01;
else
{
pParam->link_enable &= ~0x01;
init_link(instance[0]);
}
break;
}
case 20://delete
{
u8 temp8;
SET_U8(temp8);
if(temp8 == 6)//delete
{
pParam->link_enable = 0;
init_link(instance[0]);
}
break;
}
default:
break;
}
return datalen;
}
int smpp_get_link(u32 column, u32 *instance, u8 *pdata, u8 *vartype)
{
int datalen = -1;
SMPP_PARAM *pParam;
if (instance[0] >= MAX_SMPP_LINK)
return -1;
pParam = &smpp_param[instance[0]];
switch(column)
{
case 1: //index
GET_INTEGER(instance[0]);
break;
case 2: //remote service number (LinkAlias)
if((datalen = strlen(pParam->service_number)) > 8)
datalen = 8;
GET_OCTETSTRING(pParam->service_number, datalen);
break;
case 3: //link type
GET_INTEGER(pParam->link_type);
break;
case 4: //server type
GET_INTEGER(pParam->server_type);
break;
case 5: //session type
GET_INTEGER(pParam->session_type);
break;
case 6: //system id
if((datalen = strlen(pParam->sys_id)) > SMPP_SYSID_LEN)
datalen = SMPP_SYSID_LEN;
GET_OCTETSTRING(pParam->sys_id, datalen);
break;
case 7: //password
if((datalen = strlen(pParam->password)) > SMPP_PASSWD_LEN)
datalen = SMPP_PASSWD_LEN;
GET_OCTETSTRING(pParam->password, datalen);
break;
case 8: //system type
if((datalen = strlen(pParam->system_type)) > SMPP_SYSTYPE_LEN)
datalen = SMPP_SYSTYPE_LEN;
GET_OCTETSTRING(pParam->system_type, datalen);
break;
case 9: //local gtt
if((datalen = strlen(pParam->localGTT)) > SMPP_GTT_LEN)
datalen = SMPP_GTT_LEN;
GET_OCTETSTRING(pParam->localGTT, datalen);
break;
case 10: //remote gtt
if((datalen = strlen(pParam->remoteGTT)) > SMPP_GTT_LEN)
datalen = SMPP_GTT_LEN;
GET_OCTETSTRING(pParam->remoteGTT, datalen);
break;
case 11: //local ip
GET_IP(&pParam->local_ip);
break;
case 12: //remote ip
GET_IP(&pParam->remote_ip);
break;
case 13: //session init timer
GET_INTEGER(pParam->session_init_timer);
break;
case 14: //enquire link timer
GET_INTEGER(pParam->enquire_link_timer);
break;
case 15: //inactivity timer
GET_INTEGER(pParam->inactivity_timer);
break;
case 16: //response timer
GET_INTEGER(pParam->response_timer);
break;
case 17:
GET_INTEGER(pParam->localSSN);
break;
case 18:
GET_INTEGER(pParam->remoteSSN);
break;
case 19: //enable flag
GET_U8(pParam->link_enable&0x01);
break;
case 20: //link enable
GET_U8(1);
break;
default:
break;
}
return datalen;
}
int smpp_get_system(u32 column, u32 *instance, u8 *pdata, u8 *vartype)
{
int datalen = -1;
GET_OCTETSTRING(" ",1);
return datalen;
}
int smpp_set_system(u32 column, u32 *instance, u8 *pdata, u16 datalen)
{
switch(column)
{
case 1:
switch (pdata[0])
{
case 0: //reset
smpp_reset();
break;
case 1: //load
smpp_loadParam();
break;
case 2: //save
smpp_writeParam();
break;
}
}
return datalen;
}
static struct snmp_table_profile smpp_tables[] = {
/****** Parameter table ******/
{
.name = "system",
.index.len = 13,
.index.oid = {1, 3, 6, 1, 4, 1, 1373, 2, 3, 2, 18, 2, 1},//1.3.6.1.4.1.1373.2.3.2.18.2.1
.column = {0},
.level = 0,
.get_instance = NULL,
.get_resp = smpp_get_system,
.set_resp = smpp_set_system
},
{
.name = "smpp link",
.index.len = 14,
.index.oid = {1, 3, 6, 1, 4, 1, 1373, 2, 3, 2, 18, 2, 2, 1},//1.3.6.1.4.1.1373.2.3.2.18.2.2.1
.column = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0},
.level = 1,
.get_instance = smpp_getnext_link,
.get_resp = smpp_get_link,
.set_resp = smpp_set_link
},
};
static struct snmp_register smpp_register = {
.name = "SMPP",
.prefix_len = 11,
.prefix_oid = {1, 3, 6, 1, 4, 1, 1373, 2, 3, 2, 18},
.num_of_table = sizeof(smpp_tables)/sizeof(struct snmp_table_profile),
.table = smpp_tables,
.default_get_resp = smpp_getMib,
.default_set_resp = smpp_setMib
};
void smpp_mibInit()
{
int i;
// DWORD oid[20] = SMPP_OID;
for (i=0; i<MAX_SMPP_LINK; i++) {
linkAttachFlag[i] = 0;
smpp_TCPClientFlag[i] = 0;
smpp_param[i].link_enable = 0;
smpp_param[i].link_type = SMPP_UDP;
smpp_param[i].server_type = SMPP_CLIENT;
smpp_param[i].session_type = BIND_TX;
smpp_param[i].localSSN = 0;
smpp_param[i].remoteSSN = 0;
strcpy(smpp_param[i].sys_id,"Test");
strcpy(smpp_param[i].password,"123456");
strcpy(smpp_param[i].system_type, "GSM");
sprintf(smpp_param[i].localGTT,"%s","--");
sprintf(smpp_param[i].remoteGTT,"%s","--");
smpp_param[i].local_ip = 0;
smpp_param[i].remote_ip = 0;
smpp_param[i].session_init_timer= 5;
smpp_param[i].enquire_link_timer= 10;
smpp_param[i].inactivity_timer = 5;
smpp_param[i].response_timer = 5;
strcpy(smpp_param[i].service_number, "--");
smpp_link[i].seq_num = 0;
Mysock.Sockets[i] = 0;
}
// inquire_setmsg(SMPP_OIDLEN, oid, smpp_setMib);
// inquire_getmsg(SMPP_OIDLEN, oid, smpp_getMib);
register_snmp_table(&smpp_register);
}

5897
plat/smpp/src/smpp_msg.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,95 @@
K 25
svn:wc:ra_dav:version-url
V 58
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files
END
mib_list_file.txt
K 25
svn:wc:ra_dav:version-url
V 76
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/mib_list_file.txt
END
WXC2-SS7-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-SS7-MIB.txt
END
Special_App-SMI.txt
K 25
svn:wc:ra_dav:version-url
V 78
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/Special_App-SMI.txt
END
System_IP_List.txt
K 25
svn:wc:ra_dav:version-url
V 77
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/System_IP_List.txt
END
WXC2-MSC-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-MSC-MIB.txt
END
WXC2-SMI.txt
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-SMI.txt
END
WXC2-HLR-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-HLR-MIB.txt
END
menu_page
K 25
svn:wc:ra_dav:version-url
V 68
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/menu_page
END
menu_tree.txt
K 25
svn:wc:ra_dav:version-url
V 72
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/menu_tree.txt
END
WXC2-PPS-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-PPS-MIB.txt
END
WXC2-MSS-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-MSS-MIB.txt
END
WXC2-SMSC-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 76
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-SMSC-MIB.txt
END
IWV-SMI.txt
K 25
svn:wc:ra_dav:version-url
V 70
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/IWV-SMI.txt
END
WXC2-AUC-MIB.txt
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/WXC2-AUC-MIB.txt
END
mib_write_tree.txt
K 25
svn:wc:ra_dav:version-url
V 77
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/smpp/ut/conf/MIB_files/mib_write_tree.txt
END

View File

@@ -0,0 +1,538 @@
10
dir
114
http://172.25.201.20/svn/wxc2/trunk/R4S/plat/smpp/ut/conf/MIB_files
http://172.25.201.20/svn/wxc2
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
4a7aa47d-8bee-446f-9599-049dc37ff264
mib_list_file.txt
file
2012-12-28T03:06:04.156250Z
e59e7013ff47d5331bc5e68f42248885
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
259
WXC2-SS7-MIB.txt
file
2012-12-28T03:06:04.171875Z
91d2557ea5be19fe06b92e2c879d8377
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
93367
Special_App-SMI.txt
file
2012-12-28T03:06:04.187500Z
97ed2af0dacccade5e3baab77ca99295
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
932
System_IP_List.txt
file
2012-12-28T03:06:04.203125Z
7f68bfdab1c0892d2391924bd1115f73
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
888
WXC2-MSC-MIB.txt
file
2012-12-28T03:06:04.203125Z
51e7fa91629d05cf8eca01f20d967fc8
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
102848
WXC2-SMI.txt
file
2012-12-28T03:06:04.234375Z
2e85c17d3dc4bb21d376a86eb9a5f849
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
1107
WXC2-HLR-MIB.txt
file
2012-12-28T03:06:04.250000Z
12831926c39eb44e7d775167b0ed38ce
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
51898
menu_page
file
2012-12-28T03:06:04.171875Z
a4c3041b9ba49e5e98a6c7888e52aa7b
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
528
menu_tree.txt
file
2012-12-28T03:06:04.187500Z
addab8c771a403371f6b208388c37f8a
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
33070
WXC2-PPS-MIB.txt
file
2012-12-28T03:06:04.218750Z
d3905e6500df6a9afe34b0e128f6a8b4
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
390028
WXC2-MSS-MIB.txt
file
2012-12-28T03:06:04.218750Z
6629dfee3fa27b4fda3b74d5bcb3f6a1
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
1326
WXC2-SMSC-MIB.txt
file
2012-12-28T03:06:04.250000Z
fac370b62b453bf23d5d43e5c47e0a10
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
5823
IWV-SMI.txt
file
2012-12-28T03:06:04.234375Z
98316bf7b30187298164c96030583d89
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
1036
WXC2-AUC-MIB.txt
file
2012-12-28T03:06:04.265625Z
35cb757ffc0367d867e78026b8d9996b
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
10058
mib_write_tree.txt
file
2012-12-28T03:06:04.265625Z
ca660623f2314251a90d317e99acdf64
2011-09-23T09:01:37.023785Z
1
xueqiang.sheng
has-props
639972

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,40 @@
-- *****************************************************************
-- IWV-SMI: interWAVE Enterprise Structure of Management Information
--
-- draft November 2000, Huang qilong
-- 1st November 2004, Sheng Xueqiang
--
-- Copyright (c) 2000 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
IWV-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
enterprises
FROM SNMPv2-SMI;
IWV MODULE-IDENTITY
LAST-UPDATED "0411170000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the interWAVE enterprise."
REVISION "200411170000Z"
DESCRIPTION
"1st version of this MIB module."
::= { enterprises 1373 } -- assigned by IANA
IWV_Products OBJECT-IDENTITY
STATUS current
DESCRIPTION
"iwvProducts is the root OBJECT IDENTIFIER from which sysObjectID values are assigned. Actual values are defined in IWV-PRODUCTS-MIB."
::= { IWV 1 }
END

View File

@@ -0,0 +1,43 @@
-- *****************************************************************
-- Special_App-SMI: WXC2 Structure of Management Information
--
-- draft November 2004, Sheng Xueqiang
--
-- Copyright (c) 2004 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
Special_App-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
FROM SNMPv2-SMI
IWV_Products
FROM IWV-SMI;
Special_App MODULE-IDENTITY
LAST-UPDATED "0411180000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the Special Application of interWAVE enterprise."
REVISION "200411180000Z"
DESCRIPTION
"1st version of this MIB module."
::= { IWV_Products 2 }
-- CNF Center
-- IWF
IWF OBJECT-IDENTITY
STATUS current
DESCRIPTION
"IWF "
::= { Special_App 8 }
-- PPP Route
END

View File

@@ -0,0 +1,26 @@
// host ip
// "//" is the annotation characters; ";" is the septation characters;
// Please put the localhost subsystem ip at the first of the group ip on one subsystem
MTP3_0_0 mss-0 ; LocalHost;
MTP3_1_0 mss-1 ; 172.18.133.1;
MTP3_2_0 -- ; 172.18.123.1;
MTP3_3_0 -- ; 172.18.143.1;
SCCP_0_0 mss-0 ; LOCALHOST;
SCCP_1_0 mss-1 ; 172.18.133.1;
XAPP_0_0 MSS-0 ; localhost;
XAPP_1_0 MSS-1 ; 172.18.133.1;
SMPP_0_0 SMPP-0; LocalHost;
MSC_0_0 -- ; LocalHost;
MSC_1_0 -- ; 172.18.133.1;
CCF(MSC)_0_0 --; LocalHost;
CCF(MSC)_0_1 --; 172.18.133.1;
VLR_0_0 VLR-0 ; LocalHost;
VLR_1_0 VLR-1 ; 172.18..1;
HLR_0_0 -- ; LocalHost;
HLR_1_0 -- ; 172.18.234.230;
AUC_0_0 -- ; LocalHost;
AUC_1_0 -- ; 172.18.234.230;
SMSC_0_0 -- ; LocalHost;
SMSC_1_0 -- ; 172.18.234.230;
PPS_0_0 -- ; LocalHost;
PPS_1_0 -- ; 172.18.234.230;

View File

@@ -0,0 +1,437 @@
alvr1188-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
AUC OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
[SubSystem_Module]Subsystems for AUC .
"
::= { App 4 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Configuration for AUC .
"
::= { AUC 2 }
Public_parameter OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Public_parameter for AUC .
"
::= { Configuration 1 }
SSD OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]share SSD
{
[u]0.0-0.7
[u]select
[v]0[opt]not share
[v]1[opt]share
}
[2]Update SSD timer
{
[u]1.0-2.7
[u]input
[v]toDec-high-0
}
[3]reserved
{
[u]3.0-7.7
[u]select
}
Remark: SSD
[End]
"
::= { Public_parameter 2 }
Count OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]Count Match Range
{
[u]0.0-0.7
[u]input
[v]toDec-high-0
}
[2]reserved
{
[u]1.0-7.7
[u]select
}
Remark: Count.
[End]
"
::= { Public_parameter 3 }
Failures OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field:
[1]AUTHR Mismatch
{
[u]0.0-0.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
[v]2[opt]Unique Challenge
}
[2]Count Mismatch
{
[u]1.0-1.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[3]Unique Challenge Failure
{
[u]2.0-2.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[4]SSD Update Failure
{
[u]3.0-3.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[5]Count Update Failure
{
[u]4.0-4.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[6]Missing AUTH Parameters
{
[u]5.0-5.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
[v]2[opt]Unique Challenge
}
[7]reserved
{
[u]6.0-7.7
[u]select
}
Remark: Count.
[End]
"
::= { Public_parameter 4 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Management .
"
::= { Configuration 2 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 00
Flag: S1.2
Field: [1]Save parameters to HD
{
[u]00.0-00.2
[u]select
[v]00[opt]Idle
[v]01[opt]Save
[v]01[opt]Saving
[v]02[opt]Save succeeds
[v]03[opt]Save fails
}
[2]Save user data to HD&OMC
{
[u]00.3-00.5
[u]select
[v]00[opt]Idle
[v]01[opt]Save
[v]01[opt]Saving
[v]02[opt]Save succeeds
[v]03[opt]Save fails
}
[3]Reserved
{
[u]00.6-00.7
[u]select
}
Remark: Command for AUC paramters and user data operation, and the result of command.
[End]
"
::= { Management 2 }
License_Control OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]Licenses
{
[u]00.0-15.7
[u]input
[v]keepHex-high-0
}
Remark: 8-byte encrypted license provided by interWAVE used to provision an approved quantiy of AUC subscribers for service provider. The new license can not support less AUC subscribers than what the old license supports.
[End]
"
::= { Management 3 }
MAX_License OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 00000000
Field: [1]Max Licenses
{
[u]0.0-3.7
[u]input
[v]toDec-high-0
}
Remark: The maximum quantity of approved AUC subscribers determined by License control Read only.
[End]
"
::= { Management 11 }
Used_License OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 00000000
Field: [1]Used Licenses
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: The quantity of currently registered EIR subscribers (Read only).
[End]
"
::= { Management 12 }
User_information OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
User Information .
"
::= { Management 13 }
Provisioned_Users OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 000000
Field: [1]Provisioned users
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: The quantity of service enabled AUC subscribers (Read only).
[End]
"
::= { User_information 1 }
Version OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Version .
"
::= { Management 14 }
Software OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 3
Default: 000000
Field: [1]System
{
[u]00.0-00.7
[u]input
[v]keepHex-high-0
}
[2]Module
{
[u]01.0-01.7
[u]input
[v]keepHex-high-0
}
[3]Test
{
[u]02.0-02.7
[u]input
[v]keepHex-high-0
}
Remark: Version of AUC software (Read only).
System: System release version, based on basic function and structure.
Module: Software module version, based on software module.
Test: Test version, 0=Release version. 1=Test version.
[End]
"
::= { Version 1 }
User_data OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 3
Default: 000000
Field: [1]System
{
[u]00.0-00.7
[u]input
[v]keepHex-high-0
}
[2]User data
{
[u]01.0-01.7
[u]input
[v]keepHex-high-0
}
[3]Test
{
[u]02.0-02.7
[u]input
[v]keepHex-high-0
}
Remark: Version of AUC subscriber data (Read only).
System: System release version, based on basic function and structure.
User data: Subscriber profile version, based on software module.
Test: Test version, 0=Release version. 1=Test version.
[End]
"
::= { Version 2 }
IMSI_Segment OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1000
Length: 4
Default: 00000000
Field: [1]IMSI segment
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: IMSI segment table (Read only):
100,000 IMSIs are subdivided into 1000 segments, each IMSI segment use the 8 most significant digits (from the 6th digit to 13th digit of 15-digit of IMSI) as the segment number.
IMSI=MCC(3)+MNC(2)+MSIN(10)
Segment number=the 8 most significant digits of the MSIN, each segment has 100 subscribers (00-99).
e.g. If IMSI=460002356090098 then it belongs to IMSI segemt 23560900 and its account number in that segment=98. 0=empty segment.
[End]
"
::= { Management 15 }
Status OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Status for AUC .
"
::= { AUC 3 }
Import_status OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 12
Default: 000000000000000000000000
Field:
Remark: Import status.
[End]
"
::= { Status 2 }
END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
WXC2-MSS-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
MSS OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Subsystems for MSS . "
::= { App 16 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Configuration for MSS . "
::= { MSS 2 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Management for MSS . "
::= { Configuration 1 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance : 1
Length : 1
Default : 00
Field : [1]Command
{
[u]00.0-00.7
[u]select
[v]4[opt]Shutdown
[v]5[opt]Undefine value
}
Remark : Safely shut down MSS server by stoping MSS process, saving subscriber data to harddisk and shut down the server.
Operation procedures:
1. Select -Shutdown- at above pulldown menu.
2. Click -Set- button in this set window.
3. Click -SET- button on operation page.
[End]
"
::= { Management 1 }
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
-- *****************************************************************
-- WXC2-SMI: WXC2 Structure of Management Information
--
-- draft November 2000, Huang qilong
-- 1st November 2004, Sheng Xueqiang
--
-- Copyright (c) 2004 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
WXC2-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
FROM SNMPv2-SMI
IWV_Products
FROM IWV-SMI;
WXC2 MODULE-IDENTITY
LAST-UPDATED "200506050000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the WXC2 of interWAVE enterprise."
REVISION "200506050000Z"
DESCRIPTION
"1st version of this MIB module."
::= { IWV_Products 3 }
-- WXC2_PCM
PCM OBJECT-IDENTITY
STATUS current
DESCRIPTION
"PCM "
::= { WXC2 1 }
-- WXC2_platform
Platform OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Platform "
::= { WXC2 2 }
-- WXC2_App
App OBJECT-IDENTITY
STATUS current
DESCRIPTION
"App platform"
::= { WXC2 3 }
END

View File

@@ -0,0 +1,259 @@
WXC2-SMSC-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
SMSC OBJECT-IDENTITY
STATUS current
DESCRIPTION
"[SubSystem_Module]Subsystems for SMSC . "
::= { App 5 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Configuration for SMSC . "
::= { SMSC 2 }
System_Param OBJECT-IDENTITY
STATUS current
DESCRIPTION
" system parameter . "
::= { Configuration 1 }
CDR_Flag OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 03
Field: [1]SMSC CDR
{
[u]0.0-0.0
[u]select
[v]0[opt]Not generate
[v]1[opt]Generate
}
[2]SMSC LOG
{
[u]0.1-0.1
[u]select
[v]0[opt]Not generate
[v]1[opt]Generate
}
[3]Reserved
{
[u]0.2-0.7
[u]select
}
Remark: SMSC CDR generation enable or disable.
[End]
"
::= { System_Param 1 }
SM_Validity OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 0000A8C0
Field: [1]SM validity
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: Period of validity of short message, define a threshold how long an awaiting sending message should be kept in sending array till sent to MS, unit is second, default=0c0a8h seconds=12 hours.
[End]
"
::= { System_Param 2 }
MSISDN_Segment OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 16
Length: 19
Default: 8675557127000EEEEE8675557127999EEEEE00
Field: [1]Start MSISDN
{
[u]00.0-08.7
[u]input
[v]keepHex-low-E
}
[2]End MSISDN
{
[u]09.0-17.7
[u]input
[v]keepHex-low-E
}
[3]Number Type
{
[u]18.0-18.7
[u]select
[v]0[opt]GSM
[v]1[opt]CDMA
}
Remark: Specify the beginning MSISDN for the range of provisioned subscriber. F=end tag.
[End]
"
::= { System_Param 3 }
SMPP_parameters OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 32
Length: 12
Default: 000000000000000000000000
Field: [1]Enable flag
{
[u]00.0-00.7
[u]select
[v]00[opt]Disable
[v]01[opt]Enable
}
[2]Session type
{
[u]01.0-01.7
[u]select
[v]00[opt]BIND_TX
[v]01[opt]BIND_RX
[v]02[opt]BIND_TRX
}
[3]Service number
{
[u]02.0-9.7
[u]input
[v]toAscii-low-0
}
[4]Message mode
{
[u]10.0-10.7
[u]select
[v]00[opt]Store and forward
[v]01[opt]Datagram
[v]02[opt]Transaction
}
[5]Data Coding Scheme
{
[u]11.0-11.7
[u]select
[v]00[opt]To smpp=7bit,default=7bit
[v]01[opt]To smpp=8bit,default=7bit
[v]16[opt]To smpp=7bit,default=8bit
[v]17[opt]To smpp=8bit,default=8bit
}
Remark: Name: Can be any name, generally use the name of the connected device.
Service number: SMPP connected party MSISDN used for display on MT MS,
e.g. for a SMPP to PPS, set the service number as MSISDN of PPS.
Data coding scheme:
00:smsc to smpp=7bit,when dcs = 0,smsc to smpp default = 7bit
01:smsc to smpp=8bit,when dcs = 0,smsc to smpp default = 7bit
10:smsc to smpp=7bit,when dcs = 0,smsc to smpp default = 8bit
11:smsc to smpp=8bit,when dcs = 0,smsc to smpp default = 8bit
Default=0.
[End]
"
::= { Configuration 2 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Management for SMSC .
"
::= { SMSC 3 }
SMSC_ID OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 00
Field: [1]SMSC ID
{
[u]00.0-00.7
[u]input
[v]keepHex-low-E
}
Remark: SMSC ID
[End]
"
::= { Management 1 }
Software_Version OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 7
Default: 00000000000000
Field: [1]Version
{
[u]00.0-02.7
[u]input
[v]keepHex-low-E
}
Remark: Software version
[End]
"
::= { Management 2 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 01
Flag: S1.1
Field: [1]Command
{
[u]00.0-00.7
[u]select
[v]01[opt]Save parameters
[v]04[opt]Reset system
[v]05[opt]Delete pending SM
}
Remark: SMSC system command.
Save parameters: Save the SMSC parameters in memory to SMSC harddisk.
Delete pending SM: Delete the pending SM in awaiting array.
[End]
"
::= { Management 3 }
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
*******************
* Module Page *
*******************
a -- IPTR i -- HLR
b -- MTP3 j -- SMSC
c -- SCCP k -- PPS
d -- TCAP l -- SNMP
e -- XAPP m -- M2UA
f -- MSC n -- DEBUG
g -- VLR o -- AUC
h -- SSF p -- EIR

View File

@@ -0,0 +1,908 @@
############## The debug menu tree config file root=wxc2 root_oid={1.3.6.1.4.1.1373.1.3}
#(0)(1)(2)(9) ip group
#/ the layer
#.1.1.3. menu_id
#{3.2.2.1.2} the last oid from the root
#[name] menu name
#M:8 the id of the menu in the current object
############## all the line must end for ';',and menu id and last oid must do not contain space
##WXC2
/. (9);
M:1 [MSC] {3.2};
M:2 [VLR] {3.2.5};
M:3 [HLR] {3.3};
M:4 [PPS] {3.6};
M:5 [SMSC] {3.5};
M:6 [AUC] {3.4};
##M:7 [EIR] {3.8};
##MSC
/ /.1. (9);
M:1 [Prefix Assignment] {3.2.2.2.1.1};
M:2 [Prefix Attributes] {3.2.2.2.1.2};
M:3 [Assign TG to Prefix] {3.2.2.2.1.3};
M:4 [TG attributes] {3.2.2.2.1.4};
M:5 [CDR Flag] {3.2.2.2.1.5};
M:6 [Announcement Option] {3.2.2.2.1.6};
M:7 [Warning tone] {3.2.2.2.1.7};
M:8 [Emergency call] {3.2.2.2.2.5};
M:9 [Location management] {3.2.2.2.2.8};
M:10 [Max. call duration] {3.2.2.2.3.7};
M:11 [E1 Port] {3.2.2.2.4};
M:12 [channel attributes] {3.2.2.2.5};
M:13 [Platform] {2};
M:14 [MSC0] (1) {3.2};
M:15 [MSC1] (2) {3.2};
##MSC->E1 Port
/ / /.1.11. (9);
M:1 [E1 interface] {3.2.2.2.4.1};
M:2 [Assign TG to E1] {3.2.2.2.4.2};
M:3 [CIC of E1] {3.2.2.2.4.3};
##MSC->channel attributes->8K card 0-31
/ / /.1.12. (9);
M:1 [Card 0 channel attributes] {3.2.2.2.5.1};
M:2 [Card 1 channel attributes] {3.2.2.2.5.2};
M:3 [Card 2 channel attributes] {3.2.2.2.5.3};
M:4 [Card 3 channel attributes] {3.2.2.2.5.4};
M:5 [Card 4 channel attributes] {3.2.2.2.5.5};
M:6 [Card 5 channel attributes] {3.2.2.2.5.6};
M:7 [Card 6 channel attributes] {3.2.2.2.5.7};
M:8 [Card 7 channel attributes] {3.2.2.2.5.8};
M:9 [Card 8 channel attributes] {3.2.2.2.5.9};
M:10 [Card 9 channel attributes] {3.2.2.2.5.10};
M:11 [Card 10 channel attributes] {3.2.2.2.5.11};
M:12 [Card 11 channel attributes] {3.2.2.2.5.12};
M:13 [Card 12 channel attributes] {3.2.2.2.5.13};
M:14 [Card 13 channel attributes] {3.2.2.2.5.14};
M:15 [Card 14 channel attributes] {3.2.2.2.5.15};
M:16 [Card 15 channel attributes] {3.2.2.2.5.16};
M:17 [Card 16 channel attributes] {3.2.2.2.5.17};
M:18 [Card 17 channel attributes] {3.2.2.2.5.18};
M:19 [Card 18 channel attributes] {3.2.2.2.5.19};
M:20 [Card 19 channel attributes] {3.2.2.2.5.20};
M:21 [Card 20 channel attributes] {3.2.2.2.5.21};
M:22 [Card 21 channel attributes] {3.2.2.2.5.22};
M:23 [Card 22 channel attributes] {3.2.2.2.5.23};
M:24 [Card 23 channel attributes] {3.2.2.2.5.24};
M:25 [Card 24 channel attributes] {3.2.2.2.5.25};
M:26 [Card 25 channel attributes] {3.2.2.2.5.26};
M:27 [Card 26 channel attributes] {3.2.2.2.5.27};
M:28 [Card 27 channel attributes] {3.2.2.2.5.28};
M:29 [Card 28 channel attributes] {3.2.2.2.5.29};
M:30 [Card 29 channel attributes] {3.2.2.2.5.30};
M:31 [Card 30 channel attributes] {3.2.2.2.5.31};
M:32 [Card 31 channel attributes] {3.2.2.2.5.32};
##MSC->Platform
/ / /.1.13. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##MSC->Platform->MTP3
/ / /.1.13.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [ACN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##MSC->Platform->MTP3->Status
/ / /.1.13.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##MSC->Platform->SCCP
/ / /.1.13.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##MSC->Platform->XAPP
/ / /.1.13.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##MSC->MSC0->E1 status
/ / /.1.14. (1);
M:1 [E1 Status] {3.2.2.3.4};
M:2 [Channel Status] {3.2.2.3.5};
##M:3 [CSU0] {1.1};
##MSC->MSC1->E1 status
/ / /.1.15. (2);
M:1 [E1 Status] {3.2.2.3.4};
M:2 [Channel Status] {3.2.2.3.5};
##M:3 [CSU1] {1.1};
##MSC->MSC0->Channel Status
/ / / /.1.14.2. (1);
M:1 [8K Card 0] {3.2.2.3.5.1};
M:2 [8K Card 1] {3.2.2.3.5.2};
M:3 [8K Card 2] {3.2.2.3.5.3};
M:4 [8K Card 3] {3.2.2.3.5.4};
M:5 [8K Card 4] {3.2.2.3.5.5};
M:6 [8K Card 5] {3.2.2.3.5.6};
M:7 [8K Card 6] {3.2.2.3.5.7};
M:8 [8K Card 7] {3.2.2.3.5.8};
M:9 [8K Card 8] {3.2.2.3.5.9};
M:10 [8K Card 9] {3.2.2.3.5.10};
M:11 [8K Card 10] {3.2.2.3.5.11};
M:12 [8K Card 11] {3.2.2.3.5.12};
M:13 [8K Card 12] {3.2.2.3.5.13};
M:14 [8K Card 13] {3.2.2.3.5.14};
M:15 [8K Card 14] {3.2.2.3.5.15};
M:16 [8K Card 15] {3.2.2.3.5.16};
##MSC->MSC1->channel status
/ / / /.1.15.2. (2);
M:1 [8K Card 0] {3.2.2.3.5.1};
M:2 [8K Card 1] {3.2.2.3.5.2};
M:3 [8K Card 2] {3.2.2.3.5.3};
M:4 [8K Card 3] {3.2.2.3.5.4};
M:5 [8K Card 4] {3.2.2.3.5.5};
M:6 [8K Card 5] {3.2.2.3.5.6};
M:7 [8K Card 6] {3.2.2.3.5.7};
M:8 [8K Card 7] {3.2.2.3.5.8};
M:9 [8K Card 8] {3.2.2.3.5.9};
M:10 [8K Card 9] {3.2.2.3.5.10};
M:11 [8K Card 10] {3.2.2.3.5.11};
M:12 [8K Card 11] {3.2.2.3.5.12};
M:13 [8K Card 12] {3.2.2.3.5.13};
M:14 [8K Card 13] {3.2.2.3.5.14};
M:15 [8K Card 14] {3.2.2.3.5.15};
M:16 [8K Card 15] {3.2.2.3.5.16};
##MSC->MSC0->CSU0
##/ / / / /.1.14.3. (1);
##M:1 [E1 enable] {1.1.1.2.1};
##M:2 [MTP alarm on/off] {1.1.1.2.2};
##M:3 [Link type] {1.1.1.2.3};
##M:4 [NT/LT] {1.1.1.2.4};
##M:5 [DPLL priority] {1.1.1.2.5};
##M:6 [CRC4 flag] {1.1.1.2.6};
##M:7 [Ringback Tone] {1.1.1.2.7.1};
##M:8 [Busy Tone] {1.1.1.2.7.2};
##M:9 [Unavailable Tone] {1.1.1.2.7.3};
##M:10 [Congestion Tone] {1.1.1.2.7.4};
##M:11 [Proceeding Tone] {1.1.1.2.7.5};
##M:12 [Warning tone] {1.1.1.2.7.6};
##M:13 [Tone assignment] {1.1.1.2.7.9};
##M:14 [DTMF mark&space] {1.1.1.2.7.10};
##M:15 [8KE1_0] (0) {1.1.1.3};
##M:16 [8KE1_1] (0) {1.1.1.3};
##M:17 [8KE1_2] (0) {1.1.1.3};
##M:18 [8KE1_3] (0) {1.1.1.3};
##M:19 [8KE1_4] (0) {1.1.1.3};
##M:20 [8KE1_5] (0) {1.1.1.3};
##M:21 [8KE1_6] (0) {1.1.1.3};
##M:22 [8KE1_7] (0) {1.1.1.3};
##M:23 [8KE1_8] (0) {1.1.1.3};
##M:24 [8KE1_9] (0) {1.1.1.3};
##M:25 [8KE1_10] (0) {1.1.1.3};
##M:26 [8KE1_11] (0) {1.1.1.3};
##M:27 [8KE1_12] (0) {1.1.1.3};
##M:28 [8KE1_13] (0) {1.1.1.3};
##M:29 [8KE1_14] (0) {1.1.1.3};
##M:30 [8KE1_15] (0) {1.1.1.3};
##MSC->MSC1->CSU1
##/ / / / /.1.15.3. (2);
##M:1 [E1 enable] {1.1.1.2.1};
##M:2 [MTP alarm on/off] {1.1.1.2.2};
##M:3 [Link type] {1.1.1.2.3};
##M:4 [NT/LT] {1.1.1.2.4};
##M:5 [DPLL priority] {1.1.1.2.5};
##M:6 [CRC4 flag] {1.1.1.2.6};
##M:7 [Ringback Tone] {1.1.1.2.7.1};
##M:8 [Busy Tone] {1.1.1.2.7.2};
##M:9 [Unavailable Tone] {1.1.1.2.7.3};
##M:10 [Congestion Tone] {1.1.1.2.7.4};
##M:11 [Proceeding Tone] {1.1.1.2.7.5};
##M:12 [Warning tone] {1.1.1.2.7.6};
##M:13 [Tone assignment] {1.1.1.2.7.9};
##M:14 [DTMF mark&space] {1.1.1.2.7.10};
##M:15 [8KE1_0] (0) {1.1.1.3};
##M:16 [8KE1_1] (0) {1.1.1.3};
##M:17 [8KE1_2] (0) {1.1.1.3};
##M:18 [8KE1_3] (0) {1.1.1.3};
##M:19 [8KE1_4] (0) {1.1.1.3};
##M:20 [8KE1_5] (0) {1.1.1.3};
##M:21 [8KE1_6] (0) {1.1.1.3};
##M:22 [8KE1_7] (0) {1.1.1.3};
##M:23 [8KE1_8] (0) {1.1.1.3};
##M:24 [8KE1_9] (0) {1.1.1.3};
##M:25 [8KE1_10] (0) {1.1.1.3};
##M:26 [8KE1_11] (0) {1.1.1.3};
##M:27 [8KE1_12] (0) {1.1.1.3};
##M:28 [8KE1_13] (0) {1.1.1.3};
##M:29 [8KE1_14] (0) {1.1.1.3};
##M:30 [8KE1_15] (0) {1.1.1.3};
##VLR
/ / /.2. (9);
M:1 [OptAuthReq] {3.2.5.2.1.1};
M:2 [OpReuseTriplets] {3.2.5.2.1.2};
M:3 [OptCipReq] {3.2.5.2.1.3};
M:4 [OptCiphAlgo] {3.2.5.2.1.4};
M:5 [OptTmsiAlloc] {3.2.5.2.1.5};
M:6 [OptEcsSetUpAllow] {3.2.5.2.1.7};
M:7 [OptCheckIMEI] {3.2.5.2.1.8};
M:8 [OptVlrPurge] {3.2.5.2.1.9};
M:9 [idlePeriod2Purge] {3.2.5.2.1.10};
M:10 [CDR flag] {3.2.5.2.1.11};
M:11 [MSRN] {3.2.5.2.1.13};
M:12 [VLR0] {3.2.5};
M:13 [VLR1] {3.2.5};
##VLR->VLR0
/ / /.2.12. (1);
M:1 [Version] {3.2.5.3.2};
M:2 [Command] {3.2.5.3.3};
M:3 [Status] {3.2.5.3.4};
##VLR->VLR0
/ / /.2.13. (2);
M:1 [Version] {3.2.5.3.2};
M:2 [Command] {3.2.5.3.3};
M:3 [Status] {3.2.5.3.4};
##HLR
/ / /.3. (9);
M:1 [HPLMN] {3.3.2.1.11};
M:2 [VPLMNs] {3.3.2.1.12};
M:3 [CSRR list] {3.3.2.1.13};
M:4 [Regional Subscription] {3.3.2.1.14};
M:5 [License control] {3.3.2.1.15};
M:6 [CDR control] {3.3.2.1.16};
M:7 [Feature Code] {3.3.2.1.27};
M:8 [Platform] {2};
M:9 [HLR0] {3.3};
M:10 [HLR1] {3.3};
##HLR->Platform
/ / /.3.8. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##HLR->Platform->MTP3
/ / /.3.8.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [ACN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##HLR->Platform->MTP3->Status
/ / /.3.8.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##HLR->Platform->SCCP
/ / /.3.8.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##HLR->Platform->XAPP
/ / /.3.8.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##HLR->HLR0
/ / /.3.9. (1);
M:1 [Command] {3.3.2.2.2};
M:2 [Subscriber import] {3.3.2.2.3};
M:3 [Max Licenses] {3.3.2.2.11};
M:4 [Used Licenses] {3.3.2.2.12};
M:5 [Subscriber information] {3.3.2.2.13};
M:6 [Version] {3.3.2.2.14};
M:7 [IMSI segment] {3.3.2.2.15};
M:8 [MSISDN segment] {3.3.2.2.16};
M:9 [CNF applicant info] {3.3.2.2.27};
##M:10 [Contry code] {3.3.2.2.10};
##HLR->HLR0->Subscriber information
/ / /.3.9.5. (1);
M:1 [Provisioned subscribers] {3.3.2.2.13.1};
M:2 [Registered subscribers] {3.3.2.2.13.2};
M:3 [Roaming subscribers] {3.3.2.2.13.3};
##HLR->HLR0->Version
/ / /.3.9.6. (1);
M:1 [Software] {3.3.2.2.14.1};
M:2 [User data] {3.3.2.2.14.2};
##HLR->HLR1
/ / /.3.10. (2);
M:1 [Command] {3.3.2.2.2};
M:2 [Subscriber import] {3.3.2.2.3};
M:3 [Max Licenses] {3.3.2.2.11};
M:4 [Used Licenses] {3.3.2.2.12};
M:5 [Subscriber information] {3.3.2.2.13};
M:6 [Version] {3.3.2.2.14};
M:7 [IMSI segment] {3.3.2.2.15};
M:8 [MSISDN segment] {3.3.2.2.16};
M:9 [CNF applicant info] {3.3.2.2.27};
##M:10 [Contry code] {3.3.2.2.10};
##HLR->HLR1->Subscriber information
/ / /.3.10.5. (2);
M:1 [Provisioned subscribers] {3.3.2.2.13.1};
M:2 [Registered subscribers] {3.3.2.2.13.2};
M:3 [Roaming subscribers] {3.3.2.2.13.3};
##HLR->HLR1->Version
/ / /.3.10.6. (2);
M:1 [Software] {3.3.2.2.14.1};
M:2 [User data] {3.3.2.2.14.2};
##PPS
/ / /.4. (9);
M:1 [Service control] {3.6.2.1.1};
M:2 [SRF Number] {3.6.2.1.2.1};
M:3 [Service number] {3.6.2.1.2.2};
M:4 [Service key] {3.6.2.1.2.3};
M:5 [COS Parameter] {3.6.2.1.4};
M:6 [Call routing to VMS] {3.6.2.1.5};
M:7 [Status] {3.6.2.1.6};
M:8 [Platform] {2};
##PPS->Service control
/ / /.4.1. (9);
M:1 [CDR flag] {3.6.2.1.1.1};
M:2 [Blacklist threshhold] {3.6.2.1.1.2};
M:3 [Maximun balance] {3.6.2.1.1.3};
M:4 [license control] {3.6.2.1.1.4};
M:5 [Prompt resolution] {3.6.2.1.1.5};
M:6 [SMS Sentence] {3.6.2.1.1.6};
M:7 [Last call info] {3.6.2.1.1.7};
M:8 [Currency Symbol] {3.6.2.1.1.8};
M:9 [Third party info] {3.6.2.1.1.9};
M:10 [Basic Tariff Zone] {3.6.2.1.1.10};
##PPS->Service number
/ / /.4.3. (9);
M:1 [Hotline] {3.6.2.1.2.2.1};
M:2 [Inquiry] {3.6.2.1.2.2.2};
M:3 [Scratch card rechagne] {3.6.2.1.2.2.3};
M:4 [Credit card recharge] {3.6.2.1.2.2.4};
M:5 [Third party recharge] {3.6.2.1.2.2.5};
M:6 [Customer care center] {3.6.2.1.2.2.6};
M:7 [Recharge] {3.6.2.1.2.2.7};
##PPS->Service key
/ / /.4.4. (9);
M:1 [Inquiry] {3.6.2.1.2.3.2};
M:2 [Scratch card rechagne] {3.6.2.1.2.3.3};
M:3 [Credit card recharge] {3.6.2.1.2.3.4};
M:4 [Set favorite number] {3.6.2.1.2.3.5};
M:5 [Set password] {3.6.2.1.2.3.6};
##PPS->COS Parameter
/ / /.4.5. (9);
M:1 [COS0] {3.6.2.1.4.1};
M:2 [COS1] {3.6.2.1.4.2};
M:3 [COS2] {3.6.2.1.4.3};
M:4 [COS3] {3.6.2.1.4.4};
M:5 [COS4] {3.6.2.1.4.5};
M:6 [COS5] {3.6.2.1.4.6};
M:7 [COS6] {3.6.2.1.4.7};
M:8 [COS7] {3.6.2.1.4.8};
M:9 [COS8] {3.6.2.1.4.9};
M:10 [COS9] {3.6.2.1.4.10};
M:11 [COS10] {3.6.2.1.4.11};
M:12 [COS11] {3.6.2.1.4.12};
M:13 [COS12] {3.6.2.1.4.13};
M:14 [COS13] {3.6.2.1.4.14};
M:15 [COS14] {3.6.2.1.4.15};
M:16 [COS15] {3.6.2.1.4.16};
##PPS->COS Parameter->COS 0-15
/ / /.4.5.1. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.1.1};
M:2 [Tariff Resolution] {3.6.2.1.4.1.2};
M:3 [Account control] {3.6.2.1.4.1.3};
M:4 [MT Call control] {3.6.2.1.4.1.4};
M:5 [Validity control] {3.6.2.1.4.1.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.1.6};
/ / /.4.5.2. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.2.1};
M:2 [Tariff Resolution] {3.6.2.1.4.2.2};
M:3 [Account control] {3.6.2.1.4.2.3};
M:4 [MT Call control] {3.6.2.1.4.2.4};
M:5 [Validity control] {3.6.2.1.4.2.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.2.6};
/ / /.4.5.3. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.3.1};
M:2 [Tariff Resolution] {3.6.2.1.4.3.2};
M:3 [Account control] {3.6.2.1.4.3.3};
M:4 [MT Call control] {3.6.2.1.4.3.4};
M:5 [Validity control] {3.6.2.1.4.3.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.3.6};
/ / /.4.5.4. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.4.1};
M:2 [Tariff Resolution] {3.6.2.1.4.4.2};
M:3 [Account control] {3.6.2.1.4.4.3};
M:4 [MT Call control] {3.6.2.1.4.4.4};
M:5 [Validity control] {3.6.2.1.4.4.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.4.6};
/ / /.4.5.5. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.5.1};
M:2 [Tariff Resolution] {3.6.2.1.4.5.2};
M:3 [Account control] {3.6.2.1.4.5.3};
M:4 [MT Call control] {3.6.2.1.4.5.4};
M:5 [Validity control] {3.6.2.1.4.5.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.5.6};
/ / /.4.5.6. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.6.1};
M:2 [Tariff Resolution] {3.6.2.1.4.6.2};
M:3 [Account control] {3.6.2.1.4.6.3};
M:4 [MT Call control] {3.6.2.1.4.6.4};
M:5 [Validity control] {3.6.2.1.4.6.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.6.6};
/ / /.4.5.7. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.7.1};
M:2 [Tariff Resolution] {3.6.2.1.4.7.2};
M:3 [Account control] {3.6.2.1.4.7.3};
M:4 [MT Call control] {3.6.2.1.4.7.4};
M:5 [Validity control] {3.6.2.1.4.7.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.7.6};
/ / /.4.5.8. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.8.1};
M:2 [Tariff Resolution] {3.6.2.1.4.8.2};
M:3 [Account control] {3.6.2.1.4.8.3};
M:4 [MT Call control] {3.6.2.1.4.8.4};
M:5 [Validity control] {3.6.2.1.4.8.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.8.6};
/ / /.4.5.9. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.9.1};
M:2 [Tariff Resolution] {3.6.2.1.4.9.2};
M:3 [Account control] {3.6.2.1.4.9.3};
M:4 [MT Call control] {3.6.2.1.4.9.4};
M:5 [Validity control] {3.6.2.1.4.9.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.9.6};
/ / /.4.5.10. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.10.1};
M:2 [Tariff Resolution] {3.6.2.1.4.10.2};
M:3 [Account control] {3.6.2.1.4.10.3};
M:4 [MT Call control] {3.6.2.1.4.10.4};
M:5 [Validity control] {3.6.2.1.4.10.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.10.6};
/ / /.4.5.11. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.11.1};
M:2 [Tariff Resolution] {3.6.2.1.4.11.2};
M:3 [Account control] {3.6.2.1.4.11.3};
M:4 [MT Call control] {3.6.2.1.4.11.4};
M:5 [Validity control] {3.6.2.1.4.11.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.11.6};
/ / /.4.5.12. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.12.1};
M:2 [Tariff Resolution] {3.6.2.1.4.12.2};
M:3 [Account control] {3.6.2.1.4.12.3};
M:4 [MT Call control] {3.6.2.1.4.12.4};
M:5 [Validity control] {3.6.2.1.4.12.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.12.6};
/ / /.4.5.13. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.13.1};
M:2 [Tariff Resolution] {3.6.2.1.4.13.2};
M:3 [Account control] {3.6.2.1.4.13.3};
M:4 [MT Call control] {3.6.2.1.4.13.4};
M:5 [Validity control] {3.6.2.1.4.13.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.13.6};
/ / /.4.5.14. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.14.1};
M:2 [Tariff Resolution] {3.6.2.1.4.14.2};
M:3 [Account control] {3.6.2.1.4.14.3};
M:4 [MT Call control] {3.6.2.1.4.14.4};
M:5 [Validity control] {3.6.2.1.4.14.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.14.6};
/ / /.4.5.15. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.15.1};
M:2 [Tariff Resolution] {3.6.2.1.4.15.2};
M:3 [Account control] {3.6.2.1.4.15.3};
M:4 [MT Call control] {3.6.2.1.4.15.4};
M:5 [Validity control] {3.6.2.1.4.15.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.15.6};
/ / /.4.5.16. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.16.1};
M:2 [Tariff Resolution] {3.6.2.1.4.16.2};
M:3 [Account control] {3.6.2.1.4.16.3};
M:4 [MT Call control] {3.6.2.1.4.16.4};
M:5 [Validity control] {3.6.2.1.4.16.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.16.6};
##PPS->call routing to VMS
/ / /.4.6. (9);
M:1 [VMS service number-PLMN] {3.6.2.1.5.1};
M:2 [VMS service number-PSTN] {3.6.2.1.5.2};
M:3 [VMS leave message number] {3.6.2.1.5.3};
M:4 [Routing rule] {3.6.2.1.5.4};
M:5 [VMS user segments] {3.6.2.1.5.5};
##PPS->Status
/ / /.4.7. (9);
M:1 [Activaion] {3.6.2.1.6.1};
M:2 [Command] {3.6.2.1.6.2};
##PPS->Platform
/ / /.4.8. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
M:4 [SMPP] {2.3.4}
##PPS->Platform->MTP3
/ / /.4.8.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##PPS->Platform->MTP3->Status
/ / /.4.8.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##PPS->Platform->SCCP
/ / /.4.8.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##PPS->Platform->XAPP
/ / /.4.8.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##PPS-->Platform->SMPP
/ / /.4.8.4. (9);
M:1 [SMPP_Link_Param] {2.3.4.2.1};
M:2 [Command] {2.3.4.3.2};
## SMSC
/ / /.5. (9);
M:1 [CDR flag] {3.5.2.1.1};
M:2 [SM Validity] {3.5.2.1.2};
M:3 [MSISDN Segment] {3.5.2.1.3};
M:4 [SMPP parameters] {3.5.2.2};
M:5 [Command] {3.5.3.3};
M:6 [Platform] {2};
M:7 [SMSC0] {3.5};
M:8 [SMSC1] {3.5};
##SMSC->Platform
/ / /.5.6. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
M:4 [SMPP] {2.3.4};
##SMSC->Platform->MTP3
/ / /.5.6.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##SMSC->Platform->MTP3->Status
/ / /.5.6.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##SMSC->Platform->SCCP
/ / /.5.6.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##SMSC->Platform->XAPP
/ / /.5.6.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##SMSC->Platform->SMPP
/ / /.5.6.4. (9);
M:1 [SMPP_Link_Param] {2.3.4.2.1};
M:2 [Command] {2.3.4.3.2};
##SMSC->SMSC0
/ / /.5.7. (1);
M:1 [SMSC ID] {3.5.3.1};
M:2 [Software version] {3.5.3.2};
##SMSC->SMSC1
/ / /.5.8. (2);
M:1 [SMSC ID] {3.5.3.1};
M:2 [Software version] {3.5.3.2};
##AUC
/ / /.6. (9);
M:1 [Platform] {2};
M:2 [AUC0] (1) {3.4};
M:3 [AUC1] (2) {3.4};
##AUC->Platform
/ / /.6.1. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##AUC->Platform->MTP3
/ / /.6.1.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##AUC->Platform->MTP3->Status
/ / /.6.1.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##AUC->Platform->SCCP
/ / /.6.1.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##AUC->Platform->XAPP
/ / /.6.1.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##EIR
##/ / /.7. (9);
##M:1 [Platform] {2};
##M:2 [EIR0] (1) {3.8};
##M:3 [EIR1] (2) {3.8};
##EIR->Platform
##/ / /.7.1. (9);
##M:1 [MTP3] {2.2.2};
##M:2 [SCCP] {2.2.3};
##M:3 [XAPP] {2.2.5};
##EIR->Platform->MTP3
##/ / /.7.1.1. (9);
##M:1 [Network Indicator] {2.2.2.2.2};
##M:2 [Originating Point code] {2.2.2.2.3};
##M:3 [Link Set] {2.2.2.2.4};
##M:4 [Link] {2.2.2.2.5};
##M:5 [Routing] {2.2.2.2.6};
##M:6 [CAN] {2.2.2.2.7};
##M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##EIR->Platform->MTP3->Status
##/ / /.7.1.1.7. (9);
####M:1 [Link status] {2.2.2.3.1};
##M:2 [Link set status] {2.2.2.3.2};
##M:3 [International routing] {2.2.2.3.3};
##M:4 [International spare] {2.2.2.3.4};
##M:5 [National routing] {2.2.2.3.5};
##M:6 [National spare routing] {2.2.2.3.6};
##M:7 [Command] {2.2.2.3.7};
##EIR->Platform->SCCP
##/ / /.7.1.2. (9);
##M:1 [Local node] {2.2.3.2.1};
##M:2 [GTT] {2.2.3.2.2};
##M:3 [Command] {2.2.3.3.2};
##EIR->Platform->XAPP
##/ / /.7.1.3. (9);
##M:1 [MCC] {2.2.5.2.1};
##M:2 [MNC] {2.2.5.2.2};
##M:3 [CC] {2.2.5.2.3};
##M:5 [International prefix] {2.2.5.2.5};
##M:6 [National Prefix] {2.2.5.2.6};
##M:7 [Local Prefix] {2.2.5.2.7};
##M:8 [Convert Prefix] {2.2.5.2.8};
##M:9 [Command] {2.2.5.3.2};

View File

@@ -0,0 +1,14 @@
// "//" is the annotation characters;
IWV-SMI.txt
Special_App-SMI.txt
//PPPRT-MIB.txt
WXC2-SMI.txt
//WXC2-CSU-MIB.txt
WXC2-SS7-MIB.txt
WXC2-MSC-MIB.txt
WXC2-HLR-MIB.txt
WXC2-AUC-MIB.txt
//WXC2-EIR-MIB.txt
WXC2-SMSC-MIB.txt
WXC2-PPS-MIB.txt
WXC2-MSS-MIB.txt

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
-- *****************************************************************
-- IWV-SMI: interWAVE Enterprise Structure of Management Information
--
-- draft November 2000, Huang qilong
-- 1st November 2004, Sheng Xueqiang
--
-- Copyright (c) 2000 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
IWV-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
enterprises
FROM SNMPv2-SMI;
IWV MODULE-IDENTITY
LAST-UPDATED "0411170000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the interWAVE enterprise."
REVISION "200411170000Z"
DESCRIPTION
"1st version of this MIB module."
::= { enterprises 1373 } -- assigned by IANA
IWV_Products OBJECT-IDENTITY
STATUS current
DESCRIPTION
"iwvProducts is the root OBJECT IDENTIFIER from which sysObjectID values are assigned. Actual values are defined in IWV-PRODUCTS-MIB."
::= { IWV 1 }
END

View File

@@ -0,0 +1,43 @@
-- *****************************************************************
-- Special_App-SMI: WXC2 Structure of Management Information
--
-- draft November 2004, Sheng Xueqiang
--
-- Copyright (c) 2004 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
Special_App-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
FROM SNMPv2-SMI
IWV_Products
FROM IWV-SMI;
Special_App MODULE-IDENTITY
LAST-UPDATED "0411180000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the Special Application of interWAVE enterprise."
REVISION "200411180000Z"
DESCRIPTION
"1st version of this MIB module."
::= { IWV_Products 2 }
-- CNF Center
-- IWF
IWF OBJECT-IDENTITY
STATUS current
DESCRIPTION
"IWF "
::= { Special_App 8 }
-- PPP Route
END

View File

@@ -0,0 +1,26 @@
// host ip
// "//" is the annotation characters; ";" is the septation characters;
// Please put the localhost subsystem ip at the first of the group ip on one subsystem
MTP3_0_0 mss-0 ; LocalHost;
MTP3_1_0 mss-1 ; 172.18.133.1;
MTP3_2_0 -- ; 172.18.123.1;
MTP3_3_0 -- ; 172.18.143.1;
SCCP_0_0 mss-0 ; LOCALHOST;
SCCP_1_0 mss-1 ; 172.18.133.1;
XAPP_0_0 MSS-0 ; localhost;
XAPP_1_0 MSS-1 ; 172.18.133.1;
SMPP_0_0 SMPP-0; LocalHost;
MSC_0_0 -- ; LocalHost;
MSC_1_0 -- ; 172.18.133.1;
CCF(MSC)_0_0 --; LocalHost;
CCF(MSC)_0_1 --; 172.18.133.1;
VLR_0_0 VLR-0 ; LocalHost;
VLR_1_0 VLR-1 ; 172.18..1;
HLR_0_0 -- ; LocalHost;
HLR_1_0 -- ; 172.18.234.230;
AUC_0_0 -- ; LocalHost;
AUC_1_0 -- ; 172.18.234.230;
SMSC_0_0 -- ; LocalHost;
SMSC_1_0 -- ; 172.18.234.230;
PPS_0_0 -- ; LocalHost;
PPS_1_0 -- ; 172.18.234.230;

View File

@@ -0,0 +1,437 @@
alvr1188-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
AUC OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
[SubSystem_Module]Subsystems for AUC .
"
::= { App 4 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Configuration for AUC .
"
::= { AUC 2 }
Public_parameter OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Public_parameter for AUC .
"
::= { Configuration 1 }
SSD OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]share SSD
{
[u]0.0-0.7
[u]select
[v]0[opt]not share
[v]1[opt]share
}
[2]Update SSD timer
{
[u]1.0-2.7
[u]input
[v]toDec-high-0
}
[3]reserved
{
[u]3.0-7.7
[u]select
}
Remark: SSD
[End]
"
::= { Public_parameter 2 }
Count OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]Count Match Range
{
[u]0.0-0.7
[u]input
[v]toDec-high-0
}
[2]reserved
{
[u]1.0-7.7
[u]select
}
Remark: Count.
[End]
"
::= { Public_parameter 3 }
Failures OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field:
[1]AUTHR Mismatch
{
[u]0.0-0.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
[v]2[opt]Unique Challenge
}
[2]Count Mismatch
{
[u]1.0-1.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[3]Unique Challenge Failure
{
[u]2.0-2.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[4]SSD Update Failure
{
[u]3.0-3.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[5]Count Update Failure
{
[u]4.0-4.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
}
[6]Missing AUTH Parameters
{
[u]5.0-5.7
[u]select
[v]0[opt]Allow Access
[v]1[opt]Deny Access
[v]2[opt]Unique Challenge
}
[7]reserved
{
[u]6.0-7.7
[u]select
}
Remark: Count.
[End]
"
::= { Public_parameter 4 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Management .
"
::= { Configuration 2 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 00
Flag: S1.2
Field: [1]Save parameters to HD
{
[u]00.0-00.2
[u]select
[v]00[opt]Idle
[v]01[opt]Save
[v]01[opt]Saving
[v]02[opt]Save succeeds
[v]03[opt]Save fails
}
[2]Save user data to HD&OMC
{
[u]00.3-00.5
[u]select
[v]00[opt]Idle
[v]01[opt]Save
[v]01[opt]Saving
[v]02[opt]Save succeeds
[v]03[opt]Save fails
}
[3]Reserved
{
[u]00.6-00.7
[u]select
}
Remark: Command for AUC paramters and user data operation, and the result of command.
[End]
"
::= { Management 2 }
License_Control OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 8
Default: 0000000000000000
Field: [1]Licenses
{
[u]00.0-15.7
[u]input
[v]keepHex-high-0
}
Remark: 8-byte encrypted license provided by interWAVE used to provision an approved quantiy of AUC subscribers for service provider. The new license can not support less AUC subscribers than what the old license supports.
[End]
"
::= { Management 3 }
MAX_License OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 00000000
Field: [1]Max Licenses
{
[u]0.0-3.7
[u]input
[v]toDec-high-0
}
Remark: The maximum quantity of approved AUC subscribers determined by License control Read only.
[End]
"
::= { Management 11 }
Used_License OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 00000000
Field: [1]Used Licenses
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: The quantity of currently registered EIR subscribers (Read only).
[End]
"
::= { Management 12 }
User_information OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
User Information .
"
::= { Management 13 }
Provisioned_Users OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 000000
Field: [1]Provisioned users
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: The quantity of service enabled AUC subscribers (Read only).
[End]
"
::= { User_information 1 }
Version OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Version .
"
::= { Management 14 }
Software OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 3
Default: 000000
Field: [1]System
{
[u]00.0-00.7
[u]input
[v]keepHex-high-0
}
[2]Module
{
[u]01.0-01.7
[u]input
[v]keepHex-high-0
}
[3]Test
{
[u]02.0-02.7
[u]input
[v]keepHex-high-0
}
Remark: Version of AUC software (Read only).
System: System release version, based on basic function and structure.
Module: Software module version, based on software module.
Test: Test version, 0=Release version. 1=Test version.
[End]
"
::= { Version 1 }
User_data OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 3
Default: 000000
Field: [1]System
{
[u]00.0-00.7
[u]input
[v]keepHex-high-0
}
[2]User data
{
[u]01.0-01.7
[u]input
[v]keepHex-high-0
}
[3]Test
{
[u]02.0-02.7
[u]input
[v]keepHex-high-0
}
Remark: Version of AUC subscriber data (Read only).
System: System release version, based on basic function and structure.
User data: Subscriber profile version, based on software module.
Test: Test version, 0=Release version. 1=Test version.
[End]
"
::= { Version 2 }
IMSI_Segment OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1000
Length: 4
Default: 00000000
Field: [1]IMSI segment
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: IMSI segment table (Read only):
100,000 IMSIs are subdivided into 1000 segments, each IMSI segment use the 8 most significant digits (from the 6th digit to 13th digit of 15-digit of IMSI) as the segment number.
IMSI=MCC(3)+MNC(2)+MSIN(10)
Segment number=the 8 most significant digits of the MSIN, each segment has 100 subscribers (00-99).
e.g. If IMSI=460002356090098 then it belongs to IMSI segemt 23560900 and its account number in that segment=98. 0=empty segment.
[End]
"
::= { Management 15 }
Status OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Status for AUC .
"
::= { AUC 3 }
Import_status OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 12
Default: 000000000000000000000000
Field:
Remark: Import status.
[End]
"
::= { Status 2 }
END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
WXC2-MSS-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
MSS OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Subsystems for MSS . "
::= { App 16 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Configuration for MSS . "
::= { MSS 2 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Management for MSS . "
::= { Configuration 1 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance : 1
Length : 1
Default : 00
Field : [1]Command
{
[u]00.0-00.7
[u]select
[v]4[opt]Shutdown
[v]5[opt]Undefine value
}
Remark : Safely shut down MSS server by stoping MSS process, saving subscriber data to harddisk and shut down the server.
Operation procedures:
1. Select -Shutdown- at above pulldown menu.
2. Click -Set- button in this set window.
3. Click -SET- button on operation page.
[End]
"
::= { Management 1 }
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
-- *****************************************************************
-- WXC2-SMI: WXC2 Structure of Management Information
--
-- draft November 2000, Huang qilong
-- 1st November 2004, Sheng Xueqiang
--
-- Copyright (c) 2004 by interWAVE, Inc.
-- All rights reserved.
--
-- *****************************************************************
--
WXC2-SMI DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
OBJECT-IDENTITY,
FROM SNMPv2-SMI
IWV_Products
FROM IWV-SMI;
WXC2 MODULE-IDENTITY
LAST-UPDATED "200506050000Z"
ORGANIZATION "interWAVE, Inc."
CONTACT-INFO
"http://www.iwv.com"
DESCRIPTION
"The Structure of Management Information for the WXC2 of interWAVE enterprise."
REVISION "200506050000Z"
DESCRIPTION
"1st version of this MIB module."
::= { IWV_Products 3 }
-- WXC2_PCM
PCM OBJECT-IDENTITY
STATUS current
DESCRIPTION
"PCM "
::= { WXC2 1 }
-- WXC2_platform
Platform OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Platform "
::= { WXC2 2 }
-- WXC2_App
App OBJECT-IDENTITY
STATUS current
DESCRIPTION
"App platform"
::= { WXC2 3 }
END

View File

@@ -0,0 +1,259 @@
WXC2-SMSC-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32, Opaque
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, TruthValue
FROM SNMPv2-TC
App
FROM WXC2-SMI;
SMSC OBJECT-IDENTITY
STATUS current
DESCRIPTION
"[SubSystem_Module]Subsystems for SMSC . "
::= { App 5 }
Configuration OBJECT-IDENTITY
STATUS current
DESCRIPTION
" Configuration for SMSC . "
::= { SMSC 2 }
System_Param OBJECT-IDENTITY
STATUS current
DESCRIPTION
" system parameter . "
::= { Configuration 1 }
CDR_Flag OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 03
Field: [1]SMSC CDR
{
[u]0.0-0.0
[u]select
[v]0[opt]Not generate
[v]1[opt]Generate
}
[2]SMSC LOG
{
[u]0.1-0.1
[u]select
[v]0[opt]Not generate
[v]1[opt]Generate
}
[3]Reserved
{
[u]0.2-0.7
[u]select
}
Remark: SMSC CDR generation enable or disable.
[End]
"
::= { System_Param 1 }
SM_Validity OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 4
Default: 0000A8C0
Field: [1]SM validity
{
[u]00.0-03.7
[u]input
[v]toDec-high-0
}
Remark: Period of validity of short message, define a threshold how long an awaiting sending message should be kept in sending array till sent to MS, unit is second, default=0c0a8h seconds=12 hours.
[End]
"
::= { System_Param 2 }
MSISDN_Segment OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 16
Length: 19
Default: 8675557127000EEEEE8675557127999EEEEE00
Field: [1]Start MSISDN
{
[u]00.0-08.7
[u]input
[v]keepHex-low-E
}
[2]End MSISDN
{
[u]09.0-17.7
[u]input
[v]keepHex-low-E
}
[3]Number Type
{
[u]18.0-18.7
[u]select
[v]0[opt]GSM
[v]1[opt]CDMA
}
Remark: Specify the beginning MSISDN for the range of provisioned subscriber. F=end tag.
[End]
"
::= { System_Param 3 }
SMPP_parameters OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 32
Length: 12
Default: 000000000000000000000000
Field: [1]Enable flag
{
[u]00.0-00.7
[u]select
[v]00[opt]Disable
[v]01[opt]Enable
}
[2]Session type
{
[u]01.0-01.7
[u]select
[v]00[opt]BIND_TX
[v]01[opt]BIND_RX
[v]02[opt]BIND_TRX
}
[3]Service number
{
[u]02.0-9.7
[u]input
[v]toAscii-low-0
}
[4]Message mode
{
[u]10.0-10.7
[u]select
[v]00[opt]Store and forward
[v]01[opt]Datagram
[v]02[opt]Transaction
}
[5]Data Coding Scheme
{
[u]11.0-11.7
[u]select
[v]00[opt]To smpp=7bit,default=7bit
[v]01[opt]To smpp=8bit,default=7bit
[v]16[opt]To smpp=7bit,default=8bit
[v]17[opt]To smpp=8bit,default=8bit
}
Remark: Name: Can be any name, generally use the name of the connected device.
Service number: SMPP connected party MSISDN used for display on MT MS,
e.g. for a SMPP to PPS, set the service number as MSISDN of PPS.
Data coding scheme:
00:smsc to smpp=7bit,when dcs = 0,smsc to smpp default = 7bit
01:smsc to smpp=8bit,when dcs = 0,smsc to smpp default = 7bit
10:smsc to smpp=7bit,when dcs = 0,smsc to smpp default = 8bit
11:smsc to smpp=8bit,when dcs = 0,smsc to smpp default = 8bit
Default=0.
[End]
"
::= { Configuration 2 }
Management OBJECT-IDENTITY
STATUS current
DESCRIPTION
"
Management for SMSC .
"
::= { SMSC 3 }
SMSC_ID OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 00
Field: [1]SMSC ID
{
[u]00.0-00.7
[u]input
[v]keepHex-low-E
}
Remark: SMSC ID
[End]
"
::= { Management 1 }
Software_Version OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS write-only
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 7
Default: 00000000000000
Field: [1]Version
{
[u]00.0-02.7
[u]input
[v]keepHex-low-E
}
Remark: Software version
[End]
"
::= { Management 2 }
Command OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"
[Begin]
Instance: 1
Length: 1
Default: 01
Flag: S1.1
Field: [1]Command
{
[u]00.0-00.7
[u]select
[v]01[opt]Save parameters
[v]04[opt]Reset system
[v]05[opt]Delete pending SM
}
Remark: SMSC system command.
Save parameters: Save the SMSC parameters in memory to SMSC harddisk.
Delete pending SM: Delete the pending SM in awaiting array.
[End]
"
::= { Management 3 }
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
*******************
* Module Page *
*******************
a -- IPTR i -- HLR
b -- MTP3 j -- SMSC
c -- SCCP k -- PPS
d -- TCAP l -- SNMP
e -- XAPP m -- M2UA
f -- MSC n -- DEBUG
g -- VLR o -- AUC
h -- SSF p -- EIR

View File

@@ -0,0 +1,908 @@
############## The debug menu tree config file root=wxc2 root_oid={1.3.6.1.4.1.1373.1.3}
#(0)(1)(2)(9) ip group
#/ the layer
#.1.1.3. menu_id
#{3.2.2.1.2} the last oid from the root
#[name] menu name
#M:8 the id of the menu in the current object
############## all the line must end for ';',and menu id and last oid must do not contain space
##WXC2
/. (9);
M:1 [MSC] {3.2};
M:2 [VLR] {3.2.5};
M:3 [HLR] {3.3};
M:4 [PPS] {3.6};
M:5 [SMSC] {3.5};
M:6 [AUC] {3.4};
##M:7 [EIR] {3.8};
##MSC
/ /.1. (9);
M:1 [Prefix Assignment] {3.2.2.2.1.1};
M:2 [Prefix Attributes] {3.2.2.2.1.2};
M:3 [Assign TG to Prefix] {3.2.2.2.1.3};
M:4 [TG attributes] {3.2.2.2.1.4};
M:5 [CDR Flag] {3.2.2.2.1.5};
M:6 [Announcement Option] {3.2.2.2.1.6};
M:7 [Warning tone] {3.2.2.2.1.7};
M:8 [Emergency call] {3.2.2.2.2.5};
M:9 [Location management] {3.2.2.2.2.8};
M:10 [Max. call duration] {3.2.2.2.3.7};
M:11 [E1 Port] {3.2.2.2.4};
M:12 [channel attributes] {3.2.2.2.5};
M:13 [Platform] {2};
M:14 [MSC0] (1) {3.2};
M:15 [MSC1] (2) {3.2};
##MSC->E1 Port
/ / /.1.11. (9);
M:1 [E1 interface] {3.2.2.2.4.1};
M:2 [Assign TG to E1] {3.2.2.2.4.2};
M:3 [CIC of E1] {3.2.2.2.4.3};
##MSC->channel attributes->8K card 0-31
/ / /.1.12. (9);
M:1 [Card 0 channel attributes] {3.2.2.2.5.1};
M:2 [Card 1 channel attributes] {3.2.2.2.5.2};
M:3 [Card 2 channel attributes] {3.2.2.2.5.3};
M:4 [Card 3 channel attributes] {3.2.2.2.5.4};
M:5 [Card 4 channel attributes] {3.2.2.2.5.5};
M:6 [Card 5 channel attributes] {3.2.2.2.5.6};
M:7 [Card 6 channel attributes] {3.2.2.2.5.7};
M:8 [Card 7 channel attributes] {3.2.2.2.5.8};
M:9 [Card 8 channel attributes] {3.2.2.2.5.9};
M:10 [Card 9 channel attributes] {3.2.2.2.5.10};
M:11 [Card 10 channel attributes] {3.2.2.2.5.11};
M:12 [Card 11 channel attributes] {3.2.2.2.5.12};
M:13 [Card 12 channel attributes] {3.2.2.2.5.13};
M:14 [Card 13 channel attributes] {3.2.2.2.5.14};
M:15 [Card 14 channel attributes] {3.2.2.2.5.15};
M:16 [Card 15 channel attributes] {3.2.2.2.5.16};
M:17 [Card 16 channel attributes] {3.2.2.2.5.17};
M:18 [Card 17 channel attributes] {3.2.2.2.5.18};
M:19 [Card 18 channel attributes] {3.2.2.2.5.19};
M:20 [Card 19 channel attributes] {3.2.2.2.5.20};
M:21 [Card 20 channel attributes] {3.2.2.2.5.21};
M:22 [Card 21 channel attributes] {3.2.2.2.5.22};
M:23 [Card 22 channel attributes] {3.2.2.2.5.23};
M:24 [Card 23 channel attributes] {3.2.2.2.5.24};
M:25 [Card 24 channel attributes] {3.2.2.2.5.25};
M:26 [Card 25 channel attributes] {3.2.2.2.5.26};
M:27 [Card 26 channel attributes] {3.2.2.2.5.27};
M:28 [Card 27 channel attributes] {3.2.2.2.5.28};
M:29 [Card 28 channel attributes] {3.2.2.2.5.29};
M:30 [Card 29 channel attributes] {3.2.2.2.5.30};
M:31 [Card 30 channel attributes] {3.2.2.2.5.31};
M:32 [Card 31 channel attributes] {3.2.2.2.5.32};
##MSC->Platform
/ / /.1.13. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##MSC->Platform->MTP3
/ / /.1.13.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [ACN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##MSC->Platform->MTP3->Status
/ / /.1.13.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##MSC->Platform->SCCP
/ / /.1.13.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##MSC->Platform->XAPP
/ / /.1.13.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##MSC->MSC0->E1 status
/ / /.1.14. (1);
M:1 [E1 Status] {3.2.2.3.4};
M:2 [Channel Status] {3.2.2.3.5};
##M:3 [CSU0] {1.1};
##MSC->MSC1->E1 status
/ / /.1.15. (2);
M:1 [E1 Status] {3.2.2.3.4};
M:2 [Channel Status] {3.2.2.3.5};
##M:3 [CSU1] {1.1};
##MSC->MSC0->Channel Status
/ / / /.1.14.2. (1);
M:1 [8K Card 0] {3.2.2.3.5.1};
M:2 [8K Card 1] {3.2.2.3.5.2};
M:3 [8K Card 2] {3.2.2.3.5.3};
M:4 [8K Card 3] {3.2.2.3.5.4};
M:5 [8K Card 4] {3.2.2.3.5.5};
M:6 [8K Card 5] {3.2.2.3.5.6};
M:7 [8K Card 6] {3.2.2.3.5.7};
M:8 [8K Card 7] {3.2.2.3.5.8};
M:9 [8K Card 8] {3.2.2.3.5.9};
M:10 [8K Card 9] {3.2.2.3.5.10};
M:11 [8K Card 10] {3.2.2.3.5.11};
M:12 [8K Card 11] {3.2.2.3.5.12};
M:13 [8K Card 12] {3.2.2.3.5.13};
M:14 [8K Card 13] {3.2.2.3.5.14};
M:15 [8K Card 14] {3.2.2.3.5.15};
M:16 [8K Card 15] {3.2.2.3.5.16};
##MSC->MSC1->channel status
/ / / /.1.15.2. (2);
M:1 [8K Card 0] {3.2.2.3.5.1};
M:2 [8K Card 1] {3.2.2.3.5.2};
M:3 [8K Card 2] {3.2.2.3.5.3};
M:4 [8K Card 3] {3.2.2.3.5.4};
M:5 [8K Card 4] {3.2.2.3.5.5};
M:6 [8K Card 5] {3.2.2.3.5.6};
M:7 [8K Card 6] {3.2.2.3.5.7};
M:8 [8K Card 7] {3.2.2.3.5.8};
M:9 [8K Card 8] {3.2.2.3.5.9};
M:10 [8K Card 9] {3.2.2.3.5.10};
M:11 [8K Card 10] {3.2.2.3.5.11};
M:12 [8K Card 11] {3.2.2.3.5.12};
M:13 [8K Card 12] {3.2.2.3.5.13};
M:14 [8K Card 13] {3.2.2.3.5.14};
M:15 [8K Card 14] {3.2.2.3.5.15};
M:16 [8K Card 15] {3.2.2.3.5.16};
##MSC->MSC0->CSU0
##/ / / / /.1.14.3. (1);
##M:1 [E1 enable] {1.1.1.2.1};
##M:2 [MTP alarm on/off] {1.1.1.2.2};
##M:3 [Link type] {1.1.1.2.3};
##M:4 [NT/LT] {1.1.1.2.4};
##M:5 [DPLL priority] {1.1.1.2.5};
##M:6 [CRC4 flag] {1.1.1.2.6};
##M:7 [Ringback Tone] {1.1.1.2.7.1};
##M:8 [Busy Tone] {1.1.1.2.7.2};
##M:9 [Unavailable Tone] {1.1.1.2.7.3};
##M:10 [Congestion Tone] {1.1.1.2.7.4};
##M:11 [Proceeding Tone] {1.1.1.2.7.5};
##M:12 [Warning tone] {1.1.1.2.7.6};
##M:13 [Tone assignment] {1.1.1.2.7.9};
##M:14 [DTMF mark&space] {1.1.1.2.7.10};
##M:15 [8KE1_0] (0) {1.1.1.3};
##M:16 [8KE1_1] (0) {1.1.1.3};
##M:17 [8KE1_2] (0) {1.1.1.3};
##M:18 [8KE1_3] (0) {1.1.1.3};
##M:19 [8KE1_4] (0) {1.1.1.3};
##M:20 [8KE1_5] (0) {1.1.1.3};
##M:21 [8KE1_6] (0) {1.1.1.3};
##M:22 [8KE1_7] (0) {1.1.1.3};
##M:23 [8KE1_8] (0) {1.1.1.3};
##M:24 [8KE1_9] (0) {1.1.1.3};
##M:25 [8KE1_10] (0) {1.1.1.3};
##M:26 [8KE1_11] (0) {1.1.1.3};
##M:27 [8KE1_12] (0) {1.1.1.3};
##M:28 [8KE1_13] (0) {1.1.1.3};
##M:29 [8KE1_14] (0) {1.1.1.3};
##M:30 [8KE1_15] (0) {1.1.1.3};
##MSC->MSC1->CSU1
##/ / / / /.1.15.3. (2);
##M:1 [E1 enable] {1.1.1.2.1};
##M:2 [MTP alarm on/off] {1.1.1.2.2};
##M:3 [Link type] {1.1.1.2.3};
##M:4 [NT/LT] {1.1.1.2.4};
##M:5 [DPLL priority] {1.1.1.2.5};
##M:6 [CRC4 flag] {1.1.1.2.6};
##M:7 [Ringback Tone] {1.1.1.2.7.1};
##M:8 [Busy Tone] {1.1.1.2.7.2};
##M:9 [Unavailable Tone] {1.1.1.2.7.3};
##M:10 [Congestion Tone] {1.1.1.2.7.4};
##M:11 [Proceeding Tone] {1.1.1.2.7.5};
##M:12 [Warning tone] {1.1.1.2.7.6};
##M:13 [Tone assignment] {1.1.1.2.7.9};
##M:14 [DTMF mark&space] {1.1.1.2.7.10};
##M:15 [8KE1_0] (0) {1.1.1.3};
##M:16 [8KE1_1] (0) {1.1.1.3};
##M:17 [8KE1_2] (0) {1.1.1.3};
##M:18 [8KE1_3] (0) {1.1.1.3};
##M:19 [8KE1_4] (0) {1.1.1.3};
##M:20 [8KE1_5] (0) {1.1.1.3};
##M:21 [8KE1_6] (0) {1.1.1.3};
##M:22 [8KE1_7] (0) {1.1.1.3};
##M:23 [8KE1_8] (0) {1.1.1.3};
##M:24 [8KE1_9] (0) {1.1.1.3};
##M:25 [8KE1_10] (0) {1.1.1.3};
##M:26 [8KE1_11] (0) {1.1.1.3};
##M:27 [8KE1_12] (0) {1.1.1.3};
##M:28 [8KE1_13] (0) {1.1.1.3};
##M:29 [8KE1_14] (0) {1.1.1.3};
##M:30 [8KE1_15] (0) {1.1.1.3};
##VLR
/ / /.2. (9);
M:1 [OptAuthReq] {3.2.5.2.1.1};
M:2 [OpReuseTriplets] {3.2.5.2.1.2};
M:3 [OptCipReq] {3.2.5.2.1.3};
M:4 [OptCiphAlgo] {3.2.5.2.1.4};
M:5 [OptTmsiAlloc] {3.2.5.2.1.5};
M:6 [OptEcsSetUpAllow] {3.2.5.2.1.7};
M:7 [OptCheckIMEI] {3.2.5.2.1.8};
M:8 [OptVlrPurge] {3.2.5.2.1.9};
M:9 [idlePeriod2Purge] {3.2.5.2.1.10};
M:10 [CDR flag] {3.2.5.2.1.11};
M:11 [MSRN] {3.2.5.2.1.13};
M:12 [VLR0] {3.2.5};
M:13 [VLR1] {3.2.5};
##VLR->VLR0
/ / /.2.12. (1);
M:1 [Version] {3.2.5.3.2};
M:2 [Command] {3.2.5.3.3};
M:3 [Status] {3.2.5.3.4};
##VLR->VLR0
/ / /.2.13. (2);
M:1 [Version] {3.2.5.3.2};
M:2 [Command] {3.2.5.3.3};
M:3 [Status] {3.2.5.3.4};
##HLR
/ / /.3. (9);
M:1 [HPLMN] {3.3.2.1.11};
M:2 [VPLMNs] {3.3.2.1.12};
M:3 [CSRR list] {3.3.2.1.13};
M:4 [Regional Subscription] {3.3.2.1.14};
M:5 [License control] {3.3.2.1.15};
M:6 [CDR control] {3.3.2.1.16};
M:7 [Feature Code] {3.3.2.1.27};
M:8 [Platform] {2};
M:9 [HLR0] {3.3};
M:10 [HLR1] {3.3};
##HLR->Platform
/ / /.3.8. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##HLR->Platform->MTP3
/ / /.3.8.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [ACN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##HLR->Platform->MTP3->Status
/ / /.3.8.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##HLR->Platform->SCCP
/ / /.3.8.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##HLR->Platform->XAPP
/ / /.3.8.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##HLR->HLR0
/ / /.3.9. (1);
M:1 [Command] {3.3.2.2.2};
M:2 [Subscriber import] {3.3.2.2.3};
M:3 [Max Licenses] {3.3.2.2.11};
M:4 [Used Licenses] {3.3.2.2.12};
M:5 [Subscriber information] {3.3.2.2.13};
M:6 [Version] {3.3.2.2.14};
M:7 [IMSI segment] {3.3.2.2.15};
M:8 [MSISDN segment] {3.3.2.2.16};
M:9 [CNF applicant info] {3.3.2.2.27};
##M:10 [Contry code] {3.3.2.2.10};
##HLR->HLR0->Subscriber information
/ / /.3.9.5. (1);
M:1 [Provisioned subscribers] {3.3.2.2.13.1};
M:2 [Registered subscribers] {3.3.2.2.13.2};
M:3 [Roaming subscribers] {3.3.2.2.13.3};
##HLR->HLR0->Version
/ / /.3.9.6. (1);
M:1 [Software] {3.3.2.2.14.1};
M:2 [User data] {3.3.2.2.14.2};
##HLR->HLR1
/ / /.3.10. (2);
M:1 [Command] {3.3.2.2.2};
M:2 [Subscriber import] {3.3.2.2.3};
M:3 [Max Licenses] {3.3.2.2.11};
M:4 [Used Licenses] {3.3.2.2.12};
M:5 [Subscriber information] {3.3.2.2.13};
M:6 [Version] {3.3.2.2.14};
M:7 [IMSI segment] {3.3.2.2.15};
M:8 [MSISDN segment] {3.3.2.2.16};
M:9 [CNF applicant info] {3.3.2.2.27};
##M:10 [Contry code] {3.3.2.2.10};
##HLR->HLR1->Subscriber information
/ / /.3.10.5. (2);
M:1 [Provisioned subscribers] {3.3.2.2.13.1};
M:2 [Registered subscribers] {3.3.2.2.13.2};
M:3 [Roaming subscribers] {3.3.2.2.13.3};
##HLR->HLR1->Version
/ / /.3.10.6. (2);
M:1 [Software] {3.3.2.2.14.1};
M:2 [User data] {3.3.2.2.14.2};
##PPS
/ / /.4. (9);
M:1 [Service control] {3.6.2.1.1};
M:2 [SRF Number] {3.6.2.1.2.1};
M:3 [Service number] {3.6.2.1.2.2};
M:4 [Service key] {3.6.2.1.2.3};
M:5 [COS Parameter] {3.6.2.1.4};
M:6 [Call routing to VMS] {3.6.2.1.5};
M:7 [Status] {3.6.2.1.6};
M:8 [Platform] {2};
##PPS->Service control
/ / /.4.1. (9);
M:1 [CDR flag] {3.6.2.1.1.1};
M:2 [Blacklist threshhold] {3.6.2.1.1.2};
M:3 [Maximun balance] {3.6.2.1.1.3};
M:4 [license control] {3.6.2.1.1.4};
M:5 [Prompt resolution] {3.6.2.1.1.5};
M:6 [SMS Sentence] {3.6.2.1.1.6};
M:7 [Last call info] {3.6.2.1.1.7};
M:8 [Currency Symbol] {3.6.2.1.1.8};
M:9 [Third party info] {3.6.2.1.1.9};
M:10 [Basic Tariff Zone] {3.6.2.1.1.10};
##PPS->Service number
/ / /.4.3. (9);
M:1 [Hotline] {3.6.2.1.2.2.1};
M:2 [Inquiry] {3.6.2.1.2.2.2};
M:3 [Scratch card rechagne] {3.6.2.1.2.2.3};
M:4 [Credit card recharge] {3.6.2.1.2.2.4};
M:5 [Third party recharge] {3.6.2.1.2.2.5};
M:6 [Customer care center] {3.6.2.1.2.2.6};
M:7 [Recharge] {3.6.2.1.2.2.7};
##PPS->Service key
/ / /.4.4. (9);
M:1 [Inquiry] {3.6.2.1.2.3.2};
M:2 [Scratch card rechagne] {3.6.2.1.2.3.3};
M:3 [Credit card recharge] {3.6.2.1.2.3.4};
M:4 [Set favorite number] {3.6.2.1.2.3.5};
M:5 [Set password] {3.6.2.1.2.3.6};
##PPS->COS Parameter
/ / /.4.5. (9);
M:1 [COS0] {3.6.2.1.4.1};
M:2 [COS1] {3.6.2.1.4.2};
M:3 [COS2] {3.6.2.1.4.3};
M:4 [COS3] {3.6.2.1.4.4};
M:5 [COS4] {3.6.2.1.4.5};
M:6 [COS5] {3.6.2.1.4.6};
M:7 [COS6] {3.6.2.1.4.7};
M:8 [COS7] {3.6.2.1.4.8};
M:9 [COS8] {3.6.2.1.4.9};
M:10 [COS9] {3.6.2.1.4.10};
M:11 [COS10] {3.6.2.1.4.11};
M:12 [COS11] {3.6.2.1.4.12};
M:13 [COS12] {3.6.2.1.4.13};
M:14 [COS13] {3.6.2.1.4.14};
M:15 [COS14] {3.6.2.1.4.15};
M:16 [COS15] {3.6.2.1.4.16};
##PPS->COS Parameter->COS 0-15
/ / /.4.5.1. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.1.1};
M:2 [Tariff Resolution] {3.6.2.1.4.1.2};
M:3 [Account control] {3.6.2.1.4.1.3};
M:4 [MT Call control] {3.6.2.1.4.1.4};
M:5 [Validity control] {3.6.2.1.4.1.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.1.6};
/ / /.4.5.2. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.2.1};
M:2 [Tariff Resolution] {3.6.2.1.4.2.2};
M:3 [Account control] {3.6.2.1.4.2.3};
M:4 [MT Call control] {3.6.2.1.4.2.4};
M:5 [Validity control] {3.6.2.1.4.2.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.2.6};
/ / /.4.5.3. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.3.1};
M:2 [Tariff Resolution] {3.6.2.1.4.3.2};
M:3 [Account control] {3.6.2.1.4.3.3};
M:4 [MT Call control] {3.6.2.1.4.3.4};
M:5 [Validity control] {3.6.2.1.4.3.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.3.6};
/ / /.4.5.4. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.4.1};
M:2 [Tariff Resolution] {3.6.2.1.4.4.2};
M:3 [Account control] {3.6.2.1.4.4.3};
M:4 [MT Call control] {3.6.2.1.4.4.4};
M:5 [Validity control] {3.6.2.1.4.4.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.4.6};
/ / /.4.5.5. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.5.1};
M:2 [Tariff Resolution] {3.6.2.1.4.5.2};
M:3 [Account control] {3.6.2.1.4.5.3};
M:4 [MT Call control] {3.6.2.1.4.5.4};
M:5 [Validity control] {3.6.2.1.4.5.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.5.6};
/ / /.4.5.6. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.6.1};
M:2 [Tariff Resolution] {3.6.2.1.4.6.2};
M:3 [Account control] {3.6.2.1.4.6.3};
M:4 [MT Call control] {3.6.2.1.4.6.4};
M:5 [Validity control] {3.6.2.1.4.6.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.6.6};
/ / /.4.5.7. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.7.1};
M:2 [Tariff Resolution] {3.6.2.1.4.7.2};
M:3 [Account control] {3.6.2.1.4.7.3};
M:4 [MT Call control] {3.6.2.1.4.7.4};
M:5 [Validity control] {3.6.2.1.4.7.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.7.6};
/ / /.4.5.8. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.8.1};
M:2 [Tariff Resolution] {3.6.2.1.4.8.2};
M:3 [Account control] {3.6.2.1.4.8.3};
M:4 [MT Call control] {3.6.2.1.4.8.4};
M:5 [Validity control] {3.6.2.1.4.8.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.8.6};
/ / /.4.5.9. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.9.1};
M:2 [Tariff Resolution] {3.6.2.1.4.9.2};
M:3 [Account control] {3.6.2.1.4.9.3};
M:4 [MT Call control] {3.6.2.1.4.9.4};
M:5 [Validity control] {3.6.2.1.4.9.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.9.6};
/ / /.4.5.10. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.10.1};
M:2 [Tariff Resolution] {3.6.2.1.4.10.2};
M:3 [Account control] {3.6.2.1.4.10.3};
M:4 [MT Call control] {3.6.2.1.4.10.4};
M:5 [Validity control] {3.6.2.1.4.10.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.10.6};
/ / /.4.5.11. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.11.1};
M:2 [Tariff Resolution] {3.6.2.1.4.11.2};
M:3 [Account control] {3.6.2.1.4.11.3};
M:4 [MT Call control] {3.6.2.1.4.11.4};
M:5 [Validity control] {3.6.2.1.4.11.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.11.6};
/ / /.4.5.12. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.12.1};
M:2 [Tariff Resolution] {3.6.2.1.4.12.2};
M:3 [Account control] {3.6.2.1.4.12.3};
M:4 [MT Call control] {3.6.2.1.4.12.4};
M:5 [Validity control] {3.6.2.1.4.12.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.12.6};
/ / /.4.5.13. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.13.1};
M:2 [Tariff Resolution] {3.6.2.1.4.13.2};
M:3 [Account control] {3.6.2.1.4.13.3};
M:4 [MT Call control] {3.6.2.1.4.13.4};
M:5 [Validity control] {3.6.2.1.4.13.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.13.6};
/ / /.4.5.14. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.14.1};
M:2 [Tariff Resolution] {3.6.2.1.4.14.2};
M:3 [Account control] {3.6.2.1.4.14.3};
M:4 [MT Call control] {3.6.2.1.4.14.4};
M:5 [Validity control] {3.6.2.1.4.14.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.14.6};
/ / /.4.5.15. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.15.1};
M:2 [Tariff Resolution] {3.6.2.1.4.15.2};
M:3 [Account control] {3.6.2.1.4.15.3};
M:4 [MT Call control] {3.6.2.1.4.15.4};
M:5 [Validity control] {3.6.2.1.4.15.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.15.6};
/ / /.4.5.16. (9);
M:1 [Recharge Promotion] {3.6.2.1.4.16.1};
M:2 [Tariff Resolution] {3.6.2.1.4.16.2};
M:3 [Account control] {3.6.2.1.4.16.3};
M:4 [MT Call control] {3.6.2.1.4.16.4};
M:5 [Validity control] {3.6.2.1.4.16.5};
M:6 [SM Inquiry Notification] {3.6.2.1.4.16.6};
##PPS->call routing to VMS
/ / /.4.6. (9);
M:1 [VMS service number-PLMN] {3.6.2.1.5.1};
M:2 [VMS service number-PSTN] {3.6.2.1.5.2};
M:3 [VMS leave message number] {3.6.2.1.5.3};
M:4 [Routing rule] {3.6.2.1.5.4};
M:5 [VMS user segments] {3.6.2.1.5.5};
##PPS->Status
/ / /.4.7. (9);
M:1 [Activaion] {3.6.2.1.6.1};
M:2 [Command] {3.6.2.1.6.2};
##PPS->Platform
/ / /.4.8. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
M:4 [SMPP] {2.3.4}
##PPS->Platform->MTP3
/ / /.4.8.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##PPS->Platform->MTP3->Status
/ / /.4.8.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##PPS->Platform->SCCP
/ / /.4.8.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##PPS->Platform->XAPP
/ / /.4.8.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##PPS-->Platform->SMPP
/ / /.4.8.4. (9);
M:1 [SMPP_Link_Param] {2.3.4.2.1};
M:2 [Command] {2.3.4.3.2};
## SMSC
/ / /.5. (9);
M:1 [CDR flag] {3.5.2.1.1};
M:2 [SM Validity] {3.5.2.1.2};
M:3 [MSISDN Segment] {3.5.2.1.3};
M:4 [SMPP parameters] {3.5.2.2};
M:5 [Command] {3.5.3.3};
M:6 [Platform] {2};
M:7 [SMSC0] {3.5};
M:8 [SMSC1] {3.5};
##SMSC->Platform
/ / /.5.6. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
M:4 [SMPP] {2.3.4};
##SMSC->Platform->MTP3
/ / /.5.6.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##SMSC->Platform->MTP3->Status
/ / /.5.6.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##SMSC->Platform->SCCP
/ / /.5.6.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##SMSC->Platform->XAPP
/ / /.5.6.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##SMSC->Platform->SMPP
/ / /.5.6.4. (9);
M:1 [SMPP_Link_Param] {2.3.4.2.1};
M:2 [Command] {2.3.4.3.2};
##SMSC->SMSC0
/ / /.5.7. (1);
M:1 [SMSC ID] {3.5.3.1};
M:2 [Software version] {3.5.3.2};
##SMSC->SMSC1
/ / /.5.8. (2);
M:1 [SMSC ID] {3.5.3.1};
M:2 [Software version] {3.5.3.2};
##AUC
/ / /.6. (9);
M:1 [Platform] {2};
M:2 [AUC0] (1) {3.4};
M:3 [AUC1] (2) {3.4};
##AUC->Platform
/ / /.6.1. (9);
M:1 [MTP3] {2.2.2};
M:2 [SCCP] {2.2.3};
M:3 [XAPP] {2.2.5};
##AUC->Platform->MTP3
/ / /.6.1.1. (9);
M:1 [Network Indicator] {2.2.2.2.2};
M:2 [Originating Point code] {2.2.2.2.3};
M:3 [Link Set] {2.2.2.2.4};
M:4 [Link] {2.2.2.2.5};
M:5 [Routing] {2.2.2.2.6};
M:6 [CAN] {2.2.2.2.7};
M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##AUC->Platform->MTP3->Status
/ / /.6.1.1.7. (9);
M:1 [Link status] {2.2.2.3.1};
M:2 [Link set status] {2.2.2.3.2};
M:3 [International routing] {2.2.2.3.3};
M:4 [International spare] {2.2.2.3.4};
M:5 [National routing] {2.2.2.3.5};
M:6 [National spare routing] {2.2.2.3.6};
M:7 [Command] {2.2.2.3.7};
##AUC->Platform->SCCP
/ / /.6.1.2. (9);
M:1 [Local node] {2.2.3.2.1};
M:2 [GTT] {2.2.3.2.2};
M:3 [Command] {2.2.3.3.2};
##AUC->Platform->XAPP
/ / /.6.1.3. (9);
M:1 [MCC] {2.2.5.2.1};
M:2 [MNC] {2.2.5.2.2};
M:3 [CC] {2.2.5.2.3};
M:4 [NDC] {2.2.5.2.4};
M:5 [International prefix] {2.2.5.2.5};
M:6 [National Prefix] {2.2.5.2.6};
M:7 [Local Prefix] {2.2.5.2.7};
M:8 [Convert Prefix] {2.2.5.2.8};
M:9 [Command] {2.2.5.3.2};
##EIR
##/ / /.7. (9);
##M:1 [Platform] {2};
##M:2 [EIR0] (1) {3.8};
##M:3 [EIR1] (2) {3.8};
##EIR->Platform
##/ / /.7.1. (9);
##M:1 [MTP3] {2.2.2};
##M:2 [SCCP] {2.2.3};
##M:3 [XAPP] {2.2.5};
##EIR->Platform->MTP3
##/ / /.7.1.1. (9);
##M:1 [Network Indicator] {2.2.2.2.2};
##M:2 [Originating Point code] {2.2.2.2.3};
##M:3 [Link Set] {2.2.2.2.4};
##M:4 [Link] {2.2.2.2.5};
##M:5 [Routing] {2.2.2.2.6};
##M:6 [CAN] {2.2.2.2.7};
##M:7 [Status] {2.2.2.3};
M:8 [Signaling GateWay] {2.2.2.2.9};
##EIR->Platform->MTP3->Status
##/ / /.7.1.1.7. (9);
####M:1 [Link status] {2.2.2.3.1};
##M:2 [Link set status] {2.2.2.3.2};
##M:3 [International routing] {2.2.2.3.3};
##M:4 [International spare] {2.2.2.3.4};
##M:5 [National routing] {2.2.2.3.5};
##M:6 [National spare routing] {2.2.2.3.6};
##M:7 [Command] {2.2.2.3.7};
##EIR->Platform->SCCP
##/ / /.7.1.2. (9);
##M:1 [Local node] {2.2.3.2.1};
##M:2 [GTT] {2.2.3.2.2};
##M:3 [Command] {2.2.3.3.2};
##EIR->Platform->XAPP
##/ / /.7.1.3. (9);
##M:1 [MCC] {2.2.5.2.1};
##M:2 [MNC] {2.2.5.2.2};
##M:3 [CC] {2.2.5.2.3};
##M:5 [International prefix] {2.2.5.2.5};
##M:6 [National Prefix] {2.2.5.2.6};
##M:7 [Local Prefix] {2.2.5.2.7};
##M:8 [Convert Prefix] {2.2.5.2.8};
##M:9 [Command] {2.2.5.3.2};

View File

@@ -0,0 +1,14 @@
// "//" is the annotation characters;
IWV-SMI.txt
Special_App-SMI.txt
//PPPRT-MIB.txt
WXC2-SMI.txt
//WXC2-CSU-MIB.txt
WXC2-SS7-MIB.txt
WXC2-MSC-MIB.txt
WXC2-HLR-MIB.txt
WXC2-AUC-MIB.txt
//WXC2-EIR-MIB.txt
WXC2-SMSC-MIB.txt
WXC2-PPS-MIB.txt
WXC2-MSS-MIB.txt

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
594694911035

View File

@@ -0,0 +1,16 @@
******************
* HELP PAGE *
******************
Welcome to DEBUG MONITOR.
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
In "SUB MODULE SELECTION PAGE",
Press 'x' or 'X' to return "HELP PAGE",
Press 'a-p' or 'A-P' to select sub module.
In each sub module,
Press '0-9' and 'a-f' to select pages.
$

View File

@@ -0,0 +1,25 @@
#ipconfig for pps
4950=UDP,6,DIRECT
4951=UDP,0,BUFFER
4952=UDP,0,BUFFER
4953=UDP,0,BUFFER
4954=UDP,0,BUFFER
4955=UDP,3,BUFFER
4956=UDP,0,BUFFER
4957=UDP,4,BUFFER
4958=UDP,0,BUFFER
4959=UDP,0,BUFFER
4960=UDP,0,BUFFER
4961=UDP,0,BUFFER
4962=UDP,0,BUFFER
4963=UDP,0,BUFFER
4964=UDP,0,BUFFER
4965=TCP,6,BUFFER
4966=UDP,2,DIRECT
4967=UDP,0,BUFFER
4968=UDP,0,BUFFER
4969=UDP,0,BUFFER
4970=UDP,0,BUFFER
4971=UDP,0,BUFFER
4972=UDP,0,BUFFER
4973=UDP,0,BUFFER

View File

@@ -0,0 +1,22 @@
*********************************
* SUB MODULE SELECTION PAGE *
*********************************
a -- IPTR i -- HLR
b -- MTP3 j -- SMSC
c -- SCCP k -- SCF
d -- TCAP l -- SNMP
e -- XAP-P m -- DATA SYNC
f -- CCF n -- DEBUG
g -- VLR o -- reserved
h -- SSF p -- SMPP

1408
plat/smpp/ut/conf/mtp3.conf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
#SCCP Config file (R3_V1_T07)
#copy this file to /etc/sccp.conf to set global options
[Local Node]
#ssn NetID msisdn ip0 ip1
4 2 236060011 172.18.128.1 172.18.129.1
10 2 2360620103 172.18.98.1 172.18.99.1
21 2 2360620104 172.18.166.1 172.18.167.1
62 2 100 172.18.145.1 172.18.128.1
[GTT_Table]
#No NP StartDigits EndDigits NetID SPC SSN RI S E N ReplaceDigits
0 1 236060000 236069999 2 002808 6 1
1 1 236090000 236099999 2 002808 6 1
2 6 623045200000000 623045299999999 2 002808 6 1
3 1 236060013 236060013 3 222222 22 1
4 1 236060014 236060014 3 232323 22 1
5 1 100 299 2 888888 62 0
[RL_SSN]
#Subsystems needed to be detected frequently
#NetID DPC SSN

View File

@@ -0,0 +1,35 @@
#SMPP Config file (R10V0_13)
#Copy this file to ./conf/smpp.conf to set global options
#No lkEn lkType serverType sessionType sysID pwd sysType LGTT RGTT LIP RIP sessionTimer enqTimer inactTimer rspTimer ServiceNum
0 1 1 0 2 Test1 123456 -- -- -- 172.18.128.1 172.18.98.1 5 10 5 5 86755001
1 1 1 1 2 Test2 123456 -- -- -- 172.18.128.1 172.18.98.1 5 10 5 5 86755002
2 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
3 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
4 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
5 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
6 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
7 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
8 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
9 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
10 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
11 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
12 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
13 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
14 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
15 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
16 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
17 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
18 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
19 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
20 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
21 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
22 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
23 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
24 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
25 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
26 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
27 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
28 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
29 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
30 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --
31 0 0 0 0 Test 123456 GSM -- -- 0.0.0.0 0.0.0.0 5 10 5 5 --

View File

@@ -0,0 +1,688 @@
/*
** CDMA 2000 project, SMPP module
**
** File name: smpp_test.c
** Written by Li Long at 2004-11-25
** CVS $Id: smpp_test.c,v0.1 2004/11/25 17:03:14 lilong Exp $
**
*/
#include "./include/smpp.h"
#define SD_PKT_NUM 10
#define STORE_MSG_ITEM 5
typedef struct SMPP_MSG_STORE_STRUCT
{
BYTE short_message[SMPP_MSG_LEN];
BYTE message_id[65];
} SMPP_MSG_STORE_STRUCT;
typedef struct SMPP_LINK_ATTRIBUTE
{
BYTE enable;
BYTE session_type; //BIND_TX/BIND_RX/BIND_TRX
BYTE message_mode; //STORE AND FORWARD/DATAGRAM/TRANSACTION
BYTE terminal_type; //SMPP_CLIENT/SMPP_SERVER
} SMPP_LINK_ATTRIBUTE;
static struct itimerval itimer,old_itimer;
static int timer_counter[MAX_SMPP_LINK];
static int stateFlag[MAX_SMPP_LINK];
static int msg_count[MAX_SMPP_LINK];
static int msg_pointer[MAX_SMPP_LINK];
static SMPP_MSG_STORE_STRUCT store_msg_buf[MAX_SMPP_LINK][STORE_MSG_ITEM];
static SMPP_LINK_ATTRIBUTE smpp_link_attr[MAX_SMPP_LINK];
static void On_Timer();
static void SetTimer();
static void smpp_test_init();
static void sendTestSM(int, int);
static int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pData, WORD dataLen);
static int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate);
void smpp_test_init()
{
int i;
for (i=0; i<MAX_SMPP_LINK; i++)
{
memset(store_msg_buf[i], 0, sizeof(SMPP_MSG_STORE_STRUCT)*STORE_MSG_ITEM);
msg_pointer[i] = 0;
}
}
int main(int argc,char *argv[])
{
pid_t pid;
int i, ch;
BYTE link, ret;
unsigned char tx_service_number[8], rx_service_number[8];
unsigned char store_and_forward_service_number[8];
heartbeat_init(0xFFFF);
// #ifdef SMPP_DEBUG
debug_init();
// #endif
iptrMainInit();
snmp_init(SMPP_PORT);
mtp_shm_init();
sccp_init();
smpp_init_new();
smpp_test_init();
for (i=0; i<MAX_SMPP_LINK; i++)
{
stateFlag[i] = FALSE;
timer_counter[i]= 0;
msg_count[i] = 0;
}
opterr = 0;
strcpy(tx_service_number, "9910");
strcpy(rx_service_number, "9920");
strcpy(store_and_forward_service_number, "6666");
while( (ch = getopt(argc, argv, "scabd")) != -1 )
{
switch (ch)
{
case 's':
ret = smpp_registerLink(SMPP_SERVER, BIND_TX, tx_service_number, DATAGRAM);
if ((ret&0x80) == 0x80) {
link = ret&0x7f;
printf("(TX) session_type = %d, linkNo=%d\n", BIND_TX, link);
smpp_attach_link(link, smpp_onDataRecv, smpp_onLinkStateChange);
smpp_link_attr[link].enable = 1;
smpp_link_attr[link].session_type = BIND_TX;
smpp_link_attr[link].message_mode = DATAGRAM;
smpp_link_attr[link].terminal_type = SMPP_SERVER;
}
break;
case 'c':
ret = smpp_registerLink(SMPP_CLIENT, BIND_TX, tx_service_number, DATAGRAM);
if ((ret&0x80) == 0x80) {
link = ret&0x7f;
printf("(TX) session_type = %d, linkNo=%d\n", BIND_TX, link);
smpp_attach_link(link, smpp_onDataRecv, smpp_onLinkStateChange);
smpp_link_attr[link].enable = 1;
smpp_link_attr[link].session_type = BIND_TX;
smpp_link_attr[link].message_mode = DATAGRAM;
smpp_link_attr[link].terminal_type = SMPP_CLIENT;
}
break;
case 'a':
ret = smpp_registerLink(SMPP_CLIENT, BIND_RX, rx_service_number, DATAGRAM);
if ((ret&0x80) == 0x80) {
link = ret&0x7f;
printf("(RX) session_type = %d, linkNo=%d\n", BIND_RX, link);
smpp_attach_link(link, smpp_onDataRecv, smpp_onLinkStateChange);
smpp_link_attr[link].enable = 1;
smpp_link_attr[link].session_type = BIND_RX;
smpp_link_attr[link].message_mode = DATAGRAM;
smpp_link_attr[link].terminal_type = SMPP_CLIENT;
}
break;
case 'b':
ret = smpp_registerLink(SMPP_SERVER, BIND_RX, rx_service_number, DATAGRAM);
if ((ret&0x80) == 0x80) {
link = ret&0x7f;
printf("(RX) session_type = %d, linkNo=%d\n", BIND_RX, link);
smpp_attach_link(link, smpp_onDataRecv, smpp_onLinkStateChange);
smpp_link_attr[link].enable = 1;
smpp_link_attr[link].session_type = BIND_RX;
smpp_link_attr[link].message_mode = DATAGRAM;
smpp_link_attr[link].terminal_type = SMPP_SERVER;
}
break;
case 'd':
if ((pid=fork())!=0) exit(0);
setsid();
break;
default:
break;
}
}
SetTimer();
while(1)
{
usleep(50);
}
return 1;
}
void On_Timer()
{
int i;
for (i=0; i<MAX_SMPP_LINK; i++)
{ // 2 msgs per second
if (timer_counter[i]==25)
timer_counter[i]=0;
if ((timer_counter[i]%25)==0)
{
if (stateFlag[i] == TRUE)
{
if ( (smpp_link_attr[i].session_type == BIND_TX) && (smpp_link_attr[i].terminal_type == SMPP_CLIENT) )
{
sendTestSM(i, 0);
msg_count[i]++;
}
if ( (smpp_link_attr[i].session_type == BIND_RX) && (smpp_link_attr[i].terminal_type == SMPP_SERVER) )
{
sendTestSM(i, 1);
msg_count[i]++;
}
if (smpp_link_attr[i].session_type == BIND_TRX)
{
sendTestSM(i, 2);
msg_count[i]++;
}
}
}
timer_counter[i]++;
if (msg_count[i] == SD_PKT_NUM)
{
smpp_close(i);
}
}
iptrans_timer();
// #ifdef SMPP_DEBUG
debug_rt();
// #endif //end ifdef SMPP_DEBUG
snmp_timer();
mtp3_proc();
heartbeat_timer();
sccp_timer();
smpp_fsm();
}
void SetTimer()
{
struct sigaction act;
act.sa_handler=On_Timer;
sigemptyset(&act.sa_mask);
act.sa_flags=0;
if(sigaction(SIGALRM,&act,NULL)<0)
{
perror("Produce Sigaction");
exit(1);
}
itimer.it_interval.tv_sec=0;
itimer.it_interval.tv_usec=20*1000;
itimer.it_value.tv_sec=0;
itimer.it_value.tv_usec=20*1000;
if (setitimer(ITIMER_REAL,&itimer,&old_itimer) !=0 )
{
printf("Setting Timer error! \n");
exit(1);
}
}
int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pMsg, WORD dataLen)
{
int sequence_number=100;
SMPP_MSG smpp_msg;
int pointer;
int i;
switch (pMsg->message_type)
{
case 0x0B: /* SUBMIT SM */
printf("[TEST PROGRAM]Link %d received SUBMIT SM:\n", linkNo);
/* store smpp message */
if (smpp_link_attr[linkNo].message_mode == STORE_AND_FORWARD)
{
//if (pMsg->pdu.submit_sm.sm_length < SMPP_MSG_LEN)
{
pointer = (msg_pointer[linkNo]+1)%STORE_MSG_ITEM;
memcpy(&store_msg_buf[linkNo][pointer].short_message,
pMsg->pdu.submit_sm.short_message, pMsg->pdu.submit_sm.sm_length);
sprintf(store_msg_buf[linkNo][pointer].message_id,
"%ld", pMsg->pdu.submit_sm.head.sequence_number);
}
}
/* fill with SUBMIT SM RESP structure. */
smpp_msg.message_type = 0x0C;
smpp_msg.pdu.submit_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.submit_sm_resp.head.sequence_number = pMsg->pdu.submit_sm.head.sequence_number;
sprintf(smpp_msg.pdu.submit_sm_resp.message_id, "%ld",
smpp_msg.pdu.submit_sm_resp.head.sequence_number);
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x0C: /* SUBMIT SM RESP */
printf("[TEST PROGRAM]Link %d received SUBMIT SM RESP.\n", linkNo);
break;
case 0x0D: /* SUBMIT MULTI */
printf("[TEST PROGRAM]Link %d received SUBMIT MULTI.\n", linkNo);
/* store smpp message */
if (smpp_link_attr[linkNo].message_mode == STORE_AND_FORWARD)
{
//if (pMsg->pdu.submit_multi.sm_length < SMPP_MSG_LEN)
{
pointer = (msg_pointer[linkNo]+1)%STORE_MSG_ITEM;
memcpy(&store_msg_buf[linkNo][pointer].short_message,
pMsg->pdu.submit_sm.short_message, pMsg->pdu.submit_multi.sm_length);
sprintf(store_msg_buf[linkNo][pointer].message_id,
"%ld", pMsg->pdu.submit_multi.head.sequence_number);
}
}
/* fill with SUBMIT MULTI RESP structure. */
smpp_msg.message_type = 0x0E;
smpp_msg.pdu.submit_multi_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.submit_multi_resp.head.sequence_number = pMsg->pdu.submit_multi.head.sequence_number;
sprintf(smpp_msg.pdu.submit_multi_resp.message_id, "%ld",
smpp_msg.pdu.submit_multi_resp.head.sequence_number);
smpp_msg.pdu.submit_multi_resp.no_unsuccess = 0;
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x0E: /* SUBMIT MULTI RESP */
printf("[TEST PROGRAM]Link %d received SUBMIT MULTI RESP.\n", linkNo);
break;
case 0x0F: /* DELIVER SM */
printf("[TEST PROGRAM]Link %d received DELIVER SM.\n", linkNo);
/* store smpp message */
if (smpp_link_attr[linkNo].message_mode == STORE_AND_FORWARD)
{
//if (pMsg->pdu.deliver_sm.sm_length < SMPP_MSG_LEN)
{
pointer = (msg_pointer[linkNo]+1)%STORE_MSG_ITEM;
memcpy(&store_msg_buf[linkNo][pointer].short_message,
pMsg->pdu.deliver_sm.short_message, pMsg->pdu.deliver_sm.sm_length);
sprintf(store_msg_buf[linkNo][pointer].message_id,
"%ld", pMsg->pdu.deliver_sm.head.sequence_number);
}
}
/* fill with DELIVER SM RESP structure. */
smpp_msg.message_type = 0x10;
smpp_msg.pdu.deliver_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.deliver_sm_resp.head.sequence_number = pMsg->pdu.deliver_sm.head.sequence_number;
smpp_msg.pdu.deliver_sm_resp.message_id = 0x0;
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x10: /* DELIVER SM RESP */
printf("[TEST PROGRAM]Link %d received DELIVER SM RESP.\n", linkNo);
break;
case 0x11: /* DATA SM */
printf("[TEST PROGRAM]Link %d received DATA SM.\n", linkNo);
/* store smpp message */
if (smpp_link_attr[linkNo].message_mode == STORE_AND_FORWARD)
{
if (strlen(pMsg->pdu.data_sm.message_payload) < SMPP_MSG_LEN)
{
pointer = (msg_pointer[linkNo]+1)%STORE_MSG_ITEM;
memcpy(&store_msg_buf[linkNo][pointer].short_message,
pMsg->pdu.data_sm.message_payload, strlen(pMsg->pdu.data_sm.message_payload));
sprintf(store_msg_buf[linkNo][pointer].message_id,
"%ld", pMsg->pdu.data_sm.head.sequence_number);
}
}
/* fill with DATA SM RESP structure. */
smpp_msg.message_type = 0x12;
smpp_msg.pdu.data_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.data_sm_resp.head.sequence_number = pMsg->pdu.data_sm.head.sequence_number;
sprintf(smpp_msg.pdu.data_sm_resp.message_id, "%ld",
smpp_msg.pdu.data_sm_resp.head.sequence_number);
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x12: /* DATA SM RESP */
printf("[TEST PROGRAM]Link %d received DATA SM RESP.\n", linkNo);
break;
case 0x13: /* QUERY SM */
printf("[TEST PROGRAM]Link %d received QUERY SM.\n", linkNo);
pointer = -1;
for (i=0; i<STORE_MSG_ITEM; i++)
{
if (strcmp(store_msg_buf[linkNo][i].message_id, pMsg->pdu.query_sm.message_id) == 0)
{
pointer = i;
break;
}
}
/* fill with QUERY SM RESP structure */
smpp_msg.message_type = 0x14;
smpp_msg.pdu.query_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.query_sm_resp.head.sequence_number = pMsg->pdu.query_sm.head.sequence_number;
sprintf(smpp_msg.pdu.query_sm_resp.message_id, "%ld",
smpp_msg.pdu.query_sm_resp.head.sequence_number);
smpp_msg.pdu.query_sm_resp.final_date[0] = 0x0;
if (pointer == -1)
{
smpp_msg.pdu.query_sm_resp.message_state = 0x04;
}
else
{
smpp_msg.pdu.query_sm_resp.message_state = 0x02;
}
smpp_msg.pdu.query_sm_resp.error_code = 0x0;
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x14: /* QUERY SM RESP */
printf("[TEST PROGRAM]Link %d received QUERY SM RESP.\n", linkNo);
break;
case 0x15: /* CANCEL SM */
printf("[TEST PROGRAM]Link %d received CANCEL SM RESP.\n", linkNo);
pointer = -1;
if (pMsg->pdu.cancel_sm.message_id[0] == 0){
memset(store_msg_buf[linkNo], 0, sizeof(SMPP_MSG_STORE_STRUCT)*STORE_MSG_ITEM);
msg_pointer[linkNo] = 0;
smpp_msg.pdu.cancel_sm_resp.head.command_status = htonl(ESME_ROK);
}else{
for (i=0; i<STORE_MSG_ITEM; i++)
{
printf("[TEST program]message id in query sm=%s, message id in store message=%s",
pMsg->pdu.cancel_sm.message_id, store_msg_buf[linkNo][i].message_id);
if (strcmp(store_msg_buf[linkNo][i].message_id, pMsg->pdu.cancel_sm.message_id) == 0)
{
pointer = i;
break;
}
}
if (pointer == -1)
{
smpp_msg.pdu.cancel_sm_resp.head.command_status = htonl(ESME_RCANCELFAIL);
}else{
smpp_msg.pdu.cancel_sm_resp.head.command_status = htonl(ESME_ROK);
}
}
/* fill with CANCEL SM RESP structure */
smpp_msg.message_type = 0x16;
smpp_msg.pdu.cancel_sm_resp.head.sequence_number = pMsg->pdu.cancel_sm.head.sequence_number;
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x16: /* CANCEL SM RESP */
printf("[TEST PROGRAM]Link %d received CANCEL RESP.\n", linkNo);
break;
case 0x17: /* REPLACE SM */
printf("[TEST PROGRAM]Link %d received REPLACE SM.\n", linkNo);
pointer = -1;
for (i=0; i<STORE_MSG_ITEM; i++)
{
if (strcmp(store_msg_buf[linkNo][i].message_id, pMsg->pdu.replace_sm.message_id) == 0)
{
pointer = i;
break;
}
}
/* store new smpp message */
if (pointer != -1)
{
//if (pMsg->pdu.replace_sm.sm_length < SMPP_MSG_LEN)
{
memcpy(&store_msg_buf[linkNo][pointer].short_message,
pMsg->pdu.replace_sm.short_message, pMsg->pdu.replace_sm.sm_length);
}
}
/* fill with REPLACE SM RESP structure */
smpp_msg.message_type = 0x18;
if (pointer == -1)
{
smpp_msg.pdu.replace_sm_resp.head.command_status = htonl(ESME_RREPLACEFAIL);
}
else
{
smpp_msg.pdu.replace_sm_resp.head.command_status = htonl(ESME_ROK);
}
smpp_msg.pdu.replace_sm_resp.head.sequence_number = pMsg->pdu.replace_sm.head.sequence_number;
smpp_send(linkNo, &smpp_msg, dataLen);
break;
case 0x18: /* REPLACE SM RESP */
printf("[TEST PROGRAM]Link %d received REPLACE SM RESP.\n", linkNo);
break;
default:
return 0;
}
return sequence_number;
}
int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate)
{
printf("[TEST PROGRAM]link %d state change to %d\n",linkNo, linkstate);
if (linkstate == 1)
stateFlag[linkNo] = TRUE;
else
stateFlag[linkNo] = FALSE;
return linkNo;
}
//0-submit_sm, 1-deliver_sm, 2-data_sm
void sendTestSM(int linkNo, int msg_type)
{
SMPP_MSG smpp_msg;
WORD dataLen;
memset(&smpp_msg, 0, sizeof(SMPP_MSG));
switch (msg_type)
{
case 0: //send submit sm
smpp_msg.message_type = 0x0B;
smpp_msg.optional_param_flag1 = 0x0FF67FFF;
smpp_msg.optional_param_flag2 = 0x0;
//Mandatory parameters.
strcpy(smpp_msg.pdu.submit_sm.service_type, "USSD");
smpp_msg.pdu.submit_sm.source_addr_ton = 0x2; //National
smpp_msg.pdu.submit_sm.source_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.submit_sm.source_addr, "172.18.166.1");
smpp_msg.pdu.submit_sm.dest_addr_ton = 0x2; //National
smpp_msg.pdu.submit_sm.dest_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.submit_sm.destination_addr, "13923482085");
smpp_msg.pdu.submit_sm.esm_class = 0x00;
smpp_msg.pdu.submit_sm.protocol_id = 0x0;
smpp_msg.pdu.submit_sm.priority_flag = 0x3;
strcpy(smpp_msg.pdu.submit_sm.schedule_delivery_time, "041231151200000R");
strcpy(smpp_msg.pdu.submit_sm.validity_period, "041231151200000+");
smpp_msg.pdu.submit_sm.registered_delivery = 0x11;
smpp_msg.pdu.submit_sm.replace_if_present_flag = 0x01;
smpp_msg.pdu.submit_sm.data_coding = 0x07;
smpp_msg.pdu.submit_sm.sm_default_msg_id = 0x01;
smpp_msg.pdu.submit_sm.sm_length = 0x0;
strcpy(smpp_msg.pdu.submit_sm.short_message, "");
//Optional parameters.
smpp_msg.pdu.submit_sm.user_message_reference = 0x00;
smpp_msg.pdu.submit_sm.source_port = 0x6666;
smpp_msg.pdu.submit_sm.source_addr_subunit = 0x01;
smpp_msg.pdu.submit_sm.destination_port = 0x8888;
smpp_msg.pdu.submit_sm.dest_addr_subunit = 0x02;
smpp_msg.pdu.submit_sm.sar_msg_ref_num = 0x7700;
smpp_msg.pdu.submit_sm.sar_total_segments = 0x01;
smpp_msg.pdu.submit_sm.sar_segment_seqnum = 0x01;
smpp_msg.pdu.submit_sm.more_messages_to_send = 0x01;
smpp_msg.pdu.submit_sm.payload_type = 0x00;
strcpy(smpp_msg.pdu.submit_sm.message_payload, "messae in submit sm optional");
smpp_msg.pdu.submit_sm.privacy_indicator = 0x03;
//strcpy(smpp_msg.pdu.submit_sm.callback_num, "F0453245");
smpp_msg.pdu.submit_sm.callback_num[0] = 0x01; //ASCII
smpp_msg.pdu.submit_sm.callback_num[1] = 0x02; //National
smpp_msg.pdu.submit_sm.callback_num[2] = 0x03; //Data
strcpy(smpp_msg.pdu.submit_sm.callback_num+3, "F0453245");
smpp_msg.pdu.submit_sm.callback_num_pres_ind = 0x06;
strcpy(smpp_msg.pdu.submit_sm.callback_num_atag, "callback_num_atag");
//strcpy(smpp_msg.pdu.submit_sm.source_subaddress, "123");
//smpp_msg.pdu.submit_sm.source_subaddress[0] = 0x88;
//strcpy(smpp_msg.pdu.submit_sm.source_subaddress+1,"123");
//smpp_msg.pdu.submit_sm.dest_subaddress[0] = 0x88;
//strcpy(smpp_msg.pdu.submit_sm.dest_subaddress+1, "789");
smpp_msg.pdu.submit_sm.user_response_code = 0x03;
smpp_msg.pdu.submit_sm.display_time = 0x02;
//smpp_msg.pdu.submit_sm.sms_signal = 0x03;
smpp_msg.pdu.submit_sm.ms_validity = 0x03;
smpp_msg.pdu.submit_sm.ms_msg_wait_facilities = 0x03;
smpp_msg.pdu.submit_sm.number_of_messages = 0x03;
smpp_msg.pdu.submit_sm.alert_on_message_delivery = 0x03;
smpp_msg.pdu.submit_sm.language_indicator = 0x01;
smpp_msg.pdu.submit_sm.its_reply_type = 0x03;
smpp_msg.pdu.submit_sm.its_session_info[0] = 0x01;
smpp_msg.pdu.submit_sm.its_session_info[1] = 0x53;
smpp_msg.pdu.submit_sm.ussd_service_op = 0x03;
break;
case 1: //send deliver sm
smpp_msg.message_type = 0x0F;
smpp_msg.optional_param_flag1 = 0x000167FF;
smpp_msg.optional_param_flag2 = 0x0;
//Mandatory parameters.
strcpy(smpp_msg.pdu.deliver_sm.service_type, "USSD");
smpp_msg.pdu.deliver_sm.source_addr_ton = 0x2; //National
smpp_msg.pdu.deliver_sm.source_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.deliver_sm.source_addr, "172.18.166.1");
smpp_msg.pdu.deliver_sm.dest_addr_ton = 0x2; //National
smpp_msg.pdu.deliver_sm.dest_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.deliver_sm.destination_addr, "13923482085");
smpp_msg.pdu.deliver_sm.esm_class = 0x00;
smpp_msg.pdu.deliver_sm.protocol_id = 0x0;
smpp_msg.pdu.deliver_sm.priority_flag = 0x3;
smpp_msg.pdu.deliver_sm.schedule_delivery_time = 0x0;
smpp_msg.pdu.deliver_sm.validity_period = 0x0;
smpp_msg.pdu.deliver_sm.registered_delivery = 0x12;
smpp_msg.pdu.deliver_sm.replace_if_present_flag = 0x01;
smpp_msg.pdu.deliver_sm.data_coding = 0x07;
smpp_msg.pdu.deliver_sm.sm_default_msg_id = 0x01;
smpp_msg.pdu.deliver_sm.sm_length = 0x0;
strcpy(smpp_msg.pdu.deliver_sm.short_message, "");
//Optional parameters.
smpp_msg.pdu.deliver_sm.user_message_reference = 0x00;
smpp_msg.pdu.deliver_sm.source_port = 0x6666;
smpp_msg.pdu.deliver_sm.destination_port = 0x8888;
smpp_msg.pdu.deliver_sm.sar_msg_ref_num = 0x7700;
smpp_msg.pdu.deliver_sm.sar_total_segments = 0x01;
smpp_msg.pdu.deliver_sm.sar_segment_seqnum = 0x01;
smpp_msg.pdu.deliver_sm.user_response_code = 0x03;
smpp_msg.pdu.deliver_sm.privacy_indicator = 0x03;
smpp_msg.pdu.deliver_sm.payload_type = 0x00;
strcpy(smpp_msg.pdu.deliver_sm.message_payload, "messae in deliver sm optional");
smpp_msg.pdu.deliver_sm.callback_num[0] = 0x01; //ASCII
smpp_msg.pdu.deliver_sm.callback_num[1] = 0x02; //National
smpp_msg.pdu.deliver_sm.callback_num[2] = 0x03; //Data
strcpy(smpp_msg.pdu.deliver_sm.callback_num+3, "F0453245");
//smpp_msg.pdu.deliver_sm.source_subaddress[0] = 0xA0;
//smpp_msg.pdu.deliver_sm.source_subaddress[1] = 0x01;
//strcpy(smpp_msg.pdu.deliver_sm.source_subaddress+1, "123");
//smpp_msg.pdu.deliver_sm.dest_subaddress[0] = 0xA0;
//smpp_msg.pdu.deliver_sm.dest_subaddress[1] = 0x01;
//strcpy(smpp_msg.pdu.deliver_sm.dest_subaddress+1, "321");
smpp_msg.pdu.deliver_sm.language_indicator = 0x01;
smpp_msg.pdu.deliver_sm.its_session_info[0] = 0x01;
smpp_msg.pdu.deliver_sm.its_session_info[1] = 0x53;
//smpp_msg.pdu.deliver_sm.network_error_code[0] = 0x03;
//smpp_msg.pdu.deliver_sm.network_error_code[1] = 0x03;
//smpp_msg.pdu.deliver_sm.network_error_code[2] = 0x00;
smpp_msg.pdu.deliver_sm.message_state = 0x01;
//strcpy(smpp_msg.pdu.deliver_sm.receipted_message_id, "receipted message id in deliver sm");
break;
case 2: //data_sm
smpp_msg.message_type = 0x11;
smpp_msg.optional_param_flag1 = 0xB3EBFFFF;
smpp_msg.optional_param_flag2 = 0x0000003F;
//smpp_msg.optional_param_flag1 = 0x0C000000;
//smpp_msg.optional_param_flag2 = 0x0;
//Mandatory parameters.
strcpy(smpp_msg.pdu.data_sm.service_type, "USSD");
smpp_msg.pdu.data_sm.source_addr_ton = 0x2; //National
smpp_msg.pdu.data_sm.source_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.data_sm.source_addr, "172.18.166.1");
smpp_msg.pdu.data_sm.dest_addr_ton = 0x2; //National
smpp_msg.pdu.data_sm.dest_addr_npi = 0x1; //ISDN
strcpy(smpp_msg.pdu.data_sm.destination_addr, "13923482085");
smpp_msg.pdu.data_sm.esm_class = 0x00;
smpp_msg.pdu.data_sm.registered_delivery = 0x11;
smpp_msg.pdu.data_sm.data_coding = 0x07;
//Optional parameters.
smpp_msg.pdu.data_sm.source_port = 0x6666;
smpp_msg.pdu.data_sm.source_addr_subunit = 0x01;
smpp_msg.pdu.data_sm.source_network_type = 0x01;
smpp_msg.pdu.data_sm.source_bearer_type = 0x03;
smpp_msg.pdu.data_sm.source_telematics_id = 0x0003;
smpp_msg.pdu.data_sm.destination_port = 0x8888;
smpp_msg.pdu.data_sm.dest_addr_subunit = 0x03;
smpp_msg.pdu.data_sm.dest_network_type = 0x03;
smpp_msg.pdu.data_sm.dest_bearer_type = 0x03;
smpp_msg.pdu.data_sm.dest_telematics_id = 0x0003;
smpp_msg.pdu.data_sm.sar_msg_ref_num = 0x7700;
smpp_msg.pdu.data_sm.sar_total_segments = 0x01;
smpp_msg.pdu.data_sm.sar_segment_seqnum = 0x01;
smpp_msg.pdu.data_sm.more_messages_to_send = 0x01;
smpp_msg.pdu.data_sm.qos_time_to_live = 0x000000FF;
smpp_msg.pdu.data_sm.payload_type = 0x00;
strcpy(smpp_msg.pdu.data_sm.message_payload, "smpp message in data sm optional");
smpp_msg.pdu.data_sm.set_dpf = 0x01;
//strcpy(smpp_msg.pdu.data_sm.receipted_message_id, "receipted message id");
smpp_msg.pdu.data_sm.message_state = 0x01;
//smpp_msg.pdu.data_sm.network_error_code[0] = 0x03;
//smpp_msg.pdu.data_sm.network_error_code[1] = 0x03;
//smpp_msg.pdu.data_sm.network_error_code[2] = 0x00;
smpp_msg.pdu.data_sm.user_message_reference = 0x00;
smpp_msg.pdu.data_sm.privacy_indicator = 0x03;
smpp_msg.pdu.data_sm.callback_num[0] = 0x01;
smpp_msg.pdu.data_sm.callback_num[1] = 0x02;
smpp_msg.pdu.data_sm.callback_num[2] = 0x03;
strcpy(smpp_msg.pdu.data_sm.callback_num+3, "call back num");
smpp_msg.pdu.data_sm.callback_num_pres_ind = 0x06;
strcpy(smpp_msg.pdu.data_sm.callback_num_atag, "callback num atag in data sm");
smpp_msg.pdu.data_sm.source_subaddress[0] = 0xA0;
smpp_msg.pdu.data_sm.source_subaddress[1] = 0x01;
//strcpy(smpp_msg.pdu.data_sm.source_subaddress+1, "123");
smpp_msg.pdu.data_sm.dest_subaddress[0] = 0xA0;
smpp_msg.pdu.data_sm.dest_subaddress[1] = 0x01;
//strcpy(smpp_msg.pdu.data_sm.dest_subaddress+1, "321");
smpp_msg.pdu.data_sm.user_response_code = 0x03;
smpp_msg.pdu.data_sm.display_time = 0x02;
//smpp_msg.pdu.data_sm.sms_signal = 0x03;
smpp_msg.pdu.data_sm.ms_validity = 0x03;
smpp_msg.pdu.data_sm.ms_msg_wait_facilities = 0x03;
smpp_msg.pdu.data_sm.number_of_messages = 0x03;
smpp_msg.pdu.data_sm.alert_on_message_delivery = 0x03;
smpp_msg.pdu.data_sm.language_indicator = 0x01;
smpp_msg.pdu.data_sm.its_reply_type = 0x03;
smpp_msg.pdu.data_sm.its_session_info[0] = 0x01;
smpp_msg.pdu.data_sm.its_session_info[1] = 0x53;
break;
}
smpp_send(linkNo, &smpp_msg, dataLen);
}

View File

@@ -0,0 +1,948 @@
//--------------------------------------
// USSD EAE write for ussd test
// Author: lw 2006/7/10
//--------------------------------------
#include "./include/smpp.h"
#define ISDN_LEN 9
typedef struct GameSession
{
BYTE LinkNo;
BYTE flag;
BYTE ussd_ref;
BYTE seed[4];
BYTE ssm_state;
BYTE shmsg[256];
BYTE us_prm;
BYTE input[4];
BYTE history[512];
BYTE count;
char msisdn[(ISDN_LEN+1)*2+2];
}
GameSession;
typedef enum _USSD_OP
{
PSSDR = 0 , // MAP_Process_USS_Data request operation
PSSRR = 1 , // MAP_Process_USS_Request request operation
USSRR = 2 , // MAP_USS_Request Request operation
USSNR = 3 , // MAP_USS_Notify Request operation
OPENR = 4 , // open request operation
RELR = 5 , // Release request operation
PSSDA = 6 , // MAP_Process_USS_Data Answer operation
PSSDE = 7 , // MAP_Process_USS_Data error operation
PSSRA = 8 , // MAP_Process_USS_Request Answer operation
PSSRE = 9 , // MAP_Process_USS_Request error operation
USSRA = 10 , // MAP_USS_Request Answer operation
USSRE = 11, // MAP_USS_Request Error operation
USSNA = 12, // MAP_USS_Notify Answer operation
USSNE = 13, // MAP_USS_Notify Error operation
OPENE = 14, // open error operation
RELE = 15, // Release error operation
PSSDS = 16, // MAP_Process_USS_Data confirm operation
PSSRS = 17, // MAP_Process_USS_Request confirm operation
USSRC = 18, // MAP_USS_Request Confirm operation
USSNC = 19, // MAP_USS_Notify Confirm operation
USSRS = 20, // MAP_USS_Request response operation
USSNS = 21, // MAP_USS_Notify response operation
PSSRC = 22, // MAP_Process_USS_Request confirm operation
OPENC = 23, // open confirm operation
RELC = 24, // Release confirm operation
}
USSD_OP;
struct ussd_op
{
char *s;
USSD_OP v;
};
#define USSD_OP_NUM 25
#define USSD_OP_LEN 5
static const struct ussd_op op_map_name[25] = {
{ "PSSDR" , PSSDR }, // 0 MAP_Process_USS_Data request operation
{ "PSSRR" , PSSRR }, // 1 MAP_Process_USS_Request request operation
{ "USSRR" , USSRR }, // 2 MAP_USS_Request Request operation
{ "USSNR" , USSNR }, // 3 MAP_USS_Notify Request operation
{ "OPENR" , OPENR }, // 4 open request operation
{ "RELR " , RELR }, // 5 Release request operation
{ "PSSAE" , PSSDA }, // 6 MAP_Process_USS_Data Answer operation
{ "PSSDE" , PSSDE }, // 7 MAP_Process_USS_Data error operation
{ "PSSRE" , PSSRA }, // 8 MAP_Process_USS_Request Answer operation
{ "PSSRE" , PSSRE }, // 9 MAP_Process_USS_Request error operation
{ "USSRA" , USSRA }, // 10 MAP_USS_Request Answer operation
{ "USSRE" , USSRE }, // 11 MAP_USS_Request Error operation
{ "USSNA" , USSNA }, // 12 MAP_USS_Notify Answer operation
{ "USSNE" , USSNE }, // 13 MAP_USS_Notify Error operation
{ "OPENE" , OPENE }, // 14 open error operation
{ "RELE " , RELE }, // 15 Release error operation
{ "PSSDS" , PSSDS }, // 16 MAP_Process_USS_Data confirm operation
{ "PSSRS" , PSSRS }, // 17 MAP_Process_USS_Request confirm operation
{ "USSRC" , USSRC }, // 18 MAP_USS_Request Confirm operation
{ "USSNC" , USSNC }, // 19 MAP_USS_Notify Confirm operation
{ "USSRS" , USSRS }, // 20 MAP_USS_Request response operation
{ "USSNS" , USSNS }, // 21 MAP_USS_Notify response operation
{ "PSSRC" , PSSRC }, // 22 MAP_Process_USS_Request confirm operation
{ "OPENC" , OPENC }, // 23 open confirm operation
{ "RELC " , RELC }, // 24 Release confirm operation
};
typedef enum US_STATE
{
US_IDLE=0,
US_OPENR,
US_OPENC,
US_OPENE,
US_PSSRR,
US_PSSRA,
US_PSSRE,
US_PSSRC,
US_PSSRS,
US_USSRR,
US_USSRC,
US_USSRS,
US_USSNR,
US_USSNC,
US_USSNS,
US_RELER,
US_RELEC,
US_RELES,
US_RELEE,
}
US_STATE;
#define MAX_GAME_SESSION 255
typedef struct GuessGame
{
BYTE wxc2_hlr_number[8];
char service_number[8];
BYTE link_enable;
BYTE link;
}GuessGame;
GuessGame gg;
struct GameSession ssm_data[MAX_GAME_SESSION];
#define SD_PKT_NUM 10
#define STORE_MSG_ITEM 60
typedef struct SMPP_MSG_STORE_STRUCT
{
BYTE short_message[SMPP_MSG_LEN];
BYTE message_id[65];
} SMPP_MSG_STORE_STRUCT;
#define MAX_GAME_LINK 1
static struct itimerval itimer,old_itimer;
static int timer_counter[MAX_GAME_LINK];
static int stateFlag[MAX_GAME_LINK];
static int msg_count[MAX_GAME_LINK];
static int msg_pointer[MAX_GAME_LINK];
static SMPP_MSG_STORE_STRUCT store_msg_buf[MAX_GAME_LINK][STORE_MSG_ITEM];
static void On_Timer();
static void SetTimer();
static void smpp_test_init();
static int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pData, WORD dataLen);
static int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate);
BYTE hae_isdn_ston(BYTE *normal_isdn,BYTE *str_isdn)
{
BYTE ii;
BYTE len;
len = strlen(str_isdn);
if (len > ISDN_LEN*2-2)
return 0;
if ((len % 2) == 1) // odd number
{
AsciiToBcd(normal_isdn+1,str_isdn,len-1);
ii = len/2 + 1;
normal_isdn[ii] = (str_isdn[len-1] - '0') << 4;
normal_isdn[ii] |= 0x0E;
}
else
{
AsciiToBcd(normal_isdn+1,str_isdn,len);
ii = len/2;
}
memset(normal_isdn+ii+1,0xEE,ISDN_LEN-ii-1);
normal_isdn[0] = 0x91; // default value
return 1;
}
void hae_isdn_ntos(BYTE *str_isdn,BYTE *normal_isdn)
{
BYTE len = 0;
BYTE ii,jj;
for (ii = 1;ii < ISDN_LEN;ii ++)
{
jj = (normal_isdn[ii] >> 4) & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
jj = normal_isdn[ii] & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
}
str_isdn[len] = '\0';
}
int register_link()
{
BYTE ret;
strcpy( gg.service_number , "86755001");
if( gg.link == MAX_SMPP_LINK+1 )
{
ret = smpp_registerLink(SMPP_CLIENT, BIND_TRX, gg.service_number, TRANSACTION);
if ((ret&0x80) == 0x80)
{
gg.link = ret&0x7f;
printf("Get link for GuessGame EAE .link:%d", gg.link);
smpp_attach_link(gg.link, smpp_onDataRecv, smpp_onLinkStateChange);
return 1;
}
}
else
{
smpp_attach_link(gg.link, smpp_onDataRecv, smpp_onLinkStateChange);
return 1;
}
return 0;
}
void smpp_test_init(int flag)
{
int i;
FILE *fp;
char line[32];
char test_file[] = "./conf/guess_number_test.conf";
gg.link_enable = 0;
gg.link = MAX_SMPP_LINK+1;
for (i=0; i<MAX_GAME_LINK; i++)
{
memset(store_msg_buf[i], 0, sizeof(SMPP_MSG_STORE_STRUCT)*STORE_MSG_ITEM);
msg_pointer[i] = 0;
}
strcpy(gg.wxc2_hlr_number, "86755001");
register_link();
if( flag )
{
fp = fopen( test_file , "r");
if( fp == NULL )
{
printf("Open %s file fail!\n", test_file );
}
while ( !feof ( fp ) )
{
if( fgets ( line, 256, fp ) == NULL )
{
break;
}
for( i = 16 ; i > 6 ; i -- )
{
if( line[i] == ' ' || line[i] == '\t' || line[i] == '\r' || line[i] == '\n')
{
continue;
}
else if( isdigit( line[i] ) )
{
break;
}
}
if( i < 16 && i > 6 )
{
line[i+1] = '\0';
}
line[16] = '\0';
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( !ssm_data[i].flag )
{
ssm_data[i].flag = 1;
ssm_data[i].ssm_state =6;
printf("read msisdn :%s\n",line);
strcpy ( ssm_data[i].msisdn, line );
//hae_isdn_ston ( temp_isdn, temp_msisdn );
//memcpy( ssm_data[i].msisdn , temp_isdn , ISDN_LEN);
break;
}
}
}
}
}
extern int iptrMainInit();
int main(int argc,char *argv[])
{
int i;
char ret;
heartbeat_init(0xFFFF);
debug_init();
iptrMainInit();
snmp_init(SMPP_PORT);
mtp_shm_init();
sccp_init();
smpp_init_new();
while ((ret = getopt(argc,argv,"n")) != -1)
{
switch (ret)
{
case 'n':
printf("\n\n\nNetwork initial ussd to ms\n\n\n");
smpp_test_init(1);
break;
default:
smpp_test_init(0);
break;
}
}
for (i=0; i<MAX_GAME_LINK; i++)
{
stateFlag[i] = FALSE;
timer_counter[i]= 0;
msg_count[i] = 0;
}
opterr = 0;
SetTimer();
while(1)
{
usleep(50);
}
return 1;
}
void GameFsm();
static int call_flag = 0;
void On_Timer()
{
int i;
for (i=0; i<MAX_GAME_LINK; i++)
{ // 2 msgs per second
if (timer_counter[i]==25)
timer_counter[i]=0;
if ((timer_counter[i]%25)==0)
{
if( (call_flag++)%2 == 0 )
{
GameFsm();
}
}
timer_counter[i]++;
if (msg_count[i] == SD_PKT_NUM)
{
smpp_close(i);
}
}
iptrans_timer();
debug_rt();
snmp_timer();
mtp3_proc();
heartbeat_timer();
sccp_timer();
smpp_fsm_new();
}
void SetTimer()
{
struct sigaction act;
act.sa_handler=On_Timer;
sigemptyset(&act.sa_mask);
act.sa_flags=0;
if(sigaction(SIGALRM,&act,NULL)<0)
{
perror("Produce Sigaction");
exit(1);
}
itimer.it_interval.tv_sec=0;
itimer.it_interval.tv_usec=20*1000;
itimer.it_value.tv_sec=0;
itimer.it_value.tv_usec=20*1000;
if (setitimer(ITIMER_REAL,&itimer,&old_itimer) !=0 )
{
printf("Setting Timer error! \n");
exit(1);
}
}
void SendMsgToSMPP(int sid , BYTE* msg , BYTE ussd_op);
int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pMsg, WORD dataLen)
{
int sequence_number=100;
SMPP_MSG smpp_msg;
int i;
//BYTE temp_isdn[ISDN_LEN+1];
//BYTE temp_msisdn[65];
struct GameSession *ssm_ptr;
char temp_str[256];
switch (pMsg->message_type)
{
case 0x0C: /* SUBMIT SM RESP */
printf("[TEST PROGRAM]Link %d received SUBMIT SM RESP.\n", linkNo);
break;
case 0x0F: /* DELIVER SM */
printf("[TEST PROGRAM]Link %d received DELIVER SM. op:%d \n", linkNo , pMsg->pdu.deliver_sm.ussd_service_op);
switch( pMsg->pdu.deliver_sm.ussd_service_op )
{
case PSSRR:
smpp_send_ascout("\33[32mGuess Game Recv PSSRR\33[0m\n");
if( pMsg->pdu.deliver_sm.user_message_reference >= MAX_GAME_SESSION )
{
smpp_send_ascout("\33[32mThe session id is too large!\33[0m\n");
return -1;
}
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( pMsg->pdu.deliver_sm.user_message_reference == ssm_data[i].ussd_ref )
{
if( ssm_data[i].flag == 1)
{
smpp_send_ascout("\33[32mThe session id is in used!\33[0m\n");
return -1;
}
}
}
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( ssm_data[i].flag == 0)
{
break;
}
}
ssm_data[i].flag = 1;
ssm_data[i].ssm_state =1;
ssm_data[i].ussd_ref = pMsg->pdu.deliver_sm.user_message_reference;
strcpy ( ssm_data[i].msisdn, pMsg->pdu.deliver_sm.source_addr );
break;
case USSRC:
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( strcmp( pMsg->pdu.deliver_sm.source_addr ,ssm_data[i].msisdn ) == 0 )
{
break;
}
}
if( i == MAX_GAME_SESSION )
{
printf( "unkown USSRC msisdn :%s \n",pMsg->pdu.deliver_sm.source_addr );
SendMsgToSMPP( pMsg->pdu.deliver_sm.user_message_reference ,ssm_ptr->shmsg , RELR );
ssm_ptr->us_prm = US_RELER;
return -1;
}
ssm_ptr = &ssm_data[i];
ssm_ptr->us_prm = US_USSRC;
smpp_send_ascout("\33[32mGuess Game Recv USSRC\33[0m\n");
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , pMsg->pdu.deliver_sm.user_message_reference);
smpp_send_ascout(temp_str);
if( pMsg->pdu.deliver_sm.sm_length == 4 )
{
memcpy( &ssm_ptr->input , &pMsg->pdu.deliver_sm.short_message ,4);
ssm_ptr->input[0] -= '0';
ssm_ptr->input[1] -= '0';
ssm_ptr->input[2] -= '0';
ssm_ptr->input[3] -= '0';
}
strcpy( ssm_ptr->shmsg , pMsg->pdu.deliver_sm.short_message );
ssm_ptr->shmsg[pMsg->pdu.deliver_sm.sm_length] = '\0';
break;
case USSNC:
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( strcmp( pMsg->pdu.deliver_sm.source_addr ,ssm_data[i].msisdn ) == 0 )
{
break;
}
}
if( i == MAX_GAME_SESSION )
{
printf( "unkown USSRC msisdn :%s \n",pMsg->pdu.deliver_sm.source_addr );
if( pMsg->pdu.deliver_sm.user_message_reference < MAX_GAME_SESSION )
{
ssm_ptr = &ssm_data[i];
strcpy( ssm_ptr->shmsg , " incorrect user msg reference " );
SendMsgToSMPP( pMsg->pdu.deliver_sm.user_message_reference ,ssm_ptr->shmsg , RELR );
}
return -1;
}
ssm_ptr = &ssm_data[i];
ssm_ptr->us_prm = US_USSNC;
smpp_send_ascout("\33[32mGuess Game Recv USSNC\33[0m\n");
break;
case RELR:
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( strcmp( pMsg->pdu.deliver_sm.source_addr ,ssm_data[i].msisdn ) == 0 )
{
break;
}
}
if( i == MAX_GAME_SESSION )
{
//sprintf( ssm_ptr->shmsg ,"unkown RELR msisdn :%s \n",pMsg->pdu.deliver_sm.source_addr );
//SendMsgToSMPP( pMsg->pdu.deliver_sm.user_message_reference ,ssm_ptr->shmsg , RELR );
return -1;
}
ssm_ptr = &ssm_data[i];
ssm_ptr->us_prm = US_RELEC;
smpp_send_ascout("\33[32mGuess Game Recv RELR\33[0m\n");
break;
case RELC:
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( strcmp( pMsg->pdu.deliver_sm.source_addr ,ssm_data[i].msisdn ) == 0 )
{
break;
}
}
if( i == MAX_GAME_SESSION )
{
printf( "unkown RELC msisdn :%s \n",pMsg->pdu.deliver_sm.source_addr );
SendMsgToSMPP( pMsg->pdu.deliver_sm.user_message_reference ,ssm_ptr->shmsg , RELR );
return -1;
}
ssm_ptr = &ssm_data[i];
ssm_ptr->us_prm = US_RELES;
smpp_send_ascout("\33[32mGuess Game Recv RELR\33[0m\n");
break;
default:
break;
}
/* fill with DELIVER SM RESP structure. */
smpp_msg.message_type = 0x10;
smpp_msg.pdu.deliver_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.deliver_sm_resp.head.sequence_number = pMsg->pdu.deliver_sm.head.sequence_number;
smpp_msg.pdu.deliver_sm_resp.message_id = 0x0;
smpp_send(linkNo, &smpp_msg, dataLen);
smpp_send_ascout("Send deliver_sm_resp\n");
call_flag = 0;
break;
}
return sequence_number;
}
int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate)
{
printf("[TEST PROGRAM]link %d state change to %d\n",linkNo, linkstate);
if (linkstate == 1)
gg.link_enable = 1;
else
gg.link_enable = 0;
return linkNo;
}
int RandomNum(BYTE *seed)
{
int count , i , j;
i = j = count = 0 ;
while( count < 4 )
{
j = 1 +(int)(10.0*rand()/(RAND_MAX+1.0));
if( j >= 10 )
{
continue;
}
for( i = count ; i > 0 ; i-- )
{
if( j == seed[i] )
{
break;
}
}
if( !count || j != seed[i])
{
seed[count] = j;
count++;
}
}
return (count == 4 ? 1 : 0);
}
int CheckInput(BYTE *input)
{
int input_index ,index;
for( input_index = 0 ; input_index < 4 ; input_index++ )
{
for( index = 0 ; index < 4 ; index++ )
{
if( index != input_index && input[input_index] == input[index] )
{
return 0;
}
}
}
return 1;
}
int GuessNumber(BYTE* input,BYTE* seed)
{
BYTE seed_index , input_index ;
BYTE rt_a , rt_b ;
rt_a = rt_b = 0;
for( input_index = 0 ; input_index < 4 ; input_index++ )
{
for( seed_index = 0 ; seed_index < 4 ; seed_index++ )
{
if( input[(int)input_index] == seed[(int)seed_index] )
{
if( input_index == seed_index )
{
rt_a++;
}
else
{
rt_b++;
}
}
}
}
return (rt_a << 4) + rt_b;
}
void SendMsgToSMPP(int sid , BYTE* msg , BYTE ussd_op)
{
SMPP_MSG pMsg;
int data_len;
PDU_SUBMIT_SM *submit_sm;
struct GameSession *ssm_ptr;
char temp_str[256];
if( sid >= MAX_GAME_SESSION )
{
ssm_ptr = &ssm_data[sid - MAX_GAME_SESSION];
}
else
{
ssm_ptr = &ssm_data[sid];
}
memset( &pMsg , 0 , sizeof(SMPP_MSG));
submit_sm = &pMsg.pdu.submit_sm;
pMsg.message_type = 0x0B;
pMsg.optional_param_flag1 = 0x08000001;
if( sid < MAX_GAME_SESSION )
submit_sm->user_message_reference = ssm_ptr->ussd_ref;
else
submit_sm->user_message_reference = 0xFFFF;
submit_sm->ussd_service_op = ussd_op;
strcpy( submit_sm->service_type , "USSD" );
strcpy( submit_sm->destination_addr , ssm_ptr->msisdn );
strcpy( submit_sm->source_addr , gg.service_number );
//hae_isdn_ntos( submit_sm->destination_addr , ssm_ptr->msisdn );
sprintf(temp_str, "\33[32mGuessGame send smpp msg: ussd_op :%s ssm_ptr->msisdn :%s user_refer : %d\33[0m\n"
, op_map_name[submit_sm->ussd_service_op].s ,ssm_ptr->msisdn , submit_sm->user_message_reference);
smpp_send_ascout(temp_str);
submit_sm->sm_length = strlen( msg );
strcpy( submit_sm->short_message , msg );
smpp_send( gg.link , &pMsg , data_len );
}
void GameFsm()
{
int rt;
int i;
char temp_str[1024];
struct GameSession *ssm_ptr;
if( !gg.link_enable && !register_link() )
{
smpp_send_ascout("Try to connect to WXC2 HLR fail\n");
printf("Try to connect to WXC2 HLR fail\n");
return;
}
//sprintf(debugBuf,);
//smpp_send_ascout("The session id is in used!\n");
for( i = 0 ;i < MAX_GAME_SESSION ; i++)
{
ssm_ptr = &ssm_data[i];
if( ssm_ptr->flag == 0 )
{
continue;
}
if( ssm_ptr->us_prm == US_RELES )
{
ssm_ptr->ssm_state = 7;
}
else if( ssm_ptr->us_prm == US_RELEC )
{
strcpy( ssm_ptr->shmsg , "Release ack!\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , RELC );
ssm_ptr->ssm_state = 7;
}
switch( ssm_ptr->ssm_state )
{
case 0:
continue;
case 1:
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
if( !RandomNum( ssm_ptr->seed ) )
{
//"Create random number fail"
return;
}
//sid = pMsg->pdu.deliver_sm.user_message_reference ;
//if( sid > MAX_GAME_SESSION )
//{
// //"Game EAE do no support so much session .sid :%d",sid
// return;
//}
sprintf( ssm_ptr->shmsg ," WellCome to WXC2 Online Guess Number Game System!\n Please input you guess nubmer:\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 2;
break;
case 2:
switch( ssm_ptr->us_prm )
{
case US_IDLE:
break;
case US_RELER:
break;
case US_USSRC:
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
if( strlen(ssm_ptr->shmsg) != 4 )
{
sprintf(temp_str, "\33[32mThe input string length is not 4. input again.\33[0m\n");
smpp_send_ascout(temp_str);
strcpy ( ssm_ptr->shmsg , "The input string length is not 4. input again.");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->shmsg[0] = '\0';
ssm_ptr->us_prm = US_IDLE;
return;
}
if( !CheckInput( ssm_ptr->input ) )
{
sprintf( ssm_ptr->shmsg ,"Input is Error! Please input four difference numbers.\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
}
rt = GuessNumber( ssm_ptr->input , ssm_ptr->seed ) & 0xFF ;
ssm_ptr->count ++;
if( ssm_ptr->count >= 8 )
{
sprintf ( ssm_ptr->shmsg ,"Game Over!\n");
sprintf ( temp_str , "NO%d:%d%d%d%d ",ssm_ptr->count , ssm_ptr->input[0],ssm_ptr->input[1],ssm_ptr->input[2],ssm_ptr->input[3]);
strcat ( ssm_ptr->history , temp_str );
sprintf ( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
//strcat ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 3;
ssm_ptr->us_prm = US_IDLE;
return ;
}
sprintf( temp_str , "NO%d:%d%d%d%d ",ssm_ptr->count , ssm_ptr->input[0],ssm_ptr->input[1],ssm_ptr->input[2],ssm_ptr->input[3]);
if( rt != 0x40 )
{
strcat ( ssm_ptr->history , temp_str );
sprintf( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->us_prm = US_IDLE;
}
else
{
strcat ( ssm_ptr->history , temp_str );
sprintf( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 3;
ssm_ptr->us_prm = US_IDLE;
}
break;
}
break;
case 3:
if( ssm_ptr->us_prm == US_USSNC )
{
switch( ssm_ptr->count )
{
case 1:
sprintf ( ssm_ptr->shmsg ," So Luck!\n");
break;
case 2:
sprintf ( ssm_ptr->shmsg ," Luck\n");
break;
case 3:
sprintf ( ssm_ptr->shmsg ," Perfect\n");
break;
case 4:
sprintf ( ssm_ptr->shmsg ," Very Good\n");
break;
case 5:
sprintf ( ssm_ptr->shmsg ," Good\n");
break;
case 6:
case 7:
case 8:
sprintf ( ssm_ptr->shmsg ," Correct\n");
break;
default:
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 4;
return;
break;
}
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 4;
}
case 4:
if( ssm_ptr->us_prm == US_USSNC )
{
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
sprintf( ssm_ptr->shmsg ," Guess Number\n1 . Restart game \n 2 . exit\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
ssm_ptr->ssm_state = 5;
ssm_ptr->count =0;
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
}
break;
case 5:
if( ssm_ptr->us_prm == US_USSRC )
{
if( ssm_ptr->shmsg[0] == '1' )
{
if( !RandomNum( ssm_ptr->seed ) )
{
//"Create random number fail"
return;
}
sprintf( ssm_ptr->shmsg ," Game Restart.input four difference numbers: \n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
ssm_ptr->history[0]= '\0';
ssm_ptr->ssm_state = 2;
}
else if( ssm_ptr->shmsg[0] == '2' )
{
sprintf( ssm_ptr->shmsg ," Game Exit.GoodBye! Wellcome to use WXC2 system!\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
memset( ssm_ptr , 0 , sizeof(GameSession ));
}
else
{
sprintf( ssm_ptr->shmsg ," Unexpeced menu selection!\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
ssm_ptr->ssm_state = 7;
}
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
}
break;
case 6:
if( gg.link_enable )
{
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
if( !RandomNum( ssm_ptr->seed ) )
{
//"Create random number fail"
return;
}
sprintf( ssm_ptr->shmsg ," WellCome to WXC2 Online Guess Number Game System!\n Please input you guess nubmer:\n");
SendMsgToSMPP( i+MAX_GAME_SESSION ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 2;
sprintf(temp_str, "\33[32mGame Fsm change to state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
}
break;
case 7: //release
if( ssm_ptr->us_prm == US_USSNC )
{
strcpy( ssm_ptr->shmsg , "session is closed");
SendMsgToSMPP( i ,ssm_ptr->shmsg , RELR );
}
sprintf(temp_str, "\33[32mRecv Release command ! sid: %d ussd_ref: %d\33[0m\n" , i ,ssm_ptr->ussd_ref);
smpp_send_ascout(temp_str);
memset( ssm_ptr , 0 , sizeof(GameSession ));
break;
}
}
}

View File

@@ -0,0 +1,704 @@
//--------------------------------------
// USSD EAE write for ussd test
// Author: lw 2006/7/10
//--------------------------------------
#include "./include/smpp.h"
#define ISDN_LEN 9
typedef struct PPPChatSession
{
BYTE LinkNo;
BYTE flag;
BYTE sid;
BYTE link_sid;
BYTE link_flag;
BYTE seed[4];
BYTE ssm_state;
BYTE shmsg[256];
BYTE us_prm;
BYTE input[4];
BYTE history[512];
BYTE count;
char msisdn[ISDN_LEN*2+1];
char mt_msisdn[ISDN_LEN*2+1];
char buf[256];
}
PPPChatSession;
typedef enum _USSD_OP
{
PSSDR = 0 , // MAP_Process_USS_Data request operation
PSSRR = 1 , // MAP_Process_USS_Request request operation
USSRR = 2 , // MAP_USS_Request Request operation
USSNR = 3 , // MAP_USS_Notify Request operation
OPENR = 5 , // open request operation
RELR = 6 , // Release request operation
PSSDE = 7 , // MAP_Process_USS_Data error operation
PSSRE = 8 , // MAP_Process_USS_Request error operation
USSRA = 9 , // MAP_USS_Request Answer operation
USSRE = 10, // MAP_USS_Request Error operation
USSNE = 11, // MAP_USS_Notify Error operation
USSNA = 12, // MAP_USS_Notify Answer operation
OPENE = 13, // open error operation
RELE = 14, // Release error operation
UTEST = 15, // USSD TEST Message
PSSDS = 16, // MAP_Process_USS_Data confirm operation
PSSRS = 17, // MAP_Process_USS_Request confirm operation
USSRC = 18, // MAP_USS_Request Confirm operation
USSNC = 19, // MAP_USS_Notify Confirm operation
PSSRC = 20, // MAP_Process_USS_Request confirm operation
OPENC = 21, // open confirm operation
RELC = 22, // Release confirm operation
}
USSD_OP;
typedef enum US_STATE
{
US_IDLE=0,
US_OPENR,
US_OPENC,
US_OPENE,
US_PSSRR,
US_PSSRA,
US_PSSRE,
US_PSSRC,
US_PSSRS,
US_USSRR,
US_USSRC,
US_USSRS,
US_USSNR,
US_USSNC,
US_USSNS,
US_RELER,
US_RELEC,
US_RELEE,
}
US_STATE;
#define MAX_GAME_SESSION 255
typedef struct GuessGame
{
BYTE wxc2_hlr_number[8];
BYTE link_enable;
BYTE link;
}GuessGame;
GuessGame gg;
struct PPPChatSession ssm_data[MAX_GAME_SESSION];
#define SD_PKT_NUM 10
#define STORE_MSG_ITEM 60
typedef struct SMPP_MSG_STORE_STRUCT
{
BYTE short_message[SMPP_MSG_LEN];
BYTE message_id[65];
} SMPP_MSG_STORE_STRUCT;
#define MAX_GAME_LINK 1
static struct itimerval itimer,old_itimer;
static int timer_counter[MAX_GAME_LINK];
static int stateFlag[MAX_GAME_LINK];
static int msg_count[MAX_GAME_LINK];
static int msg_pointer[MAX_GAME_LINK];
static SMPP_MSG_STORE_STRUCT store_msg_buf[MAX_GAME_LINK][STORE_MSG_ITEM];
static void On_Timer();
static void SetTimer();
static void smpp_test_init();
static int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pData, WORD dataLen);
static int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate);
BYTE hae_isdn_ston(BYTE *normal_isdn,BYTE *str_isdn)
{
BYTE ii;
BYTE len;
len = strlen(str_isdn);
if (len > ISDN_LEN*2-2)
return 0;
if ((len % 2) == 1) // odd number
{
AsciiToBcd(normal_isdn+1,str_isdn,len-1);
ii = len/2 + 1;
normal_isdn[ii] = (str_isdn[len-1] - '0') << 4;
normal_isdn[ii] |= 0x0E;
}
else
{
AsciiToBcd(normal_isdn+1,str_isdn,len);
ii = len/2;
}
memset(normal_isdn+ii+1,0xEE,ISDN_LEN-ii-1);
normal_isdn[0] = 0x91; // default value
return 1;
}
void hae_isdn_ntos(BYTE *str_isdn,BYTE *normal_isdn)
{
BYTE len = 0;
BYTE ii,jj;
for (ii = 1;ii < ISDN_LEN;ii ++)
{
jj = (normal_isdn[ii] >> 4) & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
jj = normal_isdn[ii] & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
}
str_isdn[len] = '\0';
}
int register_link()
{
BYTE ret;
if( gg.link == MAX_SMPP_LINK+1 )
{
ret = smpp_registerLink(SMPP_CLIENT, BIND_TRX, gg.wxc2_hlr_number, TRANSACTION);
if ((ret&0x80) == 0x80)
{
gg.link = ret&0x7f;
printf("Get link for GuessGame EAE .link:%d", gg.link);
smpp_attach_link(gg.link, smpp_onDataRecv, smpp_onLinkStateChange);
return 1;
}
}
else
{
smpp_attach_link(gg.link, smpp_onDataRecv, smpp_onLinkStateChange);
return 1;
}
return 0;
}
void smpp_test_init(int flag)
{
int i;
FILE *fp;
char line[32];
BYTE temp_isdn[ISDN_LEN+1];
BYTE temp_msisdn[65];
char test_file[] = "./conf/guess_number_test.conf";
gg.link_enable = 0;
gg.link = MAX_SMPP_LINK+1;
for (i=0; i<MAX_GAME_LINK; i++)
{
memset(store_msg_buf[i], 0, sizeof(SMPP_MSG_STORE_STRUCT)*STORE_MSG_ITEM);
msg_pointer[i] = 0;
}
strcpy(gg.wxc2_hlr_number, "86755001");
register_link();
if( flag )
{
fp = fopen( test_file , "r");
if( fp == NULL )
{
printf("Open %s file fail!\n", test_file );
}
while ( !feof ( fp ) )
{
if( fgets ( line, 256, fp ) == NULL )
{
break;
}
for( i = 16 ; i > 6 ; i -- )
{
if( line[i] == ' ' || line[i] == '\t' || line[i] == '\r' || line[i] == '\n')
{
continue;
}
else if( isdigit( line[i] ) )
{
break;
}
}
if( i < 16 && i > 6 )
{
line[i+1] = '\0';
}
line[16] = '\0';
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( !ssm_data[i].flag )
{
ssm_data[i].flag = 1;
ssm_data[i].ssm_state =6;
printf("read msisdn :%s\n",line);
strcpy ( temp_msisdn, line );
hae_isdn_ston ( temp_isdn, temp_msisdn );
memcpy( ssm_data[i].msisdn , temp_isdn , ISDN_LEN);
break;
}
}
}
}
}
int main(int argc,char *argv[])
{
int i;
char ret;
heartbeat_init(0xFFFF);
debug_init();
iptrMainInit();
snmp_init(SMPP_PORT);
mtp_shm_init();
sccp_init();
smpp_init_new();
while ((ret = getopt(argc,argv,"n")) != -1)
{
switch (ret)
{
case 'n':
printf("\n\n\nNetwork initial ussd to ms\n\n\n");
smpp_test_init(1);
break;
default:
smpp_test_init(0);
break;
}
}
for (i=0; i<MAX_GAME_LINK; i++)
{
stateFlag[i] = FALSE;
timer_counter[i]= 0;
msg_count[i] = 0;
}
opterr = 0;
SetTimer();
while(1)
{
usleep(50);
}
return 1;
}
void ChatFsm();
static int call_flag = 0;
void On_Timer()
{
int i;
for (i=0; i<MAX_GAME_LINK; i++)
{ // 2 msgs per second
if (timer_counter[i]==25)
timer_counter[i]=0;
if ((timer_counter[i]%25)==0)
{
if( (call_flag++)%2 == 0 )
{
ChatFsm();
}
}
timer_counter[i]++;
if (msg_count[i] == SD_PKT_NUM)
{
smpp_close(i);
}
}
iptrans_timer();
debug_rt();
snmp_timer();
mtp3_proc();
heartbeat_timer();
sccp_timer();
smpp_fsm_new();
}
void SetTimer()
{
struct sigaction act;
act.sa_handler=On_Timer;
sigemptyset(&act.sa_mask);
act.sa_flags=0;
if(sigaction(SIGALRM,&act,NULL)<0)
{
perror("Produce Sigaction");
exit(1);
}
itimer.it_interval.tv_sec=0;
itimer.it_interval.tv_usec=20*1000;
itimer.it_value.tv_sec=0;
itimer.it_value.tv_usec=20*1000;
if (setitimer(ITIMER_REAL,&itimer,&old_itimer) !=0 )
{
printf("Setting Timer error! \n");
exit(1);
}
}
int smpp_onDataRecv(BYTE linkNo, SMPP_MSG *pMsg, WORD dataLen)
{
int sequence_number=100;
SMPP_MSG smpp_msg;
int i;
BYTE temp_isdn[ISDN_LEN+1];
BYTE temp_msisdn[65];
struct PPPChatSession *ssm_ptr;
switch (pMsg->message_type)
{
case 0x0C: /* SUBMIT SM RESP */
printf("[TEST PROGRAM]Link %d received SUBMIT SM RESP.\n", linkNo);
break;
case 0x0F: /* DELIVER SM */
printf("[TEST PROGRAM]Link %d received DELIVER SM. op:%d \n", linkNo , pMsg->pdu.deliver_sm.ussd_service_op);
switch( pMsg->pdu.deliver_sm.ussd_service_op )
{
case PSSRR:
smpp_send_ascout("\33[32mPPP Chat Recv PSSRR\33[0m\n");
if( pMsg->pdu.deliver_sm.user_message_reference >= MAX_GAME_SESSION )
{
smpp_send_ascout("\33[32mThe session id is too large!\33[0m\n");
return -1;
}
for( i = 0 ; i < MAX_GAME_SESSION ; i ++ )
{
if( pMsg->pdu.deliver_sm.user_message_reference == ssm_data[i].sid || pMsg->pdu.deliver_sm.user_message_reference == ssm_data[i].link_sid )
{
if( ssm_data[i].flag == 1)
{
smpp_send_ascout("\33[32mThe session id is in used!\33[0m\n");
return -1;
}
ssm_data[i].flag = 1;
ssm_data[i].ssm_state =1;
strcpy ( temp_msisdn, pMsg->pdu.submit_sm.source_addr );
hae_isdn_ston ( temp_isdn, temp_msisdn );
memcpy( ssm_data[i].msisdn , temp_isdn , ISDN_LEN);
if( pMsg->pdu.deliver_sm.short_message_len <= ISDN*2 )
{
memcpy( ssm_data[i].mt_msisdn , pMsg->pdu.deliver_sm.short_message , pMsg->pdu.deliver_sm.short_message_len );
}
break;
}
}
break;
case USSRC:
ssm_ptr = &ssm_data[pMsg->pdu.deliver_sm.user_message_reference];
ssm_ptr->us_prm = US_USSRC;
smpp_send_ascout("\33[32mGuess Game Recv USSRC\33[0m\n");
if( pMsg->pdu.deliver_sm.sm_length == 4 )
{
memcpy( &ssm_ptr->input , &pMsg->pdu.deliver_sm.short_message ,4);
ssm_ptr->input[0] -= '0';
ssm_ptr->input[1] -= '0';
ssm_ptr->input[2] -= '0';
ssm_ptr->input[3] -= '0';
}
strcpy( ssm_ptr->shmsg , pMsg->pdu.deliver_sm.short_message );
ssm_ptr->shmsg[pMsg->pdu.deliver_sm.sm_length] = '\0';
break;
case USSNC:
ssm_ptr->us_prm = US_USSNC;
smpp_send_ascout("\33[32mGuess Game Recv USSNC\33[0m\n");
break;
default:
break;
}
/* fill with DELIVER SM RESP structure. */
smpp_msg.message_type = 0x10;
smpp_msg.pdu.deliver_sm_resp.head.command_status = htonl(ESME_ROK);
smpp_msg.pdu.deliver_sm_resp.head.sequence_number = pMsg->pdu.deliver_sm.head.sequence_number;
smpp_msg.pdu.deliver_sm_resp.message_id = 0x0;
smpp_send(linkNo, &smpp_msg, dataLen);
smpp_send_ascout("Send deliver_sm_resp\n");
call_flag = 0;
break;
}
return sequence_number;
}
int smpp_onLinkStateChange(BYTE linkNo, BYTE linkstate)
{
printf("[TEST PROGRAM]link %d state change to %d\n",linkNo, linkstate);
if (linkstate == 1)
gg.link_enable = 1;
else
gg.link_enable = 0;
return linkNo;
}
void SendMsgToSMPP(int sid , BYTE* msg , BYTE ussd_op)
{
SMPP_MSG pMsg;
int data_len;
PDU_SUBMIT_SM *submit_sm;
struct PPPChatSession *ssm_ptr;
if( sid >= MAX_GAME_SESSION )
{
ssm_ptr = &ssm_data[sid - MAX_GAME_SESSION];
}
else
{
ssm_ptr = &ssm_data[sid];
}
memset( &pMsg , 0 , sizeof(SMPP_MSG));
submit_sm = &pMsg.pdu.submit_sm;
pMsg.message_type = 0x0B;
pMsg.optional_param_flag1 = 0x08000001;
if( sid < MAX_GAME_SESSION )
submit_sm->user_message_reference = sid;
else
submit_sm->user_message_reference = 0xFFFF;
submit_sm->ussd_service_op = ussd_op;
strcpy( submit_sm->service_type , "USSD" );
hae_isdn_ntos( submit_sm->destination_addr , ssm_ptr->msisdn );
submit_sm->sm_length = strlen( msg );
strcpy( submit_sm->short_message , msg );
smpp_send( gg.link , &pMsg , data_len );
}
void ChatFsm()
{
int rt;
int i;
char temp_str[1024];
struct PPPChatSession *ssm_ptr;
if( !gg.link_enable && !register_link() )
{
smpp_send_ascout("Try to connect to WXC2 HLR fail\n");
printf("Try to connect to WXC2 HLR fail\n");
return;
}
//sprintf(debugBuf,);
//smpp_send_ascout("The session id is in used!\n");
for( i = 0 ;i < MAX_GAME_SESSION ; i++)
{
ssm_ptr = &ssm_data[i];
if( ssm_ptr->flag == 0 )
{
continue;
}
switch( ssm_ptr->ssm_state )
{
case 0:
continue;
case 1:
sprintf(temp_str, "\33[32mPPP Chat recv PSSR MO:%s MT:%s \nFsm state :% d sid : %d\33[0m\n"
, ssm_ptr->ssm_state , i , ssm_data[i].msisdn , ssm_data[i].mt_msisdn );
smpp_send_ascout(temp_str);
sprintf( ssm_ptr->shmsg ," Mobile Phone request to chat with you: 1 : Accept ;\n2 : Reject:\n ");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 2;
break;
case 2:
switch( ssm_ptr->us_prm )
{
case US_IDLE:
break;
case US_RELER:
break;
case US_USSRC:
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
if( strlen(ssm_ptr->shmsg) != 4 )
{
sprintf(temp_str, "\33[32mThe input string length is not 4.\33[0m\n");
smpp_send_ascout(temp_str);
return;
}
if( !CheckInput( ssm_ptr->input ) )
{
sprintf( ssm_ptr->shmsg ,"Input is Error! Please input four difference numbers.\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
}
rt = GuessNumber( ssm_ptr->input , ssm_ptr->seed ) & 0xFF ;
ssm_ptr->count ++;
if( ssm_ptr->count >= 8 )
{
sprintf ( ssm_ptr->shmsg ,"Game Over!\n");
sprintf ( temp_str , "NO%d:%d%d%d%d ",ssm_ptr->count , ssm_ptr->input[0],ssm_ptr->input[1],ssm_ptr->input[2],ssm_ptr->input[3]);
strcat ( ssm_ptr->history , temp_str );
sprintf ( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
//strcat ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 3;
ssm_ptr->us_prm = US_IDLE;
return ;
}
sprintf( temp_str , "NO%d:%d%d%d%d ",ssm_ptr->count , ssm_ptr->input[0],ssm_ptr->input[1],ssm_ptr->input[2],ssm_ptr->input[3]);
if( rt != 0x40 )
{
strcat ( ssm_ptr->history , temp_str );
sprintf( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->us_prm = US_IDLE;
}
else
{
strcat ( ssm_ptr->history , temp_str );
sprintf( temp_str , "->%dA%dB\n" , rt>>4 , rt&0x0F);
strcat ( ssm_ptr->history , temp_str );
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 3;
ssm_ptr->us_prm = US_IDLE;
}
break;
}
break;
case 3:
if( ssm_ptr->us_prm == US_USSNC )
{
switch( ssm_ptr->count )
{
case 1:
sprintf ( ssm_ptr->shmsg ," So Luck!\n");
break;
case 2:
sprintf ( ssm_ptr->shmsg ," Luck\n");
break;
case 3:
sprintf ( ssm_ptr->shmsg ," Perfect\n");
break;
case 4:
sprintf ( ssm_ptr->shmsg ," Very Good\n");
break;
case 5:
sprintf ( ssm_ptr->shmsg ," Good\n");
break;
case 6:
case 7:
case 8:
sprintf ( ssm_ptr->shmsg ," Correct\n");
break;
default:
strcpy ( ssm_ptr->shmsg , ssm_ptr->history );
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 4;
return;
break;
}
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 4;
}
case 4:
if( ssm_ptr->us_prm == US_USSNC )
{
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
sprintf( ssm_ptr->shmsg ," Guess Number\n1 . Restart game \n 2 . exit\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
ssm_ptr->ssm_state = 5;
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
}
break;
case 5:
if( ssm_ptr->us_prm == US_USSNC )
{
if( ssm_ptr->shmsg[0] == '1' )
{
if( !RandomNum( ssm_ptr->seed ) )
{
//"Create random number fail"
return;
}
sprintf( ssm_ptr->shmsg ," Game Restart.input four difference numbers: \n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSRR );
ssm_ptr->ssm_state = 2;
}
else if( ssm_ptr->shmsg[0] == '2' )
{
sprintf( ssm_ptr->shmsg ," Game Exit.GoodBye! Wellcome to use WXC2 system!\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
ssm_ptr->ssm_state = 0;
ssm_ptr->flag = 0;
}
else
{
sprintf( ssm_ptr->shmsg ," Unexpeced menu selection!\n");
SendMsgToSMPP( i ,ssm_ptr->shmsg , USSNR );
}
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
}
break;
case 6:
if( gg.link_enable )
{
sprintf(temp_str, "\33[32mGame Fsm state :% d sid : %d\33[0m\n" , ssm_ptr->ssm_state , i);
smpp_send_ascout(temp_str);
if( !RandomNum( ssm_ptr->seed ) )
{
//"Create random number fail"
return;
}
sprintf( ssm_ptr->shmsg ," WellCome to WXC2 Online Guess Number Game System!\n Please input you guess nubmer:\n");
SendMsgToSMPP( i+MAX_GAME_SESSION ,ssm_ptr->shmsg , USSRR );
sprintf(temp_str , "\n\n\33[32mSend Game Info :\n%s\33[0m\n\n" , ssm_ptr->shmsg );
smpp_send_ascout(temp_str);
ssm_ptr->ssm_state = 2;
}
break;
}
}
}