As Of 25 07 2008

Configuration file editor

In order to eliminate administrators face in editing configuration files, a tool was developed. This will help them to easily set the configuration files and also make sense of the values.

SMSReader - Read SMS from modem

  • Only one value needs setting the port number
config_smsreader.jpg

Fig 1. SMSReader configuration file editor

DataProcessor - Create Poetry

Values that is set;

  • Number of keywords to select from the SMS
  • Number of synonyms to select
  • Polling enabled
  • When to backup the sms_log table
  • How long banned phone numbers are held in the system
config_poetry.jpg

Fig 2. DataProcessor configuration file editor

Display - Text Display

These configuration values are not yet finalized. I just add some of the values I think that may be useful.

config_display.jpg

Fig 3. Display configuration file editor

Banned phone numbers

If a user sends a SMS containing a banned word what will happen in the current system is, the message will get rejected. After realizing what is happening, the user may try more creative ways to get his message across and may succeed. I have modify the application somewhat to handle this scenario.

Some changes had to be done to “sms” table and a new table called “ban_numbers” was created. The problem is when the SMSReader receives a message it does not know whether it contains a banned words because it does not check for banned words. Only data processor can detect it but it does not know who sends the message. That information is in “sms_log” table. It is cumbersome to check the entries in very large “sms_log” table. Only information we need is the telephone number. So the SMSReader is modified to write the telephone number to “sms” table.

tbl_sms.jpg

Fig 4. Modified "sms" table

Now when the DataProcessor detect the banned word it know the phone number used to send the banned word. This number is written to the “ban_numbers” table. The log_time indicate the receive time of the message. This is not the time stamp of the SMS. It is the time record added to the database. The SQL used to add this entry is;

String^ sql = "INSERT INTO ban_numbers(telephone_number,log_time) VALUES('"+ telephone->Replace("'","''") +"',NOW())";
tbl_ban_numbers.jpg

Fig 5. New "ban_numbers" table

DataProcessor loads all the banned telephone numbers from the “ban_numbers” table and every time message is received it is checked against the list of banned numbers it has. Even the user sends a good message after sending a banned message it will be rejected. We do not keep the banned numbers forever in the table. The duration it kept in the table is read from the configuration file. From time to time DataProcessor run a check on “ban_numbers” table using the log_time and current time. If the message is held more then time allocated time it is deleted from the “ban_numbers” table and the users message are gain accepted by the system.

The SQL used to do this is;

DELETE FROM ban_numbers WHERE ban_numbers.log_time < NOW() - INTERVAL "+ hold_duration +" MINUTE
SELECT * FROM ban_numbers

First sql delete the old numbers, the other one get the new list of numbers to the DataProcessor

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.