Design and implementation of GSM short message value-added services based on SMPP protocol

xiaoxiao2021-03-06  41

Design and implementation of GSM short message value-added services based on SMPP protocol

Design and Implementation of One of the GSM Short Message Value-Added Service Interface Based On Protocol SMPP

Zou Jianxin Huang Benxiong

Huazhong University of Science and Technology Telecommunications Department (430074)

Jianxin Zou Benxiong Huang

Telecommunication Department of TELECMMUNICATION

Huazhong

University

of science and technology (430074)

Abstract: This article first introduces the definition of the GSM short residence point peer protocol SMPP, interface connection, and message processing mechanism; on the analysis of the GSM short message value-added service interface, a GSM short message value-added business interface communication service based on SMPP protocol is detailed. Implementation of the program.

Key words: SMS value-added business; SMPP protocol; communication service interface; UNIX network programming

Abstract:. This paper introduce the concept and structure of GSM Short Message Value-added Service and the Short Message point-to-point protocol SMPP Then gives a method of Design and Implementation of the GSM Short Message Value-Added Service Interface Based on Protocol SMPP in Details. Some Important Technology Items Are Also Shows.

KeyWords: Short Message Value-Added Service; SMPP Protocol; Communication Interface; Unix Network Programming

1 Introduction

The short message service is the only business in the GSM / DCS1800 system that does not need to establish an end-to-end service channel. It transmits short messages through the signaling channel of the GSM system (when the SDCCH user is normal, when the SACCH user is busy), the short message is transferred via SMSC. Store and forwarding the short message of the user, how to make full use of the SMSC's effective resource to make the convenient value-added business, implement the interconnection and sharing of information, which provides more information for short message services.

At present, SMSC provides interface ways with externalities. The most widely used protocol has SMPP (Short Message Peer To Peer) (including China Mobile Point Protocol CMPP) / CIMD (Computer Interface Message Distribution). With the SMPP communication service interface, many applications can be provided to users, providing broad prospects to carry out new services.

2, SMPP protocol format and message interaction definition

2.1 SMPP PDU Definition

The SMPP protocol is an open message conversion protocol; it defines a series of operational protocol data units (PDUs) and data exchanged between the ESMS application system and SMSC as the SMPP runtime. Thereby completing the information exchange of SMSC and ESMES (external short message entities). SMPP is a switching between the request and response protocol data units between SMSC and ESME, each SMPP operation consists of a request PDU and a corresponding response PDU and this exchange is in TCP / IP or X. 25 network connection. Therefore, based on the SMPP short message value-added service interface utilizes the Socket network programming implementation. According to the SMPP protocol, each PDU structure defines the PDU Header and PDU Body (Some PDUs None), see the following table: PDU header (MANDATORY) PDU Body (optional) The length of the PDU of the entire PDU PDU sequence Number Parameters Optional Parameters Command Length Command ID Command Status Sequence Number Mandatory Parameters Optional Parameters Unsigned Long Unsigned Long Unsigned Long Unsigned Long Mixed TLV

Some of the protocol define a very complex optional parameter, the structure of each optional parameter is defined as follows:

Optional parameter tag parameter value of byte length parameters TAG longth value unsigned int unsigned INT grows long

Its definition is to expand application functions, but in common short message value-added services, just use the necessary parameters of the PDU, but if necessary, it is only added to the PDU definition structure, and the implementation of the system no effect.

2.2 Short Message Value Value Business Interactive Data Format Definition

The role of the short message value-added business interface is to establish

ESME

versus

SMSC

And the connection of business applications. The schematic diagram of its structure is as follows:

SMSC

Communication Interface

Basic information database

Its function (1) performs SMPP decoding from the SMSC's protocol data, and the information obtained is written to the database or sent to each service center; (2) SMPP encoding from the message from each business service center, through the connection provided by the communication module Send to SMSC and write the necessary information to the database. The SMSC and the communication interface interacts through the SMPP protocol PDUS, and the message interaction between the communication interface and the various business sources must also determine the meaning of the data frame, guarantee the correctness of the message interaction, and due to many information in SMPP encoding Decoding, decomposition is decomposed, so the data frame format is required for front-end business center data communication, as follows:

Frame header (mandatory) Frame Body (optional) Frame Length Frame Type ID Frame Status Frame Sequence Equivalence Parameters Command Length Command ID Command Status Sequence Number Mandatory Parameters 4 Bytes 2 bytes 2 bytes 4 Bytes Mixed

3. Implementation of the communication interface service system

3.1 System completion of functional requirements

(1) Connection and binding with SMSC

(2) Connections to each application business center

(3) Receive SMSC short message, decoding and making short message answer coding

(4) Configuring a short message legal inspection, identifying the application service and forms a corresponding internal data frame

(5) Send internal data frames to Factory Application Business Center

(6) Receive internal data frames sent by each application service center and respond

(7) Resolution of the accepted data frame and perform SMPP encoding and transmitted to SMSC (8) for short message billing statistics for transmitting and reception

3.2 System design and implementation

