How to code a WAP Push message over SMS
The Service indication
This is the message we want to deliver. It's a service indication message, the message will be presented to the user and if the user choose to accept the message the link to the server will be used.
<?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.it.kth.se/courses/2g1722/push.wml" >
This is a test.
</indication>
</si>
In order to send this we need to code it in WBXML format. Note that the specifics of how to code a service indication element is found in the end of WAP-167.
0x02
WBXML version 1.1
0x05
public identifier for SI 1.0
0x04
charset iso-8859-1
0x00
length of string table
0x45
si with content
0xC6
indication with content and attributes
0x0D
token for "href=http://www."
0x03
inline string follows
....
the string "it.kth.se/courses/2g1722/push.wml"
0x00
end of string
0x01
end of indication attributes
0x03
inline string follows
....
the string "2G1722"
0x01
end of indication
0x01
end of si
Strings are coded in 8-bit octets, nothing funny here.
A WSP push
We now have to construct a WSP Push message.
0x01
push transaction id, could be anything
0x06
WSP type is Push
0x08
header length
0x01
content type length
0xAE
content type: application/vnd.wap.sic
0xAF
header: x-wap-application-id
0x82
2 - the WML User Agent
0xB4
header:push-flag
0x85
101 - last-push, URI authenticated
Note that when you look for the token values in WAP-230 you will not find "0xAE"but rather "0x2E". When coding small integers the high bit is set.
The WSP message is then put in a WDP packet that is directed to the push destination port.
The WDP
The WDP packet have different structure depending on which link layer we are using. Since we are sending it over a SMS we will code it as a User Data Header. Note that we have two elements one specifying the destination port (2948) and a second indicating that the rest a concatented message.
0x0B
User Data Header length (not including this byte)
0x05
identifer elements, port addressing
0x04
length of element
0x0B84
push dest port (2948)
0x23F0
push originator port (9200)
0x00
concatenated short message
0x03
length of element
0x01
ref number
0x01
max number of segments
0x01
current segmenet number
The SMS
So we now have a WDP that includes a WSP consisting of a Service indication. This should now all be put in a SMS.
0x41
A SMS-SUBMIT message with a User Header
0x00
This is the message reference but here we let the phone set it.
0x0B
Length of the address, change this if you change the receiver number
0x91
The address type used, in this case international starting with country code
XXXXXXXXXXX
This is the phone number, check the SMS tutorial.
0x00
Protocol identifier.
0x04
Data coding scheme, in this case 8-bit bytes.
0x..
This is the length of the User Data
The whole WDP is now interpreted as a User Header Information. If the terminal can not understand the header it will be ignored.
http://web.it.kth.se/~johanmon/attic/2g1722/laborations/push.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.