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. Wed May 08, 2024 17:06
SMSTools3 Community » Help and support Bottom

[answered] Sms Tools melt down....

  This topic is locked

Page:  1

Author Post
Member
Registered:
Sep 2009
Location: Australia
Hey everybody!

I must say great tool set, its easy and straight forward.

I'm currently using SMS tools 3 on OSX it works, not sure if anybody else has tried this or not. But I can confirm this.

With that out of the way I do have some problems they may or may not relate to OSX.

I run a fairly simple setup 1 GSM modem ( possibly 2 ) and a single server. The server is also used for a database system that about 3-5 computers access throughout the day. It is not a very heavy load(?).

I have created a web front end for SMS tools to be used on the client machines. Everything works....

Since it has been put to use I have had to restart the process several times, if fact it has not lasted a full day yet.

The problems have been, first my event handle script returns an error:


:oops:

I would like to use the alert handler but would like some guidance or examples.

Eventually the smsd process fails and and no more sms-ing for the office.
This is my event handler script.... No doubt I'm doing something wrong.
#!/bin/sh
if [ "$1" == "SENT" ]; then
        exit 1
fi
if [ "$1" == "FAILED" ]; then
        POST=`formail -zx From: < $2`
        SENT=`formail -zx Sent: < $2`
        MESSAGE="FAILED"
        FROM="0"${POST:2}
        SQL_ARGS="-h localhost -u root -ppassword -D db -s -e"
        mysql $SQL_ARGS "INSERT INTO inbox (number, text, sent) values (\"$FROM\", \"$MESSAGE\", \"$SENT\");"

        exit 1
fi
if [ "$1" == "RECEIVED" ]; then
        POST=`formail -zx From: < $2`
        SENT=`formail -zx Sent: < $2`
        MESSAGE=`formail -I "" < $2`
        FROM="0"${POST:2}

        SQL_ARGS="-h localhost -u root -ppassword -D db -s -e"
        mysql $SQL_ARGS "INSERT INTO inbox (number, text, sent) values (\"$FROM\", \"$MESSAGE\", \"$SENT\");"

fi

exit 1

EOF
 
'bash' Syntax Highlight powered by GeSHi


Thanks in advance

-M@

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
The script should always use exit 0 as a return value. However, this should not cause a freezing.

Does the problem occur every time when a message is received and eventhandler is executed? How do you see that restarting is needed, what is in the log and in the ps list (is it in <defunct> state)?

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Hey Keke!

The problem occured first when about 50 messages were sent at once. Up to that point we had problems for at least 3 days though usage was only testing, this was about just simple back and forth to make sure the database was storing messages correctly.

This is one of the process termination events in the logs from a few days ago. When the bulk messages were sent. The process had been up for a few days prior though.



Also I get two processes running. This is what 'ps -e | grep sms' returns.



Is that correct?

I will also note that the process was restarted and I preformed a test by sending the about 50 text messages of about 100 characters and requesting a reply. Everything went to plan The messages went out and I also got the replys. It was not until the day after the process terminated again. I lost the log with that termination info.

Thanks again.

-Mattb

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
The process list is correct, there should be one mainspooler and one devicespooler for each modem.

The problem is caused by the name of SMS file. The file created to the outgoing folder has an unique name, but there has just been a message file which had the same name. As the previous message was not yet sent, mainspooler was unable to move a new file to the checked folder.

Much more longer randomized name could be used to prevent this kind of conflict. However, a conflict can still happen.

You can use a setting keep_filename = no in the smsd.conf. With this setting a new unique filename is created each time when a message file is moved from folder to another.

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Awesome!

I will give it a try!

You said before that the event handler shouldn't cause the process to break, I have been receiving alerts with every message could this be simply because I have the script returning 1 and not 0?

Thanks Keke, you are doing an great job in the forums!

:D :D

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Thanks! 8)

Yes, the return value 1 causes alerts to the log. In usual cases value 0 should always be used.

Return value other than zero indicates an error in the script. It can be used to send an SMS alert to the administrator. There is admin_to setting in the smsd.conf file, it's a GSM number. For example, if an eventhandler detects that filesystem is not writable, it can return a nonzero value. You will then receive an SMS containing something like: "Sms3: GSM1, problem with eventhandler, result 5". From the SMS you can know that 5 means a fatal filesystem failure.

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Hey Keke, would there be any proformance loss from running the log level at debug(7) for long periods of time?

