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. Tue Apr 16, 2024 19:07
SMSTools3 Community » Help and support Bottom

[answered] Eventhandler Limits

  This topic is locked

Page:  1

Author Post
Member
Registered:
Jan 2010
Location: Bristol, United Kingdom
Operating system name and version: Win Xp
Version of smsd: 3.0
Smsd installed from: sources
Name and model of a modem / phone: Huwei E169
Interface: USB

Hello All,

Are there any limits for the number of eventhandlers? I am trying to run 4 at the moment but I find that SMSD only parses the last one in the list! They are supposed to look for a keyword, then send an SQL query before returning the answer by SMS. Should I have all of the keywords and queries into one handler??



Is there a limit of one or two or am I missing something simple.

Regards

Bill.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
bill1798 wrote
Should I have all of the keywords and queries into one handler??

Yes. Only one eventhandler can be used and the last definition is valid.

You could create a "masterchk.sh" eventhandler which calls those other scripts.

Member
Registered:
Jan 2010
Location: Bristol, United Kingdom
Topic owner
Thanks Keke,

I looked everywhere for the number of allowable event handlers and couldn't find the answer, maybe it is obvious to those who are more used to Bash scripting.

Of course the masterchk.sh is the perfect answer, I've used the source (. /) command to call the other scripts which appears to do the trick :P. I've included my code to maybe help others, I hope that it's OK.

Regards

Bill.

#!/bin/sh
if [ "$1" != "RECEIVED" ]; then
exit
fi
#Check message text and retrieve sender and request
from=`formail -zx From: < $2`
text=`formail -I "" <$2 | sed -e"1d"`

if echo "$text" | grep -i "man"; then
. /usr/local/bin/mankitchk.sh

elif echo "$text" | grep -i "cir"; then
. /usr/local/bin/cirkitchk.sh

elif echo "$text" | grep -i "edi"; then
. /usr/local/bin/edikitchk.sh

elif echo "$text" | grep -i "lon"; then
. /usr/local/bin/lonkitchk.sh

else

smsfile=`mktemp /var/spool/sms/outgoing/send_XXXXXX`
echo "To: $from" >> $smsfile
echo "" >> $smsfile
echo "The keyword $text was not recognised" >> $smsfile

fi
'bash' Syntax Highlight powered by GeSHi



« Last edit by bill1798 on Tue Jan 26, 2010 16:25, 173 months ago. »

  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.