Implementation of SMS gateway-Based WAP PUSH

Source: Internet
Author: User

Wap push has the advantages of active and timely information transmission and the ability to receive information anytime and anywhere. Therefore, it has good application.
Foreground. This article briefly introduces the wap push system framework, push protocol and push method, and focuses on the implementation of wap push through sms gateway.

1 wap push technology Overview

1.1 What is WAP PUSH

The wap push technology is based on the customer service.
The server sends information to the client.
. Compared with the traditional pull (pull) technology, the main difference is that the push (push) technology is used by the server to actively send information to the client, while the pull (pull) Technology) the client actively requests information. The advantage of push technology lies in the initiative and timeliness of information.

The push technology fails to achieve great success in the Internet for many reasons. The main reason is that fixed devices such as computers in the fixed network are users.
Sufficient resources are provided.
And capabilities to find information. Therefore, users usually use it as a window for browsing information, rather than passive information recipients. At the same time, fixed network users require much more information accuracy than timeliness, so the push technology has not been widely used.

In mobile
Because there is a network
Bandwidth, mobile terminal capabilities, high self-paid standards, and many other restrictions, make the user's query information limited, if important information is pushed to the user's mobile device in a timely manner, it is undoubtedly very convenient for the user. Mobile Communication
Of
The advantage is that mobile devices can receive information anytime, anywhere. Therefore, the push technology can be used in mobile networks
Push is the product of the combination of push technology and mobile communication. WAP
Push is the push technology applied in mobile networks. It combines the general push technology with the characteristics of mobile networks. Its system framework, protocol and service methods are very similar to the push technology on the fixed network.
Different.

1.2 wap push system framework

The wap push framework mainly includes the push initiator (Pi: Push initiator) and push proxy.
Network
Off (PPG: Push proxygateway) and push customer (PC: Push
Client. Pi is located in the Internet, while PC is in the WAP field. The protocols used by PI and WAP clients are different, and a protocol conversion needs to be established in the middle.
The gateway is PPG. PPG communicates with Pi through the push Access Protocol (PAP: Push accessprotocol ),
Ota: Push over-the-air) to complete the data transmission task of pushing information to the customer.

PPG completes most of the work in the PUSH architecture, including access from the Internet to the mobile network, as well as related authentication, security, client control, and so on. Provided by PPG
The main services include: 1) PI identification, authentication, and access control; 2) perform Syntactic Analysis on the pushed content, and check and correct errors Based on the Data Type Definition (DTD); 3) customer addressing and Information Transmission
(4) protocol conversion between pap and push OTA; (5) compressing and compiling information to improve the transmission efficiency in wireless channels.

In addition, PPG can also implement multicast and broadcast through the alias mechanism to map some specific address aliases to multicast or broadcast operations. Specific solutions
It can be determined by the system implementer. Different clients have different capabilities. PPG is also responsible for responding to Pi's customer capability query requests so that pi can construct appropriate content formats for different clients.

1.3 push Protocol

