Author |
Post |
|
#1 Tue Nov 02, 2010 10:47, 171 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
|
Operating system name and version: Linux Debian 2.6.32.13 PPC Version of smsd: 3.1.14 Smsd installed from: sources Name and model of a modem / phone: Nokia N30 Interface: serial with USB adapter... I used the same approach like for older version: [answered] Accentuated character conversionIt works well with incomming messages But I got "Invalid alphabet" error. I tried to not use conversion at all by setting format to ISO, but then I got message sent, but with wrong characters. Does smsd checks for alphabet before checkhandler? Otherwise I can hardly explain why I am getting "Alphabet: UTF-8" after this line of my checkhandler: Or I am doing something that I am missing...
|
|
#2 Tue Nov 02, 2010 14:07, 171 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Janeks wrote Does smsd checks for alphabet before checkhandler?
No it does not, because checkhandler may change the alphabet. Janeks wrote Otherwise I can hardly explain why I am getting "Alphabet: UTF-8" after this line of my checkhandler: Or I am doing something that I am missing...
I assume that you had a working system 12 months ago, and moving to 3.1.14 caused this problem, right? Can you show your current checkhandler, the original message file before placing it into the outgoing directory, and the same message from the failed directory?
|
|
#3 Tue Nov 02, 2010 15:09, 171 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
checkhandler: #!/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 if [ "$1" == "SENT" ]; then if sed -e '/^$/ q' < "$2" | grep "^Alphabet: UTF-8" > /dev/null; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < "$2" | sed -e 's/Alphabet: UTF-8/Alphabet: UCS2/g' > $TMPFILE sed -e '1,/^$/ d' < $2 | iconv -f UTF-8 -t UNICODEBIG >> $TMPFILE mv $TMPFILE $2 fi fi 'bash' Syntax Highlight powered by GeSHi orginal message: failed message:
|
|
#4 Tue Nov 02, 2010 16:20, 171 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Your checkhandler looks like eventhandler. Remember that checkhandler and eventhandler are two different things with different arguments. Use the checkhandler from this post from the previous topic and your message will be sent as expected.
|
|
#5 Tue Nov 02, 2010 16:40, 171 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
Ah, sorry, made the same mistake. For sent SMS file I need first argument $1 only. BTW: I would recomend add arguments list description into "How to configure" page near each handler description. That is the first place I looked to. In page http://smstools3.kekekasvi.com/index.php?p=eventhandler there was not exact desription about checkhandler arguments.
|
|
#6 Tue Nov 02, 2010 16:51, 171 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Janeks wrote For sent SMS file...
For outgoing SMS file... Janeks wrote BTW: I would recomend add arguments list description into "How to configure" page near each handler description. That is the first place I looked to. In page http://smstools3.kekekasvi.com/index.php?p=eventhandler there was not exact desription about checkhandler arguments.
You are right, I have to think if I make some additions to the documentation. Currently argument for checkhandler can only be seen in sample codes...
|