<< Click to Display Table of Contents >> Navigation: How to... > |
|
Send a WAP push message |
A WAP push service indication message is a message to indicate that (new) WAP content is available, it can also be used to send a general URL to a phone user. WAP push messages can be binary encoded and sent as a binary SMS message.
Compose a WAP push service indication message
Compose the User Data Header (UDH)
The User Data Header specifies how the mobile phone should handle the message. For a WAP push message, it contains the "Application Port Addressing 16 bit address" information of the GSM 03.40 specification:
06 |
UDH length |
05 |
Application Port Addressing, 16 bit address |
04 |
UDH Application Port Addressing content length |
0B84 |
Destination port number, IANA WAP-push Multimedia Messaging Service port (2948) |
0000 |
Source port number |
If the combination of the UDH and the content of the message has a length of more than 140 bytes, the message must be split in multiple message parts of no more than 140 bytes each and the UDH is expanded with the concatenation information:
0B |
UDH length |
05 |
Application Port Addressing, 16 bit address |
04 |
Content length |
0B84 |
Destination port number, IANA WAP-push Multimedia Messaging Service port (2948) |
0000 |
Source port number |
00 |
Concatenated short message |
03 |
Content length |
00 |
Message reference number (8-bits) |
01 |
Total message parts (1 for a single message part) |
01 |
Sequence number of the message part |
And the same with a 16-bit concatenation reference number:
0C |
UDH length |
05 |
Application Port Addressing, 16 bit address |
04 |
Content length |
0B84 |
Destination port number, IANA WAP-push multimedia messaging service port (2948) |
0000 |
Source port number |
08 |
Concatenated short message, 16-bit reference number |
04 |
Content length |
0000 |
Message reference number (16-bits) |
01 |
Total message parts (1 for a single message part) |
01 |
Sequence number of the message part |
Compose the Wireless Session Protocol header
The Wireless Session Protocol (WSP) header specifies the type of message according to the "Wireless Application Protocol Wireless Session Protocol" specification of the Wireless Application Protocol Forum. In this example the message is a binary encoded WAP push application message with content type "application/vnd.wap.sic" and character set UTF-8:
00 |
WAP push session reference number (8-bits) |
06 |
WSP type (WAP push, 0x06) |
04 |
Content length |
03 |
Length of content type and accept charset |
AE |
Content type "application/vnd.wap.sic" (0x2E), bit 7 is always set to "1" |
81 |
Accept charset indication (0x01), bit 7 is always set to "1" |
EA |
Accept charset type "UTF-8" (0x6A), bit 7 is always set to "1" |
Compose the WAP Service Indication message
XML formated WAP push service indication message according to the "Wireless Application Protocol
Service Indication" specification of the Wireless Application Protocol Forum:
<?xml version="1.0"?>
<!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN" "http://www.wapforum.org/DTD/si.dtd">
<si>
<indication href="http://www.diafaan.com" action="signal-medium">
WAP Push message text
</indication>
</si>
To be able to send the message in a binary SMS, the message is encoded with the WBXML binary encoding according to the "Wireless Application Protocol
Service Indication" specification:
01 |
WBXML Version 1.1 |
05 |
SI 1.0 Public Identifier |
6A |
Charset UTF-8 |
00 |
String table length 0 |
45 |
<si> |
C6 |
<indication |
0D |
href="http://www. |
03 |
Start of string value |
6469616661616E |
"diafaan" |
00 |
End of string value |
85 |
.com |
07 |
Attribute: action="signal-medium" |
01 |
> |
03 |
Start of string value |
5741502050757368206D6573736167652074657874 |
"WAP Push message text" |
00 |
End of string value |
01 |
</indication> |
01 |
</si> |
Service indication message:
01056A0045C60D036469616661616E00850701035741502050757368206D6573736167652074657874000101
WSP plus service indication message:
00060403AE81EA01056A0045C60D036469616661616E00850701035741502050757368206D6573736167652074657874000101
UDH plus WSP plus service indication message:
0605040B840000,00060403AE81EA01056A0045C60D036469616661616E00850701035741502050757368206D6573736167652074657874000101
Send the WAP push message
You can send the binary encoded WAP push service indication message in Diafaan SMS Server using the sms.binary message type. To send the service indication message, use the encoded message that includes the UDH, WSP plus service indication message as specified above. The UDH and the rest of the binary message must be separated by a comma. If you send a binary message, make sure that the message data does not contain any new line or space characters. If it does, the message will fail.