Sending a bookmark over SMS
Posted Under: 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:
<?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>
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 | 0×0B | Length of destination address in digits | |
| 1 octet | 0×91 | Destination is an international telephone number | |
| 6 octets | 0×5121551532F4 | 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 | 0×0B | 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 | 0×0A | The WSP transaction ID | WSP |
| 1 octet | 0×06 | This is a push PDU | |
| 1 octet | 0×2D | Headers consist of 45 octets | |
| 1 octet | 0×1F | Indicates that the length is greater than 30 octets. | |
| 1 octet | 0×2B | Length is 43 octets. | |
| 40 octets | 0×6170706C6963 0×6174696F6E2F 0×782D7761702D 0×70726F762E62 0×726F77736572 0×2D626F6F6B6D 0×61726B73 |
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: 0×6A means ‘UTF-8‘ | |
| 1 octet | 0×01 | WBXML Version 1.1 | WBXML |
| 1 octet | 0×01 | Unknown document type. | |
| 1 octet | 0×6A | 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 | 0×7F | 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 | 0×4D6F62696C65 0×20546964696E 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 | 0×687474703A2F 0×2F6D6F62696C 0×65746964696E 0×67732E636F6D |
“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 |







Reader Comments
Hi I have followed you encoding to send Bookmark and it is successful. But when I open the bookmark in hand set it shows blank. There is no content.
My output is as follows. Please check and help me if anything is missing
0045000D91881019498357F50004670B0504C34F03840003F0010101062
D1F2B6170706C69636174696F6E2F782D7761702D70726F762E62726F77
7365722D626F6F6B6D61726B730081EA0101640045C67F0187151103596
1686F6F000187151103687474703A2F2F7961686F6F2E636F6D00010101
Nazmuz,
Where you encode the URL, you use attribute 0×15 (NAME=NAME), you should use 0×17 (NAME=URL).
Jeroen
Hi below is the break down of my PDU code. In the handset it shows that 1 Bookmark received but it is blank. Please help.
——————————–
Destination is ‘+8801919438755′
Name is “Mobile Tidings”
Url is “http://mobiletidings.com”
———————————–
UDH=0041000D91881019498357F50004
Length=78
WDP=0B0504C34F03840003F00101
WSP=01062D1F2B6170706C69636174696F6E2F782D7761702D7072
6F762E62726F777365722D626F6F6B6D61726B730081EA01016400
45C67F0187
1511034D6F62696C6520546964696E6773
000187
171103687474703A2F2F6D6F62696C65746964696E67732E636F6D00010101
———————————
0041000D91881019498357F50004780B0504C34F03840003F0010101062
D1F2B6170706C69636174696F6E2F782D7761702D70726F762E62726F77
7365722D626F6F6B6D61726B730081EA0101640045C67F01871511034D6
F62696C6520546964696E6773000187171103687474703A2F2F6D6F6269
6C65746964696E67732E636F6D00010101
Nazmuz,
I apologize. It seems I had a typo in my article which may have caused your problem…
In the complete PDU at the top of the article I had it correct, but in the breakdown I made an error. In the breakdown of the WBXML encoding I wrote 0×64 for ‘encoding is UTF-8′. In the complete PDU at the top it is 0×6A. The latter is correct. The value 0×64 stands for ‘us-dk’, a character set probably unknown to the receiving device… I have corrected the article. It is likely this was the cause of your problem.
Success,
Jeroen
Dear Jeroen,
Thanks a lot. My application is working fine now. It will be great full if you can send similar article on how to send MMS using AT command.