<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Fullwallboard tweaking what counts as an outbound call]]></title><description><![CDATA[<p dir="auto">We have a client with FreePBX/PBXact, FOP2 and Callcenter Stats Pro.<br />
If one extension calls another extension, it adds 1 to their outbound calls number in the queue.<br />
The client would like internal calls, and internal transfers to not count as an outbound call.<br />
My thoughts are to edit the getstatsfromasternic.php file, possibly on line 481, to only include context=macro-dialout-trunk<br />
I dont know the MySQL code yet but it could look something like this - I have my extra bit in bold.<br />
Does this sound like it could work, or has anyone a better idea?<br />
Thanks<br />
Dave</p>
<pre><code>/*
$query = "SELECT agent,count,talktime FROM ( ";
$query.= "SELECT a.name AS agent,count(*) AS count, sum(billsec) AS talktime  ";
$query.= "FROM asterisk.users a ";
$query.= "INNER JOIN ( SELECT  * FROM asteriskcdrdb.cdr WHERE calldate &gt;= $mydate) b ";
$query.= "ON extension=src AND lastapp='Dial' **AND context='macro-dialout-trunk'** GROUP BY a.name ";
$query.=") j WHERE 1=1 $condagent";
*/
</code></pre>
]]></description><link>http://localhost:4567/topic/3166/fullwallboard-tweaking-what-counts-as-an-outbound-call</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 14:25:56 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/3166.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 31 Mar 2023 16:31:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fullwallboard tweaking what counts as an outbound call on Mon, 17 Apr 2023 08:45:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi, so with my limited knowledge I didn't realise the /* */ meant it commented out the original section of code I referenced at the start of this threat. I assume this code has been replaced by the two lines above it, which seems a very neat query by Tom  Teeuwen.</p>
<p dir="auto">I spent more time on this last night and have, what I believe is a good mysql query, I just cant seem to get it working in the getstatsfromasternic.php file.</p>
<p dir="auto">If I ssh to the PBX,<br />
mysql -u root<br />
use asteriskcdrdb;<br />
I can start running mysql queries to get a list of external only calls, where the cnum = the extension number of the agent (which is 4000 in my test case).<br />
<code>select * from cdr WHERE cnum=4000 AND lastapp='Dial' AND dcontext like "%restrictedroute%";</code><br />
might work because all external calls seem to go out a context name beginning with restrictedroute , or<br />
<code>select * from cdr WHERE cnum=4000 AND lastapp='Dial' AND outbound_cnum like "0%";</code><br />
because no internal extensions start with a 0<br />
We could use both together in one query, but either way, I cant seem to get this tweak into the getstatsfromasternic.php file to pull external calls onto the wallboard.</p>
<p dir="auto">If anyone has enough knowledge to know where I put AND outbound_cnum like "0%" into the below query it would be a great help. I have tried it inbetween these two bits <code>AND lastapp = 'Dial' GROUP BY </code>cnum`` but we get 0 on the wallboard.</p>
<pre><code>// query contributed by Tom  Teeuwen
$condagentoutbound = preg_replace("/AND agent IN/","AND asterisk.users.name in",$condagent);
$query = "SELECT `asterisk`.`users`.`name` AS `agent`, `cnum`.`count` AS `count`, `cnum`.`talktime` AS `talktime` FROM ( SELECT `cnum`, COUNT(*) AS `count`, SUM(`sum`) AS `talktime` FROM ( SELECT `cnum`, `uniqueid`, SUM(`billsec`) AS `sum` FROM `asteriskcdrdb`.`cdr` WHERE calldate &gt;= $mydate AND lastapp = 'Dial' GROUP BY `cnum`, `uniqueid`) AS `billsec_sum` GROUP BY `cnum`) AS `cnum` INNER JOIN `asterisk`.`users` ON `cnum`.`cnum` = `asterisk`.`users`.`extension` WHERE 1=1 $condagentoutbound";
</code></pre>
<p dir="auto">Thanks<br />
David</p>
]]></description><link>http://localhost:4567/post/12675</link><guid isPermaLink="true">http://localhost:4567/post/12675</guid><dc:creator><![CDATA[davids1]]></dc:creator><pubDate>Mon, 17 Apr 2023 08:45:52 GMT</pubDate></item><item><title><![CDATA[Reply to Fullwallboard tweaking what counts as an outbound call on Fri, 31 Mar 2023 16:33:27 GMT]]></title><description><![CDATA[<p dir="auto">Cant see how to edit, but the bold didnt show, it has added ** either side of the extra bit I added<br />
<strong>AND context='macro-dialout-trunk'</strong></p>
]]></description><link>http://localhost:4567/post/12674</link><guid isPermaLink="true">http://localhost:4567/post/12674</guid><dc:creator><![CDATA[davids1]]></dc:creator><pubDate>Fri, 31 Mar 2023 16:33:27 GMT</pubDate></item></channel></rss>