Cheers

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Logging with level 7 is not a performance issue, but depending on number of modems and how often they are checked, the logfile may grow very much. To avoid this, it's recommended to use loglevel = notice and smart_logging = yes in the configuration file. With these settings any troubles, but only troubles, are logged into the smsd_trouble.log and smsd.log will not grow unnecessarily.

Do you now receive e-mails from this board?

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Thanks again Keke,

I am receiving emails now, thanks.

In terms of volume 30-50 SMS's at once is really not to much for a single server and single GSM modem? I have another GSM modem I can use if this would assist in breaking the load up? As I am unaware of what setups and loads people typically use.
I'm assuming I have a light load and the one server is enough to deal with my load?

Cheers.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
30-50 SMS's is a light load, but of course it takes 4-6 minutes to get them sent all. You can use additional modem(s) for reducing the sending time, if necessary. However, then you will have a different number of sender for some SMS, because the GSM number of a SIM card cannot be changed.

Without any additional settings for queues, you can use as much modems you need and they will all serve the default queue (/var/spool/sms/checked).

Practical limit with a current version (3.1.5) of smsd on systems with very heavy load is about 10 - 15 modems and about 500 -600 messages per hour per each modem.

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Hey!

I thought that my load was not very heavy. I am still trying to iron out the kinks in my setup.

This is what 'ps -e' gives me, currently it appears to be running but no messages are being sent or received. Do you know why the brackets are around one of the processes?



This is the trouble log after a day usage(not heavy). I have seen this before. It appears the modem is failing to communicate. Is it possible the GSM modem is not initialized correctly? Or maybe the signal is dropping out.



When I run the log in debug(7) level AT+CREG? returns normally....

Thanks again.

-M@

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
mattb wrote
Do you know why the brackets are around one of the processes?

Sorry, I do not know for sure and cannot check this right now as I'm running GNU/Linux on my Mac Mini and cannot reboot it. Perhaps it means <defunct>, as there usually are no brackets.

Quote
This is the trouble log after a day usage(not heavy).

Somebody was trying to make a call, but it was not a process which was logging to the trouble log. It looks like there was another process running which was using the same modem. As there are answers like CSQ and CREG, this another process must be device handler of smsd.

Probably you have changed some settings and started smsd while there was previous process still running? On OSX, the startup script sms3 should be used to start and stop the smsd, like in any other operating systems too. On OSX there is no init.d directory and therefore install script does not copy the script anywhere. It must be copied and used manually. The script has been tested under OSX and and it works if your uname says Darwin.

What is the version of smsd you are using?

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Quote
What is the version of smsd you are using?

Latest 3.1.5

Quote
the startup script sms3 should be used to start and stop the smsd

Previously I was not using the script to start smsd. I have changed that now. Though I am still getting a NO CARRIER error on the logs.

Quote
Somebody was trying to make a call, but it was not a process which was logging to the trouble log. It looks like there was another process running which was using the same modem. As there are answers like CSQ and CREG, this another process must be device handler of smsd.

The two GSM modems are used for the phone system via astricks but are not connected via the serial port, which I use to connect the GSM modem to the MAC for the SMSing. Could this be my problem? Another company handles the phone system so I am unaware of there setup beyond that it uses astericks.

Thanks again.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Modems used should be dedicated for smsd only. Another process which cause "NO CARRIER", may cause serious troubles if this answer is received at the wrong time.

Member
Registered:
Sep 2009
Location: Australia
Topic owner
Hey Keke!

Thanks for all your help.

So basically I should have a dedicated GSM gateway for SMSes?

The current setup has astericks running two 2N via the PSTN ports for phone calls. A mac mini is plugged into one of the gateways via a serial port, this is what communicates with SMSD.

I assume that the commands from astericks are colliding with SMSD and causing my problems?

Thanks again. I am but a hack, I made a quick web front end for smsd and thought this would be a easy task....

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
mattb wrote
So basically I should have a dedicated GSM gateway for SMSes?

Yes, but with low traffic this kind of device can be used.

Quote
I assume that the commands from astericks are colliding with SMSD and causing my problems?

It seems that there was two smsd's running at the same time and that was causing most of problems. As you are now using the sms3 script, there will be no more that kind of problems.

The manual of the device says about serial interface:
"EasyGate’s central processor uses the same interface for establishing calls and so it must have the possibility to block an external serial interface".

And:
"The SMS program is only blocked temporarily during outgoing call establishing and incoming call ringing."

This means that there will be unexpected input sometimes, and sometimes interface cannot be used properly. You can avoid collisions with a longer delaytime in the smsd.conf, for example one minute or more. When an SMS is sent, there can be up to three retries when a collision happens. As you are already handling failed messages, nothing is lost forever.

  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.