Oob sms parameter settings reference

Source: Internet
Author: User

Oob sms Overview

OOB (out-of-bound) text messages are also called out-of-band text messages compared with the actual business channels of mobile applications. OOB is invisible to terminal mobile phones, the terminal application can intercept the OOB text message to push data to the client.

The OOB text message is actually a binary text message (data_sms in Android). After the Android system receives the text message, it does not store the text message or send System broadcast events, therefore, you cannot intercept the OOB text message by inheriting the contentobserver's observer mode.

In the Android system, the attacker method is used to intercept binary messages, and the specified listening port is configured to receive binary text message data from the port, parse the data, and perform subsequent business processing.

Smpp sending end settings

In VVM, the sender refers to the text message sending module in vvmgw. When sending the OOB text message, you must set the following fields: replace_if_present_flag, esm_class, protocol_id, and data_coding. In addition, you must set UDH, this UDH is used to specify the port on which oob sms messages are sent to the terminal. The specific parameter settings are as follows:

Submitsm. setreplaceifpresentflag (byte) 0x01); submitsm. setesmclass (byte) 0x40); submitsm. setprotocolid (byte) 0x7d); submitsm. setdatacoding (byte) 0x04); // sets the message content, and sets the UDH field bytebuffer buffer = new bytebuffer (); buffer. appendbyte (byte) 0x06); // udhlbuffer. appendbyte (byte) 0x05); // ieibuffer. appendbyte (byte) 0x04); // ielbuffer. appendbyte (byte) 0x15); // IED 5499, compatible with both iPhone and androidbuffer. appendbyte (byte) 0x7b); // iedbuffer. appendbyte (byte) 0x15); // IED 5499, compatible with both iPhone and androidbuffer. appendbyte (byte) 0x7b); // IED

Android Application client settings

To intercept binary messages on the android client, you must listen on the specified port (normally, the received binary messages are not stored in the SMS library ).

Add the filter Android. Intent. Action. data_sms_received to androidmanifest. xml and specify the listening port and other information, as follows:

<receiver android:name=".SMSReceiver">    <intent-filter android:priority="2147483647">         <action android:name="android.intent.action.DATA_SMS_RECEIVED"/>         <data android:host="localhost" android:port="16001" android:scheme="sms"/>    </intent-filter></receiver>

BlackBerry Application client settings

There is no related configuration file on the BlackBerry client. You can only specify the listening port through the Program (normally, the received binary messages are not stored in the SMS library ).

private static class ListeningThread extends Thread {         private boolean _stop = false;         private DatagramConnection _dc;         public synchronized void stop() {                _stop = true;                try {                        _dc.close(); // Close the connection so the thread returns.                } catch (IOException e) {                       System.err.println(e.toString());                } } public void run() {        try {                _dc = (DatagramConnection)Connector.open("sms://:5499");                for(;;) {                        if ( _stop ) {                              return;                        }                        Datagram d = _dc.newDatagram(_dc.getMaximumLength());                        _dc.receive(d);                       String address = new                       String(d.getAddress());                        String msg = new String(d.getData());                        System.out.println("Message received: " + msg);                      System.out.println("From: " + address);                       System.exit(0);                }           } catch (IOException e) {                   System.err.println(e.toString());           }      } }

Note: This port must be the same as the value of the IED field (3e81, or 16001) of the two bytes in the UDH of the SMS sent by smpp.

SMSC monitoring console-OOB SMS

SMSC Monitoring Station-normal text message

Android applications receive OOB text messages

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.