PAP is the communication protocol between PI and PPG. It uses Extensible Markup Language (XML) as the Message Description Language and transmits data through a simple request response mechanism. PAP can be implemented on multiple communication protocols (including Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP.

Push OTA is a simple protocol layer running on the Wireless Session Protocol (WSP), responsible for data transmission from PPG to customer proxy. Push
OTA can use two types of WSP layer services: connection-oriented sessions and non-connection sessions. For push using connection sessions, an active session context must be provided between the PPG and the client; push without connection
To complete communication through the reserved port.

1.4 PUSH Service Method

The push protocol of WAP defines the service indication (Si: Service indication) and service load (SL: Service
Load. Service indication refers to pushing the new information Indication and related Universal Resource Identifier (URI) to the user, and the user selects to process the information immediately.
Or later processing. Service loading pushes the URI of a service to the user, and then the client automatically uses the Pull Technology to start the service based on the URI. The difference between the two services is whether the user is involved in pushing messages.
Information processing process. Sl is transparent to users for processing push information, while Si instructs users and asks users to make choices for subsequent processing.
Push can be a site or a service
By text message.
To mobile phones that support WAP PUSH
In this way, you only need to read this text message and open the link in the text message to directly access the business. Therefore, wap push achieves the combination of SMS and WAP services, saving users time to find services and facilitating users to directly find and use their favorite services.

2 Introduction to Short Message Gateway

Short Message Gateway (ismg) is a device between the short message center (SMSC) and the service provider (SP). It provides a secure and fast channel for data exchange between the two entities.
. The gateway and the short message center use the smpp protocol (Short Message Peer to Peer) and the SP use the CMPP protocol (China Mobile Peer to Peer, China Mobile
Point
Protocol), so the Short Message Gateway needs to complete protocol conversion, billing, routing, security, network management, and other functions. Specifically,
The smpp communication proxy system connects the gateway and the short message center (SMSC) in the GSM network to ensure accurate receipt and transmission of data and efficient and reliable data transmission. To meet the requirements of the specifications
If the packet loss rate exceeds 0.001%, The smpp communication proxy must support traffic control. The CMPP communication proxy system is used to connect to the SP service provider. It is different from the smpp communication proxy system.
Because of the protocol, the CMPP communication proxy is a server and needs to wait for the SP connection. The smpp communication proxy is a client and needs to actively connect to SMSC. The Short Message Gateway processing system is in the Gateway
The most complex processing process, which includes the following tasks)
Query routes, maintain route tables, and perform protocol conversion and data distribution. The firewall system provides security protection for the gateway system, including IP packet filtering and authentication. SMS gateway billing system mainly forms various billing methods
The bill provides a basis for billing. The business management system provides statistical reports for businesses, generates reports, and adds, modifies, and deletes user data for operators, and monitors, queries, operates, and maintains the gateway system.
Provides interfaces and interfaces.

3 Send wap push based on SMS Gateway

There are two ways to send wap push: One is through the PPG gateway and the other is through the smpp protocol. Smpp is a basic protocol in China.
There are three major protocols derived from it: China Mobile's CMPP protocol, China Unicom
SGIP (etip on CDMA) and PHS smgp. China Mobile's PPG gateway has a long development cycle and a complicated commissioning process. However, CMPP protocol makes it more flexible to send wap push messages based on SMS gateway, relatively simple.

3.1 Implementation Mode of WAP PUSH

Connect to the GSM Modem through the serial port of the computer and send wap push to the mobile phone. This method divides wap push into three modes: Block
Mode, text mode, and PDU mode. Currently, block mode is rarely used, while text mode can only send ASCII messages.
It cannot send Chinese Unicode codes, while the PDU mode is more complicated to develop. It needs to write a special function to convert the text to the PDU format, but the PDU
Mode is supported by all mobile phones and can use any character set. It is also the default encoding method of mobile phones. Therefore, the PDU mode is used to send wap push.

3.2 PDU Mode
 
Three types of codes can be used to send wap push in PDU mode: 7-bit, 8-bit, and ucs2. 7-bit
Encoding is used to send Common ASCII characters. 8-bit encoding is usually used to send data messages. ucs2 encoding is used to send Unicode characters. To implement Chinese WAP
Therefore, the ucs2 encoding is used, that is, the Chinese Unicode code.
(1) ucs2 encoding principle the so-called ucs2 encoding is to convert a single character (1-2 bytes) to 16 bits according to ISO/iec000046
. Converts a single character to a string consisting of four digits '0'-'9' and 'A'-'F' and the denominator. The message to be sent is in the format of ucs2.
Code.
(2) We can get the Chinese Unicode code through ucs2 encoding, and then we can compile the sending PDU string. On the surface, the PDU string is ASCII.
It also consists of numbers and letters '0'-'9' and 'A'-'F. They are 8-bit hexadecimal numbers or BCD decimal numbers. PDU
In addition to the sent message, the message string also contains many other parameter information, such as the service center number, target number, and encoding method.

For example

0051000ba13108086406f600f5a7850b05040b8423f _
2017303010129060603ae81ea8dca02056a0045c6080c033231312e _
3133362e3135332e33302f776170707574252f70757109496e6465782e _
6a73703f7075742549643d30367%1313134313630%31000103e8a _
Bytes
E5aeb9000101 _

A string of wap push that can be successfully sent, including the description of Chinese characters and the WAP page address. The specific analysis is as follows:

00 the length of the SMSC address information 00 indicates that the SMS center number is set on the mobile phone. The "SMSC address format" and "SMSC address" segments of the PDU string will be omitted.

51 basic parameters (TP-MTI/VFP) do not require a reply

00 Message Reference value (TP-MR)

Length of the phone number of the other party 0 B

A1 destination address format A1: Domestic format

3108086406f6 destination address. Fill in 'f' to generate an even-bit post-parity switch.

00 protocol identifier (TP-PID) is a common GSM type, point-to-point method

F5 user information encoding method (TP-DCS)

A7 validity period (TP-VP)

85 user information (TP-UDL)

Total length of the 0b wap push Header

05040b8423f0 indicates that the next step is a WAP PUSH

00 indicates concatenated short messages.

03 Length

03 reference number

01 indicates that one message is sent.

01 serial number of the current package

29060603ae81ea8dca WSP

02 mark bit

05-// wapforum // DTD Si 1.0 // en

6a UTF-8

00 mark start

45 <si>

C6 <indication

08 <action = signal-high>

0C href = "http ://

03 string start

3231312e3133362e3135332e33302f776170707574252f
70757425496e6465782e6a73703f7075742549643d30369353131313431363038531 URL

00 URL string ends

01>

03 content description string start

E8afb7e782b9e587bbe4bba5e4b88be993bee68ea _
5e88eb7e58f96e5bda9e4bfa1e58685e5aeb9 content description string

00 content description string ends

01 </Si>

01 </indication>

The above analysis shows that wap push can be sent as a special text message.
The content sent by the push package is actually the same as the XML content sent through the PPG gateway, but is compressed. The compressed format is called wbxml, which uses code to represent some tags. However
The thumbnail of wbxml is divided into two parts: one is that all types of XML are common, and the other is that different types of XML have different interpretations.
When receiving such information, the user can directly access the WAP website address loaded in the information when the client's mobile phone supports WAP, so that the server can be promoted.
Convenience for users. In the ucs2 encoding mode, the maximum number of characters that can send short messages is 140 bytes, that is, the total number of characters in the push URL and description text in wap push is 140, therefore, the limit on the number of words in the description text is related to the length of the pushed URL.

4 Conclusion

The wap push technology combines the advantages of the push technology and the characteristics of mobile communication services, and has good application prospects. However, WAP
Push technology still has some urgent problems, such as information Authentication and authentication, Information accuracy, and how to avoid spam information. How to solve these problems will be WAP
The key to successful push technology. In addition, with the development of GPRS technology and 3G wireless communication technology
The bandwidth of wireless channels will increase gradually, and wap push will be able to push multimedia information further, which has a broader application prospect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.