Sending out an SMS in PDU mode

This post was written by Jeroen on January 12, 2009
Posted Under: SMS
This entry is part 1 of 17 in the series Sending out an SMS

PDU mode is a lot more interesting than text mode. There are all kinds of things that can be done with SMS messages, all leveraging special formatting that is only available if you use PDU mode:

The formatting of these PDU’s is a little more complicated and requires some bit manipulations that are hard to do by hand.

The GSM modem is put into PDU mode with the command ‘AT+CMGF=0’. Once in PDU mode a PDU can be sent using the ‘AT+CMGS’ command:

> <here goes your PDU><Crtl-Z>
The actual PDU consists of a number of octets (bytes). In the command the <length> field represents the number of octets and the PDU is given in the hexadecimal representation of those octets. The ‘> ‘ on the second line is a prompt that is written by the GSM modem to indicate that it is ready to accept your PDU.
Of course the interesting part is what the PDU looks like…. more on this in the post “More on the SMS PDU“.
Series Navigation
Tags: , , , ,

Reader Comments

When you say Configure the Phone, Do you mean
configuring the remote phone or phone that holds the destination number ( Phone number)
Or my local phone or Modem?

Written By Franco on June 11th, 2009 @ 9:45 am

I mean you can send configuration to a remote phone. E.g. you can send GPRS network configuration, setup WAP gateways and such.

Written By Jeroen on June 11th, 2009 @ 2:31 pm

how to convert our messages to pdu mode???

Written By umesh on September 14th, 2009 @ 3:01 am


See my answer under “More on the SMS PDU”.


Written By Jeroen on September 14th, 2009 @ 11:18 am

With regards to PDU or Plain Text or CDMA or GSM, is the SMS “Header Data” such as “OA” and “DA” and/or “SCTC”. In other words, are the originating and destination phone numbers as well as “Mobile Station” time stamp in plain text or are they secured or encrypted. I understand the core message being somewhat secure but I can’t see how they could encrypted or secured and have towers from LA to London to Egypt understand the “Header Data”.

Much Thanks – Cheers
I look forward to your knowledgeable responses.

Written By Lance on October 8th, 2009 @ 10:41 am

can we create an application which will keep a log of the flash messages we recieve..similar to a call a GSM phone..

Written By rejesh on April 9th, 2010 @ 10:18 pm

Hi all,

When sending long SMSs with alpha-numeric source address for phones using Etisalat service provider in UAE, in some cases the receiver complained that the message is scrambled and can’t read. In some other cases, it is complained that the source address is shown as a numeric one ( For the source address “TEST” receiver said “3005″ is shown). Any idea on this issue??????????

Written By Dilshan on May 3rd, 2011 @ 9:51 am


Add a Comment

required, use real name
required, will not be published
optional, your blog address