Keywords: Mode: All keywords (AND) |
Wed May 15, 2013 00:30
|
korotky: Problem was in locale, default locale for daemon is POSIX, but text to send in UTF-8.
|
Wed May 15, 2013 00:27
|
korotky: Problem solved, added "-f UTF-8" option to iconv command in sendsms script.
|
Tue May 14, 2013 05:44
|
korotky: Operating system name and version: Debian 7
Version of smsd: 3.1.15
Smsd installed from: sources
Name and model of a modem : Huawei e352
Interface: USB
I have working configuration, but it works only if I restart smsd manually (user:root), without restart I get error in smsd.log:
/var/spool/sms/regular_run: line 19: sendsms: command not found
This is my regular_run script:
#!/bin/bash
SQL_HOST=xxx
SQL_USER=xxx
SQL_PASSWORD=xxx
SQL_DATABASE=xxx
TMPFILE=`mktemp /tmp/smsd_outgoing_qr_XXXXXX`;
TMP_ID=`mktemp /tmp/smsd_outgoing_id_XXXXXX`;
echo "connect $SQL_DATABASE user $SQL_USER password \"$SQL_PASSWORD\" ;" > $TMPFILE;
echo "set heading off;" >>$TMPFILE;
echo "select id,phone,content from sms_messages where timestamp2 is null and try_count=0 and msg_ref is null and direction=0 ;" >> $TMPFILE;
isql-fb -ch UTF8 -i $TMPFILE -q | sed '/^$/d' > $TMP_ID;
unlink $TMPFILE;
cat $TMP_ID | while read id phone content;do
sendsms $phone "$content";
TMPFILE=`mktemp /tmp/smsd_outgoing_qr_XXXXXX`;
echo "connect $SQL_DATABASE user $SQL_USER password \"$SQL_PASSWORD\" ;" > $TMPFILE;
echo "update sms_messages set try_count=1 where id=$id;" >> $TMPFILE;
isql-fb -ch UTF8 -i $TMPFILE -q;
unlink $TMPFILE;
done
unlink $TMP_ID;
I've added path to sendsms (/usr/local/bin/sendsms), but then I get another error:
smsd: ! iconv: illegal input sequence at position 0
Again, if I restart smsd manually, everything works. Autostart enabled by command: update-rc.d sms3 defaults , maybe this is not correct? How to enable autorun smsd with root privileges?
|