A bookmark is defined in an XML template like this:
<CHARACTERISTIC-LIST>
<CHARACTERISTIC TYPE="BOOKMARK">
<PARM NAME="NAME" VALUE="yahoo"/>
<PARM NAME="URL" VALUE="http://wap.yahoo.com"/>
</CHARACTERISTIC>
</CHARACTERISTIC-LIST>
To provide this bookmark over WAP you need to:
1. Tokenize the XML text
2. Create the WDP part of the message
3. Create the WSP part of the message
4. Set the correct length of the message
5. Set the receiver's phone number (using semi-octet format)
6. Package the whole into a single SMS
7. Send it
In the example below you just need to replace four things for your own bookmark provisioning. They are:
The receiver's phone number
The content length
The bookmark's name
The actual link
All other values can remain unchanged.
Let's examine each of the seven steps. The XML version and Doc type are omitted here for simplicity.
1 TOKENIZE
This table lists the various XML tags, attributes or text and the corresponding tokens.
Tag/Attribute/Text Token(s)
| <CHARACTERISTIC-LIST> |
45 |
<CHARACTERISTIC |
C6 |
| TYPE="BOOKMARK" |
7F |
| > (End attribute) |
01 |
| PARM |
87 |
| NAME="NAME" |
15 |
| VALUE |
11 |
| String start |
03 |
| Yahoo |
7961686F6F |
| String end |
00 |
| /> End (PARM) |
01 |
| PARM |
08 |
| NAME="URL" |
17 |
| VALUE |
11 |
| String start |
03 |
| http://wap.yahoo.com |
687474703A2F2F7761702 E7961686F6F2E636F6D |
| String end |
00 |
| /> End (PARM) |
01 |
| /> End (CHARACTERISTIC) |
01 |
| /> End (CHARACTERISTIC-LIST) |
01 |
The complete set of tokens is:
45C67F01871511037961686F6F000187171103687474703
A2F2F7761702E7961686F6F2E636F6D00010101
For more information about tokenizing please read
Binary XML Content Format Specification
2 WDP
If the content of the bookmark does not fit in one SMS, then in the WDP you increment the number of SMS segments. You also specify the application port addressing. The WDP layer consists of:
User Data Header Length (UDHL) = 0B
User Data Header Information Element, Port numbers = 05
User Data Header Port Number Information Element Length = 04
Destination Port (high) = C3
Destination Port (low) = 4F
Originating Port (high) = C0
Originating Port (low) = 02
User Data Header Information Element, SAR = 00
User Data Header Information Element, Length = 03
Datagram reference number = 04
Total Number of Segment in datagram = 01
Segment Count = 01
So the WDP layer is:
0B0504C34FC0020003040101
For more information about the WDP layer please read
Wireless Datagram Protocol
3 WSP
The WSP layer is sent only in the first message, even if there is more than one SMS.
Transaction ID / push ID = 01
PDU Push Type = 06
Headers Length = 2D
Length greater than 30 = 1F
Value Length = 2B
MIME-Type = 6170706C69636174696F6E2F782D7761702D70726F762
E62726F777365722D626F6F6B6D61726B73
(application/x-wap-prov.browser-bookmarks)
Null Termination of MIME-Type = 00
Character set (Short Integer) = 81
UTF-8 (Short Integer) = EA
Immediately following the WSP are four user-data parameters.
WBXML Version = 01
Public Identifier = 01
Character set = 6A
String Table length = 00
So then the WSP layer (with the four user data parameters) is:
01062D1F2B6170706C69636174696F6E2F782D7761702D707
26F762E62726F777365722D626F6F6B6D61726B730081EA01016A00
For more information about the WSP layer please read
Wireless Session Protocol Specification
4 LENGTH
The length is the sum of the tokenized part, the WDP and the WSP part.
For this message the length is:
6B (107 octets)
5 PHONE NUMBER
The phone number in an SMS is presented in semi-octet format. The digits in the number are paired and inverted to represent the number in semi-octet format, so 46 becomes 64 and 75 becomes 57.
Example1: Phone number +46705721723 becomes 916407751227F3
Example2: Phone number +467005721723 becomes 91640750277132
The 91 indicates that it is an international number.
6 PACKAGE
To package all this into a single SMS you provide the SMS header. This header uses the first phone number from the example above.
00 = use of the service center number stored in the phone
45 = user data header included
00 = Message reference number, phone decides.
0B = phone number length
91 = International type of number
6407751227F3 = Phone number presented in the semi-octet format
00 = protocol identifier
04 = data coding scheme
In this example the SMS header is:
0045000B916407751227F30004
For more information about SMS please read
SMS and the PDU format
7 SEND
To send this bookmark away, just use a phone that has SMS AT commands and use a hyper terminal to send it. You must put the pieces in the proper order.
Our bookmark example here would be:
SMS HEADER + LENGTH + WDP + WSP + UD (the tokens)
AT+CMGS=120 then enter
0045000B916407751227F300046B0B05040B8423F000038
4010101062D1F2B6170706C69636174696F6E2F782D7761
702D70726F762E62726F777365722D626F6F6B6D61726B7
30081EA01016A0045C67F01871511037961686F6F0001871
71103687474703A2F2F7761702E7961686F6F2E636F6D00010101
Then Ctrl+z
Good luck