Author |
Post |
|
#1 Tue Aug 11, 2009 11:10, 186 months ago.
|
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
|
|
#2 Tue Aug 11, 2009 11:37, 186 months ago.
|
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.
|
|
#3 Tue Aug 11, 2009 13:12, 186 months ago.
|
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 : 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, 186 months ago. »
|
|
#4 Tue Aug 11, 2009 15:24, 186 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: ":
|
|
#5 Tue Aug 11, 2009 22:27, 186 months ago.
|
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
|
|
#6 Wed Aug 12, 2009 09:34, 186 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
mikolajj wrote - told you I'm not a shell geek ;-)
...but soon you are 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?
|
|
#7 Fri Aug 14, 2009 20:48, 185 months ago.
|
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
|