SMS development - basics

xiaoxiao2021-03-31  212

http://blog.9cbs.net/bulbul2006/

Very soil topic, but recently helped friends to do this, so write something out to give beginners. I. Preparation of the SP Development Information website has a lot, but mainly the following documents: 1, MISC1.6 SP order notification interface Requirements 2, SMPP protocol 3, MISC SMS SP access training (Lite) .ppt4, The SSO platform access specification in the DSMP specification details V1.5.1.pdf5, available for SP viewed error code 6, SSO platform access specification in the DSMP specification.pdf7, Internet SMS gateway interface protocol V3.0

Second, SMS business classification

The SMS business is divided into two kinds. One is a bitmap service. The other is custom service 1. On-demand business has no service_id, no number, such as YLSH description: billing code, and service_id is a thing mobile phone user has sent information, SP can issue information, move according to one uplink, SP can give him information in a certain amount of time, can send multiple information, but each information is the same LINKID

A LINKID can bring a billing code (this is a mobile declaration, with this code deduction, 1 yuan or 2 yuan or N yuan), for example, mobile phone 13912345678 issued an uplink information A, which is in the mobile declaration The MISC platform passes him, then assigns a linkID to return to the SP. SP determines what the user has used in accordance with the command A, then give the user

Send a message, send information, be sure to bring Lingkid and billing code, otherwise you cannot send, such as the next three, the LINKID and billing code of each message are the same (because the user has only one uplink instruction), so In fact, although the SP has been sent 3

The fees can only be deducted. With linkid and billing code just a parameter that is successfully issued to ensure information. All business is like this, on-demand, and customization

2, custom business: The front of its service_id has-numbers, such as the -ylqtyx mobile phone user sends a message, after MISC authentication, admit that he is willing to use custom business, then he is listed as custom users, and after even if the user did not send information , SP can also take the initiative to send him information, and there is no assignment at this time.

LiniD, just service_id, that is, billing code, each time delivery information must bring this service_id. He also divided into two small categories 1), customize the number of users who can give the order relationship, the user receives the fee buckle fee indicated by Service_ID, one month, most buckle users 10 yuan, more than 10 The part of the yuan, still needs to be sent with service_id, just

Mobile no longer deduction (this section, SP does not require tube) 2)

Third, development technology only meets the first point of protocol and norm, can do it with the current popular development language and database. 1. Mainly critical is network programming, and SOAP programming 2, related noun explanation MISC (Mobile Information Service Center) is a data operation platform that is fully compliant with China Mobile Data Business Management Platform Technical Specifications (DSMP), it Complete the service management and control functions of the data service, implement user management, business management, and SP management, provide open, standard unified web service interfaces, and can provide costs for each business gateway and SP.

The SMPP interface protocol was originally included in the GSM03.39 specification in the GSM03.39 specification, which describes the protocol relationship and data transmission format of communication interaction between short message centers and short message entities. Description of the SMPP interface protocol

Mainly facing simple communication interactions, formulating the specification is set to V3.30; after the SMPP Developer Forum will evolve the protocol version to v3.40, SMPP V3.40 protocol specification is fully compatible with G

SM 03.39 Protocol standard. In this specification, the interface between the short message center equipment and the short message center equipment and the short message stock trading business processing platform adopts the GSM03.39 V3.30 protocol specification, if there is no special instructions all

The proposition is regulated. The SMPP protocol can be carried as the underlying communication with TCP / IP or X.25.

ISMG INTENET Short Message Gateway Internet SMS Gateway

DSMP Data Service Manage Platform Data Business Management Platform

SMPP Short Message Peer to Peer Short Distribution Point Point Agreement

CMPPCHINA Mobile Peer to Peer China Mobile Point Association CMPP protocol mainly provides the following two types of business operations: (1) Short Message Mobile Originate, SM Mo, detailed procedure, please refer to "Mobile Dream Network SMS Service Signaling Process Specification V3 .0.0 "; (2) Short Message Mobile Terminated, SM MT) For detailed processes, please refer to" Mobile Dream Network SMS Service Signaling Process Specification V3.0.0 ";

