SMS UDH messages
There are two standard ways to set the voicemail message waiting indicator (MWI) on a mobile phone. One is to set DCS bits in the SMS PDU, as defined in 3GPP TS 23.038; there's currently no exposed mechanism to set the DCS bits.
The other option is to send a message with a MWI User Data Header (UDH) Information Element (IE), as defined in 3GPP TS 23.040. You can also send a message with the UDH, which may be displayed to the user.
An SMS UDH begins with a length byte covering the entire UDH. This is followed by one or more IEs; each IE has a type byte, a length byte, and some content.
The MWI IE is type 01, and is always of length 2. The first byte is the type of message you want to indicate, the second byte is the number of messages of that type. The type is one of:
Type | Code |
---|---|
Voice message | 00 |
Fax message | 01 |
E-mail message | 02 |
Unknown | 03 |
Video message | 07 |
Other types are reserved. Add 80 to the type if the message attached to the UDH should be stored.
For example, a UDH IE "01 02 80 01" tells the phone that there is one voice message waiting, and that the SMS text with the UDH is important. UDH of "08 01 02 00 14 01 02 07 05" is two MWI IEs; both say to discard the text, but the first says 20 voicemails waiting, and the second says 5 video messages waiting. Finally, a UDH of "14 01 02 00 00 01 02 01 00 01 02 02 00 01 02 03 00 01 02 07 00" is 5 MWI IEs, clearing all 5 known MWI types.
Example:
curl --silent --get \
--form-string iccid=8944200000000000000 \
--form-string password=secret \
--form-string udh="0401028001" \
--form-string message="You have voicemail" \
--form-string originator=12345 \
https://sms.aa.net.uk/sms.cgi
SMS message to 8944200000000000000
OK: 1
This sets the voice MWI only, saying that there is one voicemail waiting, and asking the phone to treat the text "You have voicemail" as a normal SMS message.
curl --silent --get \
--form-string iccid=8944200000000000000 \
--form-string password=secret \
--form-string udh="140102000001020100010202000102030001020700" \
--form-string message="Clear MWI" \
--form-string originator=12345 \
https://sms.aa.net.uk/sms.cgi
Clears all MWIs, and gives the phone the test "Clear MWI" to discard.
Known to work on:
- iPhone
- Nokia E72
Not working on:
- Samsung Galaxy S2 (GT-I9100 - SMS received, but the MWU indicator does not show - tested exaclty the same curl to same sim in a Nokia E72 and it does work. Samsung ROM was 4.1.2, Cyanogenmod 23 October 2012
- Possibly HTC Snap
- Possibly Samsung Galaxy S3