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 Apr 25, 2024 06:20
SMSTools3 Community » Help and support Bottom

[answered] one sms for many phone number

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Mar 2017
Location: France, France
Operating system name and version: UBUNTU 16 (fresh install)
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
 
 
'bash' Syntax Highlight powered by GeSHi


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

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
n00bie wrote
smsd: Running checkhandler: /var/spool/sms /var/spool/sms/outgoing/filename.txt

/var/spool/sms is a directory. Please check how checkhandler is defined in the smsd.conf.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
n00bie wrote
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.

Okay, the path is not enough, filename is also required:
checkhandler = /var/spool/sms/check_handler.sh

This issue can be seen as a bug in the smsd. It tries to avoid future problems by checking if files exists and are executable when smsd starts, but in this case it did not detect that the setting is a directory, not a script.

Member
Registered:
Mar 2017
Location: France, France
Topic owner
Hi,

Thanks for your quick answer.

I changed the checkhandler path in the smsd.conf



I didn't have the problem but I have had new one:



But I found the solution here: http://smstools3.kekekasvi.com/topic.php?id=1177
I didn't have procmail.
Everything works well now.

Many thanks for your help.

Best regards,

Login and Post Reply

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.