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 Mar 28, 2024 11:35
SMSTools3 Community » Help and support Bottom

[answered] Multi lang SMS

  This topic is locked

Page:  1

Author Post
Member
Registered:
Jul 2010
Location: Hong Kong
Operating system name and version: Win2003 - Cygwin
Version of smsd: 3.1.14
Smsd installed from: sources
Name and model of a modem / phone:
Interface: USB


I would like to check if my system need to send different languages, say sometimes Eng, Japanese, etc.
What should i need to set?
I find that sending english works normally but i cannot send Japanese.

Please advice. Thanks.

Member
Registered:
Jul 2010
Location: Hong Kong
Topic owner
I tried using a UTF-8 sms file for different language sms.
This is the sms file i made and put to outgoing folder.

--------------------------
To: 85293XXXXXX
Alphabet: UTF-8

this is test

--------------------------

The file has gone after a while.
Then in smsd.log, i got the message.

2011-06-08 18:50:58,5, smsd: No destination in file /var/spool/sms/outgoing/tes
_sms.txt
2011-06-08 18:50:58,6, smsd: Deleted file /var/spool/sms/outgoing/test_sms.txt

What happened?


« Last edit by keke on Wed Jun 08, 2011 13:37, 155 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Japanese written messages to be sent using the Unicode character set. The script sendsms does it automatically.

If you are creating message files manually, or by your application, you can use the checkhandler for conversion. In the global part of smsd.conf define the following:
checkhandler = /usr/local/bin/smsd_checkhandler.sh

Create the script with the following content, and make it executable for smsd:

#!/bin/bash

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


With English written messages do not use any Alphabet header in SMS file. With Japanese messages use the header Alphabet: UTF-8 and write message body using UTF-8 character set. Checkhandler will convert it to UCS2 and changes the header, and smsd will send message using Unicode character set.


« Last edit by keke on Wed Jun 08, 2011 12:53, 155 months ago. »
Member
Registered:
Jul 2010
Location: Hong Kong
Topic owner
i added the smsd_checkhandler.sh script, but still the same.
Have i done anything wrong?

2011-06-08 20:44:37,7, smsd: Running checkhandler: /usr/local/bin/smsd_checkhand
ler.sh /var/spool/sms/outgoing/test_sms.txt
2011-06-08 20:44:38,7, smsd: Done: checkhandler, execution time 1 sec., status:
0 (0)
2011-06-08 20:44:38,5, smsd: No destination in file /var/spool/sms/outgoing/test
_sms.txt
2011-06-08 20:44:38,6, smsd: Deleted file /var/spool/sms/outgoing/test_sms.txt


sms file:
-----------------------------------
To:

東電 データ公表漏れ計1382件
-----------------------------------


sms file:
-----------------------------------
To:
Alphabet: UFT-8

東電 データ公表漏れ計1382件
-----------------------------------


« Last edit by xpking on Wed Jun 08, 2011 12:48, 155 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Try with Alphabet: UTF-8. Sorry, I had a typo on my previous post... :(

Also check which sed, which grep, which mktemp and which iconv to see if your system has those commands available.

Member
Registered:
Jul 2010
Location: Hong Kong
Topic owner
Can you help deleting the mobile number in #2? Thanks.

I checked that which sed, which grep, which mktemp and which iconv, all good result.
Also changed the sms file Alphabet: UTF-8, the file encoding "ANSI", no luck.

What is the encoding of the txt file?

Member
Registered:
Jul 2010
Location: Hong Kong
Topic owner
i tried many method but still not working.
i tried txt file using UTF-8 encoding, but the smsd.log shows no destination in the file.
if i use ANSI encoding txt file, i received the SMS content are all ? characters.

any idea to solve this?

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Have you tried the script sendsms from the command line of Cygwin?

The format of SMS file is problematic under Windows. Headers part must be written using ANSI encoding, and in the case of Unicode messages, message body must use 16bit Unicode encoding. Wordpad cannot save this kind of files.

In the scripts directory of a package, there is very old script unicode2sms from version 2 of smstools, but with a quick view it seems that it's not working. I have to think what to do with this case.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Okay, the problem is caused by Byte Order Mark (BOM) character...

Use Notepad to write messages, save as UTF-8, and use extra dummy header in top:

-----------------------------------
a: a
To: 1234567890
Alphabet: UTF-8

東電 データ公表漏れ計1382件
-----------------------------------

Checkhandler is still required.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.