Version of smsd: the one when request apt-get install smstools
Smsd installed from: default Ubuntu repository
Name and model of a modem / phone: HUAWEI 3G modem E3372
Interface: USB
Hi,
First, thanks for this great tool.
Just to be clear, I don't speak English fluantly so please excuse me for gramatical error and I'm a real noob in linux world...
I have a little trouble with smstools and the possibility of sending a sms to many phone numbers.
I read this topic: http://smstools3.kekekasvi.com/topic.php?post=2640#post2640 but that don't really help me (except for the script)...
Everything works fine, I can send and receive sms to single phone number without problem.
The problem comes when I add a second or more than one phone number in the sms file.
I used the checkhandler script of the upper topic:
#!/bin/bash
# Sample script to allow multiple recipients in one message file.
# Define this script as a checkhandler.
outgoing="/var/spool/sms/outgoing"
recipients=`formail -zx "To:" < "$1"`
#count=`echo "$recipients" | wc -l`
count=`echo "$recipients" | wc -w`
if [ $count -gt 1 ]; then
# Will need echo which accepts -n argument:
ECHO=echo
case `uname` in
SunOS)
ECHO=/usr/ucb/echo
;;
esac
messagebody=`sed -e '1,/^$/ d' < "$1"`
headers=`formail -X "" -I "To:" -f < "$1"`
for recipient in $recipients
do
file=`mktemp $outgoing/send_XXXXXX`
$ECHO "To: $recipient" > $file
if [ "x$headers" != "x" ]; then
$ECHO "$headers" >> $file
fi
$ECHO "" >> $file
$ECHO -n "$messagebody" >> $file
done
# Remove processed file:
rm $1
# Tell to smsd that checkhandler has spooled this message:
exit 2
fi
exit 0
# Sample script to allow multiple recipients in one message file.
# Define this script as a checkhandler.
outgoing="/var/spool/sms/outgoing"
recipients=`formail -zx "To:" < "$1"`
#count=`echo "$recipients" | wc -l`
count=`echo "$recipients" | wc -w`
if [ $count -gt 1 ]; then
# Will need echo which accepts -n argument:
ECHO=echo
case `uname` in
SunOS)
ECHO=/usr/ucb/echo
;;
esac
messagebody=`sed -e '1,/^$/ d' < "$1"`
headers=`formail -X "" -I "To:" -f < "$1"`
for recipient in $recipients
do
file=`mktemp $outgoing/send_XXXXXX`
$ECHO "To: $recipient" > $file
if [ "x$headers" != "x" ]; then
$ECHO "$headers" >> $file
fi
$ECHO "" >> $file
$ECHO -n "$messagebody" >> $file
done
# Remove processed file:
rm $1
# Tell to smsd that checkhandler has spooled this message:
exit 2
fi
exit 0
I stored it there: /var/spool/sms/check_handler.sh and give the path in /etc/smsd.conf
The folder and subfolder give full access to smsd and root user.
Unfortunatly, the /var/log/smsd.log file give me the result below and I don't understand why...:
Could you please help me?
Many thanks