Sending A Bookmark Over SMS

send a bookmark over sms

Another use for SMS is configuring phones over the air (OTA). There are elaborate standard specifications written by the WAP Forum (now Open Mobile Alliance) and somewhat proprietary standards developed by Nokia and Ericsson.

Today I’ll show in detail how to send a bookmark according the Nokia / Ericsson specification. The specification is somewhat older, it dates from September 2001, but it seems almost all Nokia and many Ericsson devices still support this.

The bookmark is described in an XML file like the following:

[php]

<?xml version="1.0"?>
<!DOCTYPE CHARACTERISTIC-LIST SYSTEM "settings.dtd">
<CHARACTERISTIC-LIST>
<CHARACTERISTIC TYPE="BOOKMARK">
<PARM NAME="NAME" VALUE="Mobile Tidings"/>
<PARM NAME="URL" VALUE="http://mobiletidings.com"/>
</CHARACTERISTIC>
</CHARACTERISTIC-LIST>

[/php]

As before we send this XML document using an unconfirmed push. Here are the layers we need to implement:

  • the XML document needs to be WBXML encoded and
  • the WBXML need to be wrapped in a WSP (Wireless Session Protocol) Push PDU
  • this needs to be wrapped in a WDP (Wireless Datagram Protocol) packet
  • this needs to be sent inside an SMS

As always we start with the AT command that is used to send the bookmark and analyze in detail how this AT command was constructed:

AT+CMGS=133
0041000B915121551532F40004780B0504C34FC0020003F001010A062D1F2B6170706C696361
74696F6E2F782D7761702D70726F762E62726F777365722D626F6F6B6D61726B730081EA0101
6A0045C67F01871511034D6F62696C6520546964696E6773000187171103687474703A2F2F6D
6F62696C65746964696E67732E636F6D00010101

 

Here is a byte-for-byte explanation:

 

Size Value Description Section
1 octet 0×00 No SMSC supplied SMS
1 octet 0×41 SUBMIT-PDU + UDH present
1 octet 0×00 message reference
1 octet 0x0B Length of destination address in digits
1 octet 0×91 Destination is an international telephone number
6 octets 0x5121551532F4 Destination is ‘+15125551234’
1 octet 0×00 Protocol identifier
1 octet 0×04 Date coding scheme. This value stands for ‘8 bit data’.
1 octet 0×78 User Data Length. Size of payload is 120 octets.
1 octets 0x0B User data header length is 11 octets. UDH
1 octet 0×05 IEI 0×05 contains source and destination port.
1 octet 0×04 IEDL. Content is 4 octets.
2 octets 0xC34F Destination port is 49999. This is the port for OTA configuration.
2 octets 0xC002 Source port is 49154.
1 octet 0×00 IEI 0×00 contains concatenation information
1 octet 0×03 EIDL. Content is 3 octets.
1 octet 0xF0 Reference number
1 octet 0×01 Total 1 parts
1 octet 0×01 This is the 1st (and only) part
1 octet 0x0A The WSP transaction ID WSP
1 octet 0×06 This is a push PDU
1 octet 0x2D Headers consist of 45 octets
1 octet 0x1F Indicates that the length is greater than 30 octets.
1 octet 0x2B Length is 43 octets.
40 octets 0x6170706C6963
0x6174696F6E2F
0x782D7761702D
0x70726F762E62
0x726F77736572
0x2D626F6F6B6D
0x61726B73
Content type:
“application/”
”x-wap-prov.browser-settings”
1 octet 0×00 end of string
1 octet 0×81 Parameter name: 0×01 means ‘Charset
1 octet 0xEA Parameter value: 0x6A means ‘UTF-8
1 octet 0×01 WBXML Version 1.1 WBXML
1 octet 0×01 Unknown document type.
1 octet 0x6A Encoding UTF-8
1 octet 0×00 String table length
1 octet 0×45 <CHARACTERISTIC-LIST> element, with content
1 octet 0xC6 <CHARACTERISTIC> element, with content and attributes
1 octet 0x7F attribute with value ’TYPE=BOOKMARK’
1 octet 0×01 end of <CHARACTERISTIC> attributes
1 octet 0×87 <PARM> element with attributes
1 octet 0×15 attribute with value ‘NAME=NAME’
1 octet 0×11 attribute ‘VALUE’
1 octet 0×03 Inline string follows
14 octets 0x4D6F62696C65
0x20546964696E
0×6773
“Mobile Tidings”
1 octet 0×00 end of inline string
1 octet 0×01 end of <PARM> attributes
octet 0×87 <PARM> element with attributes
1 octet 0×17 attribute with value ‘NAME=URL’
1 octet 0×11 attribute ‘VALUE’
1 octet 0×03 Inline string follows
24 octets 0x687474703A2F
0x2F6D6F62696C
0x65746964696E
0x67732E636F6D
“http://mobiletidings.com”
1 octet 0×00 end of inline string
1 octet 0×01 end of <PARM> attributes
1 octet 0×01 end of <CHARACTERISTIC> element
1 octet 0×01 end of <CHARACTERISTIC-LIST> element