<div dir="ltr">It depends on how your cdr statistics are stored.. CSV file, sqlite, pgsql, mysql.. for how easy it is to run a query.<div>And if you want just inbound or outbound "on" that DID.</div><div><br></div>
<div>Then just add that SQL query to a script and have a cron job run it..</div><div>e.g. if you use mysql in fusionpbx to store your cdrs (via xml_cdr posts) I can run:</div><div><a href="http://dev.mysql.com/doc/refman/5.1/en/select.html" target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">SELECT</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><a href="http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html#function_sum" target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">SUM</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">(</span><span class="jush-bac" style="color:red;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">`</span>billsec<span class="jush-op">`</span></span><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">)/60 </span><a target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">FROM</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><span class="jush-bac" style="color:red;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">`</span><a href="https://sip.bestfone.com/mod/adminer/index.php?server=localhost&username=root&db=freeswitch&table=v_xml_cdr" class="jush-custom">v_xml_cdr</a><span class="jush-op">`</span></span><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><a target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">WHERE</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><span class="jush-bac" style="color:red;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">`</span>sip_to_user<span class="jush-op">`</span></span><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> = </span><span class="jush-sql_apo" style="color:green;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">'</span>$number<span class="jush-op">'</span></span><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><a href="http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html#operator_and" target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">AND</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><span class="jush-bac" style="color:red;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">`</span>start_stamp<span class="jush-op">`</span></span><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><a href="http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#operator_like" target="_blank" rel="noreferrer" style="color:navy;font-weight:bold;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)">LIKE</a><span class="Apple-style-span" style="font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"> </span><span class="jush-sql_apo" style="color:green;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">'</span>2011-11%<span class="jush-op">'</span></span></div>
<div><span class="jush-sql_apo" style="color:green;font-family:monospace;font-size:12px;line-height:14px;background-color:rgb(238,238,238)"><span class="jush-op">= </span></span><span class="Apple-style-span" style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">831.4500 minutes for all of November 2011. (pgsql doesn't like using a like like that on a time stamp field, it seems..)</span></div>
<div><span class="Apple-style-span" style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"><br></span></div><div><span class="Apple-style-span" style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">Your query, and source info, will vary..</span></div>
<div><br clear="all"><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small">-Avi</span></span></div><br>
<br><br><div class="gmail_quote">On Sun, Jan 15, 2012 at 12:41 AM, Rodney <span dir="ltr"><<a href="mailto:notlikeme75@yahoo.com">notlikeme75@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div>does anyone have a cdr viewer or method that can help me determine the total minutes for all calls on a specified DID for the hour/day/month to date? I would like a method to generate such a report and maybe have it emailed on a 24 hour basis to the person in charge of the DID. the following I have seen in the past with any method to find the original program that would give an output like this.</div>
<div><h1 style="font-weight:normal;font-size:1.33em;margin-top:0.67em;margin-right:0px;margin-bottom:10px;margin-left:0px;padding-bottom:7px;color:rgb(205,0,0);font-family:Arial,Helvetica,sans-serif">Calls by Day, <span>DNIS</span> -> DID ACCOUNT-> Friday, 8/19/11 (Eastern Standard Time)</h1>
<br style="color:rgb(69,69,69);font-family:Arial,Helvetica,sans-serif;font-size:12px"><table style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-collapse:collapse;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;border-top-color:black;border-right-color:black;border-bottom-color:black;border-left-color:black;border-top-style:double;border-right-style:double;border-bottom-style:double;border-left-style:double;margin-right:10px;color:rgb(69,69,69);font-family:Arial,Helvetica,sans-serif;font-size:12px">
<thead><tr style="vertical-align:top"><th colspan="3" style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;border-top-color:black;border-right-color:black;border-bottom-color:black;border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:double;border-top-style:double;border-right-style:double;border-bottom-style:double">
</th><th colspan="3" style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;border-top-color:black;border-right-color:black;border-bottom-color:black;border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);font-size:larger;text-align:center;border-left-style:double;border-top-style:double;border-right-style:double;border-bottom-style:double">
Daily</th><th colspan="3" style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;border-top-color:black;border-right-color:black;border-bottom-color:black;border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);font-size:larger;text-align:center;border-left-style:double;border-top-style:double;border-right-style:double;border-bottom-style:double">
Month to Date<br>(Start of Month = Day 21)</th></tr><tr style="vertical-align:top"><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:3px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:double">
Day</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);text-align:right;border-left-style:solid">
DNIS</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:solid">
DNIS<br>Group</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:3px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:double">
Total<br>Calls</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:solid">
Minutes<br>of Use</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:solid">
Average<br>Hold Time<br>(Minutes)</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:3px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:black;background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:double">
Total<br>Calls</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:rgb(211,211,211);border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:solid">
Minutes<br>of Use</th><th style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:black;border-bottom-color:rgb(211,211,211);border-left-color:rgb(211,211,211);background-color:rgb(220,220,220);color:rgb(205,0,0);border-left-style:solid">
Average<br>Hold Time<br>(Minutes)</th></tr></thead><tbody style="width:418px"><tr style="vertical-align:top"><td colspan="9" style="padding-top:1px!important;padding-right:1px!important;padding-bottom:1px!important;padding-left:2px!important;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:rgb(211,211,211);border-right-color:black;border-bottom-color:rgb(211,211,211);border-left-color:black;font-style:italic;border-left-style:solid">
– No rows –</td></tr></tbody></table></div></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>