SMSC Short Message Service Center Short Message Center

GNS Gateway Name Server Gateway Name Server (Connection Gateway)

SP Service Provider business provider

ISMG_ID Gateway code: 0xYZ01 ~ 0XYZ99, where XYZ is the provincial section code, when the number of bits is less than, the gateway code for Beijing No. 1 is 001001, the gateway code number 1 of Jiangxi 1 is 079101, and the company pushes SP_ID SP Code: The logo, address translation, billing, settlement, etc. in the network are based on corporate code. The corporate code is represented by a number, from "9xY000" to "9xy999", "

XY "for each mobile company code

SP_CODE SP Service Code: Service Code is a service provider code that is provided to the user in the upstream service using SMS mode. The service code is indicated by a number, the national business service code length is 4, ie "1000

"-" 9999 "; local business service code length is unified to be 5, ie" 01000 "-" 09999 "; the Ministry of Information Office puts new requirements for new SP service code distribution, requires" 1061 "-" 1069 "As a prefix, China is currently moving

The following assignments are made: 1062: Used in the provincial SP service code 1066: The national SP service code is reserved.

Service_id SP's business type, number, letters, and symbol combinations, by sp self-definition, such as image passing can be set to TPCQ, stock query can be defined as 11

DSMP Data Service Management Platform SSO SINGLE SIGN ON, single-point login HTTP HYPER TEXT TRANSFER Protocol, hypertext transport protocol. HTTPS Hyper Text Transfer Protocol Over Secure Socket Layer, a hypertext transfer protocol based on a security socket layer. ICP Internet Content Provider, Internet Content Provider WWW World Wide WebXML EXTENSIBLE MARKUP LANGUAGE The intermediary entity between the SMS Center, the Internet SMS gateway is responsible for receiving the SP sends to the mobile user information and submits to the SMS center. On the other hand, move

The information of the user to play the SP service will be sent by the SMS center via the Internet SMS network. In addition, in order to reduce the signaling load of the SMS center, the Internet SMS gateway should also forward the information submitted by the SP to the corresponding Internet short based on the routing principle.

Letter gateway. The Internet SMS gateway obtains the forwarding routing information between the gateway by querying the gateway (GNS) query. In addition, ISMG must also be connected to the data service management platform DSMP, and authenticate the user, business, and order relationships in the business process and batch business.

3, the interface name specification interface name adopts the word first letter uppercase, other letters lowercase. The letters in the abbreviation are capitalized; in the interface parameters, the field name naming specification with the basic data type, the word first letter is capitalized, there is no connection between the word; for abbreviation words, such as ID, URL, ICP, MSISDN, etc. Wire unified use.

The SSO platform is actually part of the user's home DSMP. When the user is logged in, it is necessary to redirect to the user's self-service portal, regardless of the full network SP or local sp, all the SSO platform to the user's home.

Record, and complete the management of the session, the user ordered information is stored in the home DSMP platform, and user authentication is done by the home DSMP. Therefore, SP needs to be connected to an access ground SSO platform to complete the management of the session. At the same time, between the respective SSO platforms, there is also a need for mechanism management and user data needed to synchronize to ensure that user data can be obtained on any SSO platform. In order to achieve this requirement, it is recommended to use centralized control.

The way to be synchronously is implemented, that is, there is a unified central node in the entire DSMP deployment schema, centrally stores all logged in user data, and the SSO platform of each province will be redirected to the central SSO flat when the user needs to log in.

Taiwan completes the login operation. See the user login, service order / on-demand, and user signing process description.

Fourth, relevant data description

1, SyncorderReranceReq

