SMS Server Tools 3
This site is hosted by
Basic information:
Additional information:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

Custom Search

 Visitor locations
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Sun May 19, 2024 21:29
SMSTools3 Community » Help and support Bottom

[answered] Configuring filter

  This topic is locked

Page:  1

Author Post
Jul 2009
Location: Slovak Republic
Is it possible to filter recived sms?
The recived string contains a string witch is rule.

From: 491721234567
From_SMSC: 491722270333
Sent: 02-01-21 22:26:23
Received: 02-01-21 22:26:25
Subject: GSM1
Alphabet: ISO8859-15

DOMAIN.OK string string string...
'sms' Syntax Highlight powered by GeSHi

The first word in sms text is rule that can be folder in server.
My question:
Is it possible to configure in smstools or I need my script on CRON?

May 2009
Location: Jyväskylä, Finland
Eventhandler can be used to create any functionality required. In the scripts directory of a package there are some samples.

Here is one more sample: in the global part of smsd.conf, define:
eventhandler = /usr/local/bin/

Create this script file with suitable content, for example:


if [ "$1" = "RECEIVED" ]; then

  FROM=`formail -zx From: < $2`
  TEXT=`sed -e '1,/^$/ d' < $2`

  # List must start and end with space:
  ALLOWED_NUMBERS=" 358401234567 358401234568 "

  key=" $FROM "
  if [[ $ALLOWED_NUMBERS == *$key* ]]; then

    # Replace linefeeds with space:
    TEXT=`echo "$TEXT" | tr "\n" " " | tr "\r" " "`

    # Make an array of words:

    # First word is the key, make it uppercase:
    key=`echo $key | tr a-z A-Z`

    if [ "x$key" = "xIGNORE" ]; then

      if [ "x$key" = "x?" ]; then
        FILE=`mktemp /tmp/send_XXXXXX`
        echo "To: $FROM" >> $FILE
        echo "" >> $FILE
        echo "Ignore: " >> $FILE
        cat "$CONTROLFILE" >> $FILE
        FILE2=`mktemp /var/spool/sms/outgoing/send_XXXXXX`
        mv $FILE $FILE2
        if [ "x$key" != "x" ]; then
          FILE=`mktemp /tmp/eventhandler_XXXXXX`
          cp "$CONTROLFILE" $FILE
          echo "$key" >> $FILE
          chmod 644 $FILE
          mv $FILE "$CONTROLFILE"

exit 0
'bash' Syntax Highlight powered by GeSHi

Make the script executable and restart smsd.

This sample script is used to add ignored sender addresses to the file which is used to determine is SMS notification is sent when a new e-mail is received. With SMS "ignore" this domain is added to the list and with SMS "ignore ?" current list is sent back. There is also authorization by number used to control who can use this feature.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.