View Single Post
Posts: 165 | Thanked: 78 times | Joined on Jun 2010
#13
Hi Leonardo

Thanks again for restarting your work on this widget.

I tried your call-log-terminal application and it worked ok.
This was the xterm output:

Code:
/home/user/MyDocs # call-log-terminal 2 2010 09 01 
DB opened
Debug: "select strftime("%J"       ,storage_time, 'unixepoch','localtime'       ) from Events order by id limit 1;" 
Debug: "select strftime("%J"       ,storage_time, 'unixepoch','localtime'       ) from Events order by id desc limit 1;" 
Debug: "select count(*), sum(end_time-start_time)            from Events where service_id=1 and outgoing=0 and             strftime("%J",storage_time, 'unixepoch','localtime')            > strftime("%J","2010-09-01") and end_time != 0            and local_uid = "ring/tel/ring"
" 
Warning: You have  11  ingoing calls  for a total of  7 minutes
  and  17  outgoing calls  for a total of  7 minutes
  
Debug: "select strftime("%J"       ,storage_time, 'unixepoch','localtime'       ) from Events order by id limit 1;" 
Debug: "select strftime("%J"       ,storage_time, 'unixepoch','localtime'       ) from Events order by id desc limit 1;" 
Debug: "select count(*)             from Events where service_id=3 and outgoing=0 and             strftime("%J",storage_time, 'unixepoch','localtime')             > strftime("%J","2010-09-01");
" 
Warning: SMS query returned  6 sent SMS and  4  received SMS
The real values retrieved from my el-v1.db are:
sent sms = 6
received sms = 4
ingoing calls = 12 (1 call with end_time=0)
ingoing calls duration = 7min 15s
outgoing calls = 28 (11 calls with end_time=0)
outgoing calls duration = 7min 41s

Comparing the real values with the output from call-log-terminal it seams ok.
The program doesn't count the calls with end_time=0 which i think is correct.
The call duration sum is truncated to the minute. This is a difficult issue as it should be evaluated according to the user plan.
For instance my provider invoices 1 min if outgoing call duration is less or equal to 1min and rounds to the next half minute for durations greater than 1min.

Later on i will try and post the above test with a larger database.

Thanks

Test results with a larger database:

~ $ call-log-terminal 1 2010 07 01
DB opened
Warning: You have 86 ingoing calls for a total of 71 minutes
and 125 outgoing calls for a total of 108 minutes

Warning: SMS query returned 12 sent SMS and 19 received SMS
~ $ call-log-terminal 1 2010 07 32
DB opened
Fatal Error: The date entered is invalid!
Aborted
~ $ call-log-terminal 1 2010 15 02
DB opened
Fatal Error: The date entered is invalid!
Aborted
~ $ call-log-terminal 1 01 07 2010
DB opened
Fatal Error: The date entered is invalid!
Aborted
The real values retrieved from my el-v1.db are:
sent sms = 12
received sms = 19
ingoing calls = 86 (with end_time>0)
ingoing calls duration = 71min 3s
outgoing calls = 125 (with end_time>0)
outgoing calls duration = 108min 37s

I think this proves that call-log-terminal is working well.
I suggest that if possible the call time should be evaluated in time period units per call.
For instance if the user time period is 30s a call with 1min 35s should be evaluated as:
1m35s= 95s -> int(95/30+0.9)=4 -> 4X30s=120 -> 120s= 2min
and for a user time period of 1s the result would be 1m35s

Last edited by sacal; 2010-09-13 at 15:57.