00110338785301 This message number < soap-env:HeadeeR): DSMP: TransactionID XMLns: dsmp = "http://www.monternet.com/dsmp/schemas/> <% = TransactionID %> This message number syncorderReranceResp <% = version%> The version number of the interface message is "1.5.0 <% = HRET) %> 3, cancel service request package reverse cancellation process description: reverse cancellation is the cancellation process initiated from SP When the MISC is processed from the cancel message from the SP, the processing flow is as follows, the flow is as follows: (0) SP instead of the user, initiate reverse cancel requests UnsbscribeServiceReq to the MISC and waits for MISC processing; (0) MISC's source address, corporate code, and determines whether the SP is allowed to cancel; (0) After the access authentication is successful, user authentication and ordering relationship authentication, determine whether the user status is Correct and whether there is a subscription relationship; (0) After the above authentication is successful, MISC sends a subscription relationship to the SP. Synchronous request package syncorderReLanceReq; (0) After SP receives a synchronous request, the corresponding cancellation process is canceled, and returns the order relationship synchronization response syncorderReranceReSP; (0) After the MISC receives the answer, it is determined whether the response value is 0. If the answer value is 0, the order relationship is canceled in the MISC, and the SP returns a successful reverse cancellation handleable package unsubscribeServiceResp; if the answer value is not 0, then

Do not cancel the ordering relationship, and return to the SP NSUBSCRIBESERVICERESP; (0) sp s If you receive misc error response, the cancellation failure, SP must be handled accordingly, such as canceling cancellation Order relationship recovery, etc .; (0) If you receive the correct response from MISC, SP can not do any processing;

XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance" XMLns: XSD = "http://www.w3.org/2001/xmlschema" soap-

Env: EncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/" xmlns = "http://www.monternet.com/dsmp/schemas/> 9130020301801050 This message number < UnsubscribeServiceReq XMLns = "http://www.monternet.com/dsmp/schemas/"> 1.5.0 unsubscribeServiceRVICEREQ message type sender's address 400 913002 Receiver's address 0 0024 billing user Identify 1 See the definition 13805002424 User mobile phone number > Using user ID When using the user and billing user as the same user , FeEUser_ID and Destuser_ID are the same. 1 13805002424 service logo 1 913002 -tqaau

Cancel service response package

XMLns: XSI = "http://www.w3.org/2001/xmlschema-instance" XMLns: XSD = "http://www.w3.org/2001/xmlschema" xmlns: dsmp = "http: // www .monternet.com / DSMP / Schemas /> 1.5.0 unsubscribeServiceResp < / Msgtype> 0 Return Value: See the definition below 4, return value definition

See the status code value specified in the HTTP / 1.1 protocol during HTTP communication, which is not included in the returns of this specification. Specifically, the following: 0: Success 1: Unknown error 2-99: Reserved 4000-4999 For the error code between the interface message between MISC and SP: 4000: Invalid MSGTYPE4001: Invalid Action_ID; 4002: Invalid Action_ReasonID; 4003 : Invalid SP ID4004: Invalid ServiceID4005: Invalid PSeudocode4006: Invalid AccessMode4007: MISC Synchronous Open Service, but the SP end has a subscription relationship, and the state is 4008: MISC synchronous open service, and there is no order relationship of the SP terminal, However, the opening service failed 4009: MISC synchronous open service, but the SP end has a subscription relationship, and the state is pause 4010: MISC synchronization stop service, and the SP end has a subscription relationship, but the cancel service failed 4011: MISC Synchronous stop service, but SP There is no order relationship 4012: MISC synchronous pause service, and the SP end has a subscription relationship, but the service failed 4013: MISC synchronous pause service, but there is no order relationship 4014: MISC synchronous pause service, but the SP end has ordered Relationship, and status is pause 4015: MISC synchronous activation service, but the SP end has a subscription relationship, and the status is 4016: MISC synchronous activation service, but the SP terminal does not have order relationship 4017: MISC synchronous activation service, and the SP end exists Order relationship, but activation service failure 9000-9999 is a system-level error: 9000: System disk read and write error 9001: Network abnormal 9002: Network error 9003: Business gateway, business gateway cache 9004: Business gateway, and business gateway buffer Full, MISC caching, and temporarily do not send a message, wait for a while try again. 9005: Misc busy, MISC cache 9006: Misc is busy, and the MISC buffer is full, the business gateway is cached, and the message is not sent, waiting for a period of time try again. 9007: Business gateway exceeds the limited traffic 9008: MISC exception, not available 9009: Business gateway exception, not available 9010: This service gateway does not permission call this interface message 9011: MISC No permission to send the interface message to the service gateway 9012: Remarks Page 6 MISC SP Business Reverse Interface 9013: Message Type is not supported, 9014: Verification error, unable to resolve SOAP and XML structure, missing the field, or message, format is incorrect 9015: Reject message, Server unable to complete request 5, DeviceType definition device type 0: dsmp100: ismg101: WAP sp proxy1xx: WAP portal201: WWW portal202: Voice Portal203: PDA Portal2xx: Other portals