The main function of the above system is that the system is actually relatively independent of two processing flows, one is to process the encoding, decoding, and data of SMSC, send; the other is data frame encoding, decoding, decoding, decoding, and Data occurred. And the arrival of the message has random, fast, and sudden, and thus the system is designed as two main processes. Handle SMSC messages and application service center messages separately. The message queue is communicated between the two processes, because all messages in the short message value-added service can be considered a separate message, no logical relationship does not have real-time sharing relationships. In order to ensure the safety and correctness of the system, the transmission of the short message is controlled; in order to adapt the expandability of the system, the database is handled separately, and the database access process is handled separately. The system structure diagram is as follows:

SMSC process

SERV process

SMSC initialization module

SMSC-> Serv

message queue

SERV initialization module

SMSC

Application service

Serv-> SMSC

message queue

Code function library

Timer -> SMSC Message Queue

SMSC-> Timer Message Queue

database

Timer process

3.2.1 SMSC Process Process Function Process

First, the SOCKET connection is performed with the SMSC, and the TCP port is listened. The SMSC hair binding message is received, the short message transmitted by the SMSC is received, and the legitimacy is checked, and the legally correctly classified message forms the internal data frame defined by the front desk business application (format The previously defined), sends a set of internal data frames to the SMSC-> Serv message queue; then take the Serv-> SMSC message queue message package and start the timer, send the PDU to SMSC. The internal structure is as follows:

SMSC process

SMSC

SMSC

Socket_smsc

PDU Receive & Processing Module

Serv-> SMSC Message Queue Processing and Package Module

Bind module

Stock module

Timer -> SMSC Message Queue Processing Module

Start timer module

Turn off timer module

Packet array

SMSC-> Serv

message queue

Serv-> SMSC

message queue

The role of the Packet structure array is to store the PDU package that is about to send or sent, which is defined as follows:

Typedef struct {

Unsigned int seqnum;

Int ORDERNUM;

Char Data [MAX];

} pend_packet;

Each PEND_PACKET structure corresponds to a PDU package, where seqnum is consistent with the sequence_number in the header in the PDU package; the ordernum is the serial number of the PDU package into the Packet array, that is, the global variable ORDERNUM, in each call package When the module, the ORDERNUM will automatically increase, then the ORDERNUM of the stored PDU is this OrderNum. However, after receiving the response of the PDU package, the PDU package is set to -1 in the ordernum in the packet array, indicating that it is cleared.

Because each SMSC corresponds to 5 states, when the buckle module is called, only the PDU package can be sent directly to the corresponding SMSC when the corresponding socket is data_status, otherwise the binding module is called to re-tie the SMSC. set. In both cases, the PDU package is stored in the packet array. After receiving the response package of the binding packet, the status of the binding packet in the packet array is set to -1, and the Socket is set to DATA_STATUS in the Socket_SMSC table, and the packet array belongs to the socket. The PDU package is sent to the Serv-> SMSC message queue, and the Serv-> SMSC message queue processing module calls the package module to send these packages to the corresponding SMSC. After receiving the packet's response package, the status of the packet in the packet array is set to -1.3.2.2 Serv process processing function flow

The Serv process is relatively simple, complete the data reception, encoding and sends to the Serv-> SMSC message queue; Take the SMSC-> Serv Message queue to send to the front desk business service center. Implementation structure map.

3.2.3 Timer Processes and Database Accessions

In the communication software system, it is necessary to use the timer to manage the scheduling and communication of the task, the timing of the communication protocol (providing error control) and the timing update of the system data. In applications where the number of clocks and the number of species, the accuracy requires not high, the clock function provided directly can be used directly. However, the actual communication software requires more clock type, and the number of clocks clock is huge. Some of the precision requirements are extremely stringent, in which case the real-time operating system can be considered. The SPEC1170 in Linux provides three intervals, one of which is the ITIMER_REAL type. Its mechanism is: When the intervals of this type expires, the system core will issue a SIGALARM signal, which can sense the interval by capturing this signal. The expiration of the timer. Based on this principle, the multi-task timing server based on the SPEC1170 software interval timer based on Linux operating system is designed to support real-time communication systems.

Communication Interface System Access to Oracle 8i Database With a separate process, Oracle provides a PROC Preciator, and the PROC can pre-compile. PC files into .c files, then link the head under the Oracle database in the LINUX / UNIX Files and library files, compile links into executables.

4 Conclusion

The short message value-added interface communication system is designed to serve customers with a structured module. In terms of performance, the priority between multiple threads and reasonable coordination multiple processes and the internal task priority is used, and the non-blocking mode of the system is changed to block the system to reduce the size of the CPU when the system is idle. )the way. The system runs under the Sun Solaris system, and we use it in the GPS vehicle positioning software system, practice prove, it achieves the desired design goals to meet the requirements of system communication applications.

references

[1] Key A. Robbins, Steven Robbins, Paratical UNIX Programming, 1999, 8.

[2] SMPP Developers forum; Short Message Peer to Peer Protocol Specification V3.4; Document Version 1.2; 1999.10

Research on the SMPP of GSM Short Message Interface Protocol. Journal of Wuhan University of Science and Technology; 2000.12 (4): 12 ~ 17

转载请注明原文地址:https://www.9cbs.com/read-64409.html

New Post(0)