SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Thu Oct 29, 2020 05:00
SMSTools3 Community » Help and support Bottom

Bad decode sms from PDU

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Oct 2015
Location: Brno, Czech Republic
Hello,
I am using the phone above to send out sms text "ČĎŮčetina", received log smsd.log:

GSM2: <- +CMGR: 0,,43 0791246080006528240C9124707362023800085101521273614018010C0160010E016E011A010D0065016100740069006E0061 OK
GSM2: SMS received, From: 420xxxxxx
GSM2: Wrote an incoming message file: /var/spool/sms/incoming/GSM2.eWX423

view on the file /var/spool/sms/incoming/GSM2.eWX423 :

Subject: GSM2
Modem: GSM2
IMSI: 230030090959675
Report: yes
Alphabet: UCS2
Length: 12
PDU: 0791246080006528240C9124707362023800085101522260024018010C0160010E016E011A010D0065016100740069006E0061

...`...n...
.e.a.t.i.n.a

Why PDU decoder text is too poor to convert the text into shape?
Has a problem with Alphabet: UCS2 (16) bit?

thanks

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Message body in the file is UCS2 coded. You can use the eventhandler to convert this kind of incoming messages to UTF-8. In global part of smsd.conf, define:
eventhandler = /usr/local/bin/smsd_eventhandler.sh

Create this file with a following content:

#!/bin/bash

if [ "$1" == "RECEIVED" ]; then

  if sed -e '/^$/ q' < "$2" | grep "^Alphabet: UCS2" > /dev/null; then
    TMPFILE=`mktemp /tmp/smsd_XXXXXX`
    sed -e '/^$/ q' < "$2" | sed -e 's/Alphabet: UCS2/Alphabet: UTF-8/g' > $TMPFILE
    sed -e '1,/^$/ d' < "$2" | iconv -f UNICODEBIG -t UTF-8 >> $TMPFILE
    mv $TMPFILE "$2"
  fi

fi
 
'bash' Syntax Highlight powered by GeSHi


Make the file executable for smsd and restart the daemon.

Member
Registered:
Oct 2018
Location: Germany
I've changed the code to the following:



This seems to work better with unicode and emojis. With UNICODEBIG incoming messages has been cut at emojis.

smstools version 3.1.21

Login and Post Reply

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.