300: MMSC301: KJAVA Server302: LSP3XX: Other Application Platform

400: SP

6, DeviceID Define device number, device number uses the network number of each device, such as the SMS gateway uses the gateway ID, using its corporate code for SP, the device number is allocated by DSMP, and the number in the same device type is unique

7, useridtype Define User Identity Type 1: Iigan with Mobile Number 2: Identify 3: Both of the two

8, SPTYPESP Business Type 1: All SP2: SP3 provides SMS service SP4: SP4 for WAP service: SP5 with MMS services: SP6 with Kjava services: SP7 with Mail service: Provides LBS service SP8: Provide WWW service SP9 ~: expansion

9. The logo mode of the serviceIdType service type: 1: Spid spserviceid2: AccessNo Featurestr

5. MISC's business matching processing process descriptions for MO: 1, SP, in accordance with different service types, fill in the business directive according to the different business types, may exist "Order instructions, cancel instructions, on-demand instructions and ordinary Mo "4 instruction mode, set the instruction, need to refer to

The transmission number (long number) and instruction content corresponding to the instruction, and can specify whether the transmission number and the instruction content need to be precisely matched. Accurate match means that only matches only when the matching content and the set instruction need to be exactly the same (including the length). For example, if the send number is "800101", only when the user sends a MO to

When "80010123" will not match the instructions of "800101"; only the instructions sent to "800101" will be matched. [Note] For the same instruction mode, each service can set a number, such as a service can set up 5 order instructions and 5 cancel instructions. Current MISC can support more than 5 instructions, but from the perspective of convenience management, With

A mode instruction, it is recommended not to exceed 5 when SP is set. 2, the user's MO SMS is composed of two parts: sending the number and the content transmitted, plus the matching mode set when the service application is set, which constitutes the basis of the match. 3. When a MO to MISC is authenticated, MISC will match the sender (long number), which is performed according to the principle of the maximum match exact match. If there is a match success, remove the corresponding service code and instruction type; if you

If you can't help, the authentication fails, the Mo will not be sent to SP. 4. In the list of previously matched, the instruction content is matched, and it is carried out in accordance with the principle of maximum match exact match. If there is a result of matching, remove the corresponding service code and instruction type; if you have no

The corresponding matching result is taken to return a space value while notifying the SMS gateway as a normal MO forwarding. 5. SP is filling out the MO ordering instructions to avoid nested instructions (eg, "888801" and "8888011" also exists AccessNo). 6. For instructions that match the success, MISC is different depending on the mode of the match, the processing mode is as follows: • MISC will check if the user has ordered the service. If not ordered, Misc will complete the order, At the same time, the contents of the user MO will be used through the user to order the relational data synchronization interface (ProVision interface

) Transfer to the SP, and the length of the user Mo will be separated between the long number and command contents of the user Mo in the FeatureStr field in the ProVision interface. At the same time, MISC will notify the SMS gateway This is a subscription instruction, and the SMS gateway will not forward the MO to the SP. If the user has ordered the service, the MISC will return the MO as a result of the MO as a normal MO to the SMS gateway, inform the SMS gateway as a normal MO to reb, for custom Monthly service,

