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. Thu Mar 28, 2024 09:52
SMSTools3 Community » Help and support Bottom

[answered] Incoming SMS length

  This topic is locked

Page:  1

Author Post
Member
Registered:
May 2011
Location: Lima, Peru
Operating system name and version: Debian Squeeze
Version of smsd: 3.1.14
Smsd installed from: apt-get install
Name and model of a modem / phone: SIM548C
Interface: USB-Serial

Hi friends;

I want to know if it's possible to configure the max length of a sms. It's only that I am testing smstools with a modem just for receiving sms's and even the sms has 100 characters, smstools only get the first 50 chars.

Please tell me where can I configure this.
Thanks!

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Length is not configurable and smstools does not cut incoming messages.

Use the loglevel = 7 and show from the log how SMS is received. Also show hexdump -C < /var/spool/sms/<incoming SMS file>.

Member
Registered:
May 2011
Location: Lima, Peru
Topic owner
Actually was my mistake, smstools is correctly getting the full incoming sms. But when I use sample code for inserting incoming sms into MySql table, the text is not complete.

The field txt in MySql table is varchar(220) so it would fit any sms.

But I only get the first 50 chars in MySql table. How to fix this? Thanks!

The code is

#Extract data from the SMS file
FROM=`formail -zx From: < $2`
TEXT=`formail -I "" <$2 | sed -e"1d"`

#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"

#Do the SQL Query
#mysql $SQL_ARGS "UPDATE $SQL_TABLE SET stat=\"1\" WHERE cel=\"$FROM\";"
mysql $SQL_ARGS "insert into $SQL_TABLE (cel,txt) values (substring(\"$FROM\",-9),\"$TEXT\");"

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
What kind is the text in SMS, does it contain backslashes and/or double quotation marks? At least you should make it "SQL safe", like:

TEXT=$(echo "$TEXT" | sed 's/\\/\\\\/g' | sed 's/\"/\\\"/g')

Member
Registered:
May 2011
Location: Lima, Peru
Topic owner
It's just text only 'a-z''A-Z''0-9' and blank spaces with no other symbols. I tested with 4 incoming SMS with more than 50 chars but when it's transfered to MySql it always get the first 50 chars.

I will test with your recommendation.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Check from the log of MySQL what kind of clause is executed, to see if the problem is on the script side, or on the server side. Also verify that the field surely is varchar(220).

  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.