К серверу с ОС FreeBSD 10.2 подключен мобильный телефон Нокиа 6500с.
Установлен smstools.
в /boot/loader.conf добавлены следующие строки:
uplcom_load="YES"
umodem_load="YES"
Ниже приведен рабочий конфиг:
#smsd.conf
checkhandler=/var/spool/sms/koi2ucshandler
devices = GSM1
logfile = /var/log/smsd.log
failed = /var/spool/sms/failed
report = /var/spool/sms/report
loglevel = 7
USER = smsd
GROUP = dialer
PIDFILE = /var/run/smsd/smsd.pid
INFOFILE = /var/run/smsd/smsd.working
keep_filename=yes
store_original_filename=yes
[GSM1]
device=/dev/cuaU0
baudrate=115200
rtscts=no
init=AT+CSCS="UCS2"
#incoming=yes
report=yes
hangup_incoming_call=yes
send_delay=20
и скрипт конвертации кодировки для отображения смс в кириллице:
#!/bin/sh
if -f /tmp/smsd.lock ; then
exit 0
else
touch /tmp/smsd.lock
fi
PREP_DIR="/var/spool/sms/prepare"
OUT_DIR="/var/spool/sms/outgoing"
cd $PREP_DIR
for message in $(ls *) ; do
output=${OUT_DIR}/$(date "+%s")
cat ${message}|grep "^To:">${output}.sms
echo "Alphabet: UCS2">>${output}.sms
echo>>${output}.sms
cat ${message}|grep -v "^To:"|iconv -f KOI8-R -t UCS-2BE >> ${output}.sms
rm -f ${message}
sleep 1
done
rm -f /tmp/smsd.lock
Установлен smstools.
в /boot/loader.conf добавлены следующие строки:
uplcom_load="YES"
umodem_load="YES"
Ниже приведен рабочий конфиг:
#smsd.conf
checkhandler=/var/spool/sms/koi2ucshandler
devices = GSM1
logfile = /var/log/smsd.log
failed = /var/spool/sms/failed
report = /var/spool/sms/report
loglevel = 7
USER = smsd
GROUP = dialer
PIDFILE = /var/run/smsd/smsd.pid
INFOFILE = /var/run/smsd/smsd.working
keep_filename=yes
store_original_filename=yes
[GSM1]
device=/dev/cuaU0
baudrate=115200
rtscts=no
init=AT+CSCS="UCS2"
#incoming=yes
report=yes
hangup_incoming_call=yes
send_delay=20
и скрипт конвертации кодировки для отображения смс в кириллице:
#!/bin/sh
if -f /tmp/smsd.lock ; then
exit 0
else
touch /tmp/smsd.lock
fi
PREP_DIR="/var/spool/sms/prepare"
OUT_DIR="/var/spool/sms/outgoing"
cd $PREP_DIR
for message in $(ls *) ; do
output=${OUT_DIR}/$(date "+%s")
cat ${message}|grep "^To:">${output}.sms
echo "Alphabet: UCS2">>${output}.sms
echo>>${output}.sms
cat ${message}|grep -v "^To:"|iconv -f KOI8-R -t UCS-2BE >> ${output}.sms
rm -f ${message}
sleep 1
done
rm -f /tmp/smsd.lock