The MISC will return the MO to the SMS gateway to the SMS gateway back to the SMS gateway, and inform the SMS gateway to forward this text message as a SP to SP. • For cancellation, the MISC will check if the user has ordered the service. If you have already ordered, the MISC will complete the cancellation, and the contents of the user MO will be used through the user to order the relational data synchronization interface (Provision interface

) Transfer to the SP, and the length of the user Mo will be separated between the long number and command contents of the user Mo in the FeatureStr field in the ProVision interface. If the user does not order the service, MISC returns to the SMS gateway to fail, and the SMS gateway will not forward the MO to the SP. • For on-demand instructions, MISC needs to determine whether the business is a custom-to-order class business or a normal on-demand class service. (LINKID), and return to the SMS gateway to the authentication success, and return the linkID to SMS network

Off, the MO is forwarded to the SP by the SMS gateway; if the user is not ordered, MISC simply returns the successful response to the SMS gateway, and notify the SMS gateway as a normal MO as a normal MO forward. 2) For the on-demand class service, the MISC will directly generate a temporary order relationship (LINKID), and return to the SMS gateway to return to the SMS gateway, and the MO is forwarded as a SMS gateway to SP. For ordinary MO SMS, MISC returns the successful response to the SMS gateway, and notify the SMS gateway to forward this SMS as a normal MO to SP. Example Description: seq AccessNO FeatureStr ANCheckFlag FSCheckFlag1 8888 xw 1 02 888801 xw 0 03 888801 xw1 0 14 8888 01xw 1 15 8888 (null) 0 0 (HELP) [Note] AccessNO represented MO transmission number FeatureStr represented instruction content ANCheckFlag expressed AccessNO Whether to use exact match fscheckflag to indicate whether the content of the instruction is used exactly

For the above settings, users send xW1 to 8888011 we match Article 3 Record users send XW01 to 888801 We will match the 2nd record (first longest matching number) users send 01xW to 888802 We match to Article 5 Record (Will not match the record of Article 4, because the 4 recorded AccessNo is an exact match) User sends 01xW to 8888 we match the 4th record users send XW01 to 8888 we match Article 1 Record users send a to 8888 us Match the 5th record,

6. Example of business directive

Business Category Business Name IOD PUSH STK Product Description Business Code Dense Instruction Billing Type Price Return Returning Service Code Billing Type Price Send Frequency Service Code Billing Type Price Return Return Application Service Hye Hy Send Natural Statements to XXX Package 5 yuan 1 through natural language and virtual master

Holding "Hani" exchange chat handsome guy sister LT send a to xxx, according to 0.2 yuan 1 user registration assignment ID number, pass

Id number ID number to find a chat aonymous chat dating test, do not understand your heart CS send p to xxx monthly 7 yuan 1 psychological test big game wind moon pretty good people JR method M to XXX month 7 yuan 1 love role game game very confession GB method GB To xxx, 0.2 yuan 1, emotional story test, men and women NV law NV to XXX, according to 0.2 yuan 1 love test game transparent fish and water story YS method YS to XXX, 0.1 yuan 1, 2 transistor test official luck Fortune Peach Blossom Yu Method YU to XXX Press 0.2 Yuan 1 Birthday Test Game Fate YG Method YG to XXX Press Bar 0.2 Yuan 1 New West Travel Role Game Game Go to Right to Right Zy Method ZY to XXX Put 0.2 yuan 1, 2 Comics SMS story game heart XR method XR to XXX press 0.3 yuan 1 through the other party's message, guess the mobile phone number test stadium knows my heart XX method XX to XXX, according to 0.2 yuan 1, 3 constellation test Yiki Tarot TL Law TL to XXX monthly 7.0 yuan 1, 3 Tarot SMS version of the Yiki name and life XM method XM to XXX, 0.4 yuan 1, 4 name test game, top life, QS method QS to XXX, 0.5 yuan 1,4 birthday game

