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 01, 2024 23:20
SMSTools3 Community » Help and support Bottom

[answered] Is it possible to store count number of real sms messages that were sent?

  This topic is locked

Page:  1

Author Post
Member
Registered:
Aug 2009
Location: Poznan, Poland
Hi,
I would like to store number of messages that were used to send message content. Specially that I have a prepaid phone connected to my laptop and ammount of free SMS messages is important to me.

If I could save this count I could sum this and get the amount of messages left to send for free.

I can't find any parameter from .../sent/somefile.EAFszDFR that shows number of SMS messages used to send message. There's only a Length parameter, but for UCS2 messages it's not equivalent to ISO Length, so dividing Length by 160 or 67 (not sure about this 67) does not make sens.

Is there any config parameter to save this info inside the sent file?

Regards
Mikolaj

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
There is no such kind of parameter, but you can use store_sent_pdu = 3 and count how many PDU: XXXX lines are in the sent message file.

With status monitor you can see total number of messages sent:

- Install OSSP mm library
- In the smstools3/src/Makefile, comment out #CFLAGS += -D NOSTATS
- In the src directory, run: make clean smsd
- Edit smsd.conf, add a global definition: stats = /var/spool/sms/stats
- Create this directory.

After restarting smsd you will have GSM1.counter file in the stats directory. This counter is number of message parts sent. Smsd never clear it, you have to clear it manually when there is a reason to do so.

Member
Registered:
Aug 2009
Location: Poznan, Poland
Topic owner
Thx for fast answer.

I did both things.
Second was easier ;-) so I got my NOKIA6310i.counter file with counter ;-)

But I also would like to store this info in database, so I had to count "PDU" lines.
I had to google a little bit and fount this, because I'm a shell lamer 8) :


so now in my handler file there's:


And I can save this value to DB.
Hope it helps someone.

THX again
Mikolaj

PS It's working in cygwin env.


« Last edit by mikolajj on Tue Aug 11, 2009 13:13, 179 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Notice that when you grep a count of "PDU", the result will include also words from the message body. So if your message is talking something about PDU, this is counted as a number of parts. Grepping "^PDU: " work better, but still if a line in message body starts with "PDU: ", the counter is incorrect...

With a small modification you can extract header part from the message file and get the number of lines starting with "PDU: ":


Member
Registered:
Aug 2009
Location: Poznan, Poland
Topic owner
THX a lot.
Your version is better ;-) - told you I'm not a shell geek ;-)

BTW theres a strange file in sats.tmp in .../stats directory starting with "VERSION 3.1.5-1..." is this has to do sth with taking stats once per X minutes/hours from status_interval?

Or sth is wrong with my shared memory and the file is used?

Regards
Mikolaj

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
mikolajj wrote
- told you I'm not a shell geek ;-)

...but soon you are 8)

Quote
BTW theres a strange file in sats.tmp in .../stats directory starting with "VERSION 3.1.5-1..." is this has to do sth with taking stats once per X minutes/hours from status_interval?

Just that. When smsd is stopped, statistics data is stored into this file and when a daemon is started again, it continues with this data.

Your shared memory works well, surely you also tested it while installing OSSP mm?

Member
Registered:
Aug 2009
Location: Poznan, Poland
Topic owner
Quote
Your shared memory works well, surely you also tested it while installing OSSP mm?

Yes, shared memory works fine.

Regards
Mikolaj

  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.