SMS Server Tools 3
 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. The forum is currently read-only, but will open soon. Fri Nov 22, 2024 04:29
SMSTools3 Community » Help and support Bottom

[solved] Regarding error messages

  This topic is locked

Page:  1

Author Post
Member
Registered:
May 2009
Location: Hinnerup, Denmark
Operating system name and version: Cygwin on a Windows 2K3 server
Version of smsd: 3.1.5
Smsd installed from: sources
Name and model of a modem / phone: Siemens MC35 Terminal
Interface: serial

Hello!

I have just upgraded from 3.1.3 til 3.1.5 "no beta", but now im reciving some wired error messages, and not all of my sms is sent properly.
My eventhandler is sometime 50 sec. om execution, is this normal ? .. Its only function is to drop the sms in my mysql db.
Why do i get these messages ? I got an Alarmsms on my phone too ;)

 smsd.log: 


 smsd.conf: 


 mysmsd: 
#!/bin/sh

# This is an example script that logs all events into an SQL database
# You need a MYSQL database as described in the documentation.
# Please read the documentation before using this script.

SQL_HOST=192.168.0.8
SQL_USER=sql
SQL_PASSWORD="some secret password"
SQL_DATABASE=sms
SQL_TABLE=smsd_log

DATE=`date +"%Y-%m-%d %H:%M:%S"`
#Extract data from the SMS file
FROM=`formail -zx From: < $2 | sed 's/"//g'`
TO=`formail -zx To: < $2`
#Remove plus sign, spaces, minus and short number prefix
TO=`echo "$TO" | sed 's/ //g' | sed 's/+//g' | sed 's/s//g' | sed 's/-//g'`
CUSTOMERID=`formail -zx CustomerID: < $2`
SUBJECT=`formail -zx Subject: < $2`
SENT=`formail -zx Sent: < $2`
#Text is not used but could be used
TEXT=`formail -I "" <$2`

#Set some SQL parameters
if [ "$SQL_PASSWORD" != "" ]; then
  SQL_ARGS="-p$SQL_PASSWORD";
else
  SQL_ARGS="";
fi
SQL_ARGS="-h $SQL_HOST -u $SQL_USER $SQL_ARGS -D $SQL_DATABASE -s -e"

#Insert a new entry into the SQL table

if [ "$1" = "FAILED" ] || [ "$1" = "SENT" ]; then
   mysql $SQL_ARGS "insert into $SQL_TABLE (type,CustomerID,sent,sender,receiver,msgid,text) values (\"$1\",\"$CUSTOMERID\",\"$DATE\",\"$FROM\",\"$TO\",\"$3\",\"$TEXT\");";
elif [ "$1" = "RECEIVED" ]; then
   mysql $SQL_ARGS "insert into $SQL_TABLE (type,CustomerID,sent,received,sender,receiver,text) values (\"RECEIVED\",\"$CUSTOMERID\",\"$SENT\",\"$DATE\",\"$FROM\",\"$SUBJECT\",\"$TEXT\");";
elif [ "$1" = "REPORT" ]; then
   #Extract more data from the status report file
   DISCHARGE=`sed -e 1,/SMS\ STATUS/d < $2 | formail -zx Discharge_timestamp:`
   MSGID=`sed -e 1,/SMS\ STATUS/d < $2 | formail -zx Message_id:`
   STATUS=`sed -e 1,/SMS\ STATUS/d < $2 | formail -zx Status: | cut -f1 -d,`

   if [ "$MSGID" != "" ]; then
     ID=`mysql $SQL_ARGS "select id from $SQL_TABLE where receiver=\"$FROM\" and type=\"SENT\" and msgid=\"$MSGID\" order by id desc limit 1;"`
     mysql $SQL_ARGS "update $SQL_TABLE set received=\"$DISCHARGE\",status=\"$STATUS\" where id=\"$ID\";"
   fi

fi

 
 
'bash' Syntax Highlight powered by GeSHi


Thank you so mutch for you help :D
SMS Server Tools 3 ROCKS!! :mrgreen:

Best Regards
Morten
WolfieDK

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
50 seconds for the eventhandler is a long time. Your piece of smsd.log is not complete, can you verify that this delay happens only after a status report is received, and every time when status report is received?

You have defined admin_to number, and any time when a return value of eventhandler is not zero, an alert is sent. You could add exit 0 to the end of eventhandler code, but it is still enough.

If the problem occurs only with status report messages, you could check from the database if information is stored correctly. Probably it's not.

Perhaps you do not have sed command available. You could make a test run with your eventhandler: From the log, take the name of a received report message. Then run eventhandler manually:

/usr/local/src/smstools3/scripts/mysmsd REPORT /var/spool/sms/report/filename

You can see the error message(s). Was there any?

Member
Registered:
May 2009
Location: Hinnerup, Denmark
Topic owner
...Thanks for your quickly reply.

Quote
50 seconds for the eventhandler is a long time.
Yes, I might think is is because my sql server hardware is to slow. Im planing to upgrade it in this weekend.

Quote
Your piece of smsd.log is not complete, can you verify that this delay happens only after a status report is received, and every time when status report is received?

I think it only happens when it recives status message, but im not sure, It´s NOT making error all the time, only some times.
Here you have a new log I just created with sending 12 sms and reciving 12 sms, and here is makes the error once again.
 smsd.log 


I started the sms service and ended it again on purpose.

Quote
You have defined admin_to number, and any time when a return value of eventhandler is not zero, an alert is sent. You could add exit 0 to the end of eventhandler code, but it is still enough.

Okay, but it is fine to recive those messages, I like it.

Quote
If the problem occurs only with status report messages, you could check from the database if information is stored correctly. Probably it's not.

All my data in my db is just fine, no errors in it.

Quote
Perhaps you do not have sed command available. You could make a test run with your eventhandler: From the log, take the name of a received report message. Then run eventhandler manually:

/usr/local/src/smstools3/scripts/mysmsd REPORT /var/spool/sms/report/filename

You can see the error message(s). Was there any?

The SED commands works fine.
I have tested my eventhandler, and it makes no errors ?

Thank you for help, you the man :mrgreen:

Member
Registered:
May 2009
Location: Hinnerup, Denmark
Topic owner
Hello Keke

I have upgraded to a new mysql server in the past weekend, and no errors has occurred since. But im still testing :mrgreen:


Thanks again

  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.