- ie, as long as it is sent to the beginning of the above alphabets, the movement is considered to have a bit broadcast or custom relationship, how is the difference between the business, and the package accepted by provision, which is now basically. - Because the movement has no free code, that is, the original Free, etc., there is no longer an error message. If it is designed, it is a deduction information; - As long as the user has a order relationship, all downstream The billing code must be used, and the custom service will be deducted, and the monthly business is issued with billing code, and the movement will not treat it as a silence user.

7. DSMP platform Web Services Interface Definition and SOAP Binding DSMP Platform Web Service Interface Design and Development Guidelines All Web Service Interfaces in the DSMP specification is designed according to Web ServicesDescriptionLANGUAGE (WSDL) 1.1 (2001/03/15) specification issued by W3C organization. And definitions, and consistency with relevant regulations in subsequent versions of WSDL standards. All interface design and development of products with DSMP specifications should follow the following principles: All messages in the interface and related data types of XML mode definitions should be defined by the XML schema definitions provided by this specification. See Appendix C. When deploying the Web Service, all XML schema definitions defined by the DSMP are included in the dsmp.xsd file and is referenced in the public URL address. The namespace named DSMP is defined in the WSDL definition. In the WSDL definition for XMLns: DSMP = "http://www.monternet.com/dsmp/dsmp.xsd", using DSMP: prefix, for example: Appendix is ​​the DSMP specification defines all referenced types and elements namespace and XML mode This namespace scope covers all WSDL interface messages. Seeing the example of Section 2 in the SOAP message. See Section 2. The WSDL definitions of the interface should be used in this specification, and the content is detailed in Section 3 of this appendix. When deploying the Web Service, all WSDL definitions are included in the dsmp.wsdl file and are referenced in the public URL. According to the WSDL standard, the WSDL definition of this specification interface mainly includes the following sections: Types: This specification uses the method of file reference, all DSMP specification definitions are included in the dsmp.xsd file; message ( Message): The message structure in the request or response generated during the calling process; operation (operation): Theoretical description of the action supported by the web service defined by this specification; Port Type: Terminal The definition of a set of operations supported; binding: The definition section of the SOAP binding, follows the WSDL1.1 standard, the port type is bound to the SOAP1.1 protocol, so any product adopts DSMP specifications No matter what supports the Middleware platform or SOAP private program that supports Web Service, or calls the Web Service interface, it should be supported by the Web Service interface. For example, for the caller, only the standard SOAP package message package is sent to the server side, it can be returned correctly, otherwise it is considered a call format error; port (port): the definition of the network address of the program that implements the interface; Service: That is, a series of ports of the interface.

SOAP Binding Principles This specification defines the Web Service interface to SOAP1.1 protocol format, all requests and response messages should be available in SOAP format, including SOAP envelopes, SOAP header and SOAP packages Three parts of the body (BODY). For any technique implemented, the call request message is issued with the above three parts, the types of classes and the block messaging structure are defined in dsmp.xsd. However, in the SOAP package, if a certain parameter is defined in accordance with the specification, the SOAP message may not contain an element that identifies the parameter. The returned SOAP message structure is asking a message; in this specification, the TransactionID parameter defined for the support for things is included in the SOAP header, and thus all SOAP messages must have a SOAP header, the interface program should be based on It is necessary to do the corresponding processing (used to identify things or ignore) in the SOAP header. The rule of TransactionID is a DEVICEID 10 digit, and the 10-digit number starts from 1 and is less than 10 bits. The step size of each increase is 1, and use it in turn. This specification follows the WSDL standard, the interface communication layer is bound to the POST and GET of the HTTP1.1 protocol. In accordance with this specification, both the server and the client are interacting through the HTTP's POST method. In this regard, HTTP message content format is bound to MIME format, such as Content-Type, which follows MIME standards, which is MIME standard, which is the focus of SMS development experience. Because it is just a few months, there are many details It cannot be included, and the detailed content can check the relevant documentation. It is also understood that there is a lot of misunderstandings, you can go to my blog communication. Welcome to reprint, but indicate the source. Blog.9cbs.net/cutemose

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

New Post(0)