Delphi SMSCodec (SMS Processing Component)

Posted by Daniel - 5,590 Views

averagecoder_smscodec.gifSMSCODEC is my own Delphi version of SMS Encoding/Decoding component. Its a simple one but quite enough to assemble a PDU format of an SMS send message to be sent via cellphone and to decode SMS message (received message) from my cellphone to get the sender number and the message content.

Several functions that you can use to perform SMS processing are: PDU7BIT2ASCII, PDU8BIT2ASCII, PDU16BIT2ASCII, ASCII2PDU7BIT, DecodeSMS, and EncodeSMS. Some lines in the component source code are commented and a demo/usage example project is also included in this package.

If you only need a utility to test the AT-Command of a GSM modem or a cellphone you may consider AT-CMD Tester, my GSM AT-Comand utility or a more complete one, the PDUSpy.

Installing Delphi SMSCodec

Delphi SMSCodec requires CPort Component to be installed. If you haven’t done it yet, please check the CPort instalation steps on my other post. If you have the CPort installed, follow these steps to install Delphi SMSCodec,

  1. Download the zipped component source then extract it.
  2. Copy “smscodec.pas” into Delphi Lib folder
  3. Use [Component] - [Install Component] menu item in Delphi IDE.
  4. Click [Browse] on the Unit file name textbox then find “smscodec.pas” to open it.
  5. Click OK then choose [Yes] to confirm the installation. The SMSCodec component is placed on the [averagecoder] tab.

Available download:

Related Resources:

share this article

Digg del.icio.us Netscape StumbleUpon Yahoo! MyWeb reddit Furl Magnolia Newsvine Technorati SlashDot Blinklist Simpy Google
This post as PDFPosted in: Tested Software - January 2008

11 Responses to “Delphi SMSCodec (SMS Processing Component)”

  1. Emanuel Says:

    Nice piece of work!

    A little notice for SMSCodec DEMO would be that ENCOD SMS does not include the optional ‘TP-VALIDITY-PERIOD’ but DECODE SMS seems to be expecting it even if the first octet is set to 00′01′. Therefore if you feed the encoded message into
    decoder the result would be different. I believe presence of ‘TP-VALIDITY-PERIOD octet’ is handeled in ‘First octet of SMS-SUBMIT’ and is placed before ‘TP-User-Data-Length’.

    Emanuel from Sweden

  2. jazter Says:

    Hi, It’s a good code, but i need enconde latin characters. Like á, é, í, ó, ú… etc. You know what i need develop to do this? Excuse my poor English.
    Thanks from Mexico.

  3. Daniel Says:

    @Jazter: I had never tried to include those chars into decoding process but the 7-bit Default Alphabet table which you can find it here,

    http://www.dreamfabric.com/sms/default_alphabet.html

    already included those chars and they have its reference on ISO-8859-1. Can you paste the result from your test here?

    @Emmanuel: thanks for you deep digg :) Yep, it’s a flaw, will take a look on it when I get my GSM-Modem repaired.

    Cheers
    __________

    Daniel

  4. Umar Says:

    Please, would you like to give us step by step procedure to install this component?
    I could not install it on my Delphi 7 :(

  5. Daniel Says:

    @Umar: The post has been updated with the installation steps. Please check above…
    _________

    Daniel

  6. for free Says:

    Great Post Thanx.

    for free’s last blog post: Jonathan Krohn Addresses CPAC

  7. Denymon Says:

    Averagecoder function working & usefull.
    But i have problem (using Delphi6, Comport, Averagecoder smscodec, Siemens M35):
    - First: When I send SMS for long SMS (more than 20 char but less than 160 char) then SMS received can be read correctly but long of message is less than amount char on transmitted SMS. Finally i’m use trick to add long of message 1 char for each 7 char length. It’s can work helpfull but not perfect, sometimes we lost 1 or 2 char on SMS received.
    - Number 2: when i’m reading SMS, why decoding result always get extra chart “@” or “@@” on last message? I Have problem to make different if genui messagge using char “@” on last char.

    I Think PDUSpy is perfect tool for PDU, but i can’t integrate it to Delphi :(

    Thanks

  8. rodhy Says:

    Thank for your code, it very usefull for me.
    best regard.

  9. Sean Says:

    This is a great piece of code and thanks for adding the updates.

    Sean’s last blog post: Not All Text Message Marketing Is Created Equal

  10. Rangga Kusuma Says:

    Gan, Tengkiu buat postingan yang sangat berguna. Kebetulan ada project utk bikin sms gateway, dan converter Agan sangat berguna utk mempercepat proses development.

    Regards

    Rangga Kusuma’s last blog post: BODYCOMBAT™

  11. Daniel Says:

    @Rangga: Seep2, sama Broer :) cm ju2r aja ini belum siap pakai, masi bnyak kurang sana sini, maklum, awalnya proyek kuliahan ^^



Leave a Reply


Options for your comment:





Hi, my name is Daniel Nugraha, a single male live on an island called Java, Indonesia. This is the place for me to share my interest in computer programming.

Coffee Break

Comments - Thanks Guys :)

  • Rangga Kusuma: Gan, Tengkiu buat postingan yang sangat berguna. Kebetulan ada project utk bikin sms gateway, dan converter Agan sangat berguna utk...
  • Chuck Norton: I actually went ahead & bolted over to Justin’s Get The Image plugin here: http://justintadlock.com/ar...
  • Chuck Norton: Question: is it possible to insert something like [custfieldimg=”joice1.jpg,15 0,1:1″] into the actual templates instead of...
  • Therese Lachance: Hi, Any idea how to have ContuttoPDF fetch the correct page language?
  • tresloukadu: yo how did u fixed when the tags shows <? and it shows < “& l t ; ” ?? please send me an email.