POSSA / freepbx-trunk-balancing

Restrict outbound calls or balance calls over multiple trunks based on user specified parameters
http://pbxossa.org/files/trunkbalance/
37 stars 30 forks source link

Maxtime only calculates outbound minutes #11

Closed lgaetz closed 11 years ago

lgaetz commented 11 years ago

When a trunk is defined with the Maximum Time parameter, only outbound minutes on the trunk are calculated. There should be a checkbox option to also include inbound minutes in this number.

line 350 of /agi-bin/trunkbalance.php calculates the outbound minutes, inbound can be measured similarly:

$sql='SELECT SUM(billsec) FROM `cdr` WHERE disposition=\'ANSWERED\' AND channel LIKE \''.$channel_filter.'\''.$sqldate.$sqlpattern;
lgaetz commented 11 years ago

Issue applies to max number of calls as well at line 263

inbound count: SELECT COUNT(*) FROMcdrWHERE disposition=\'ANSWERED\' AND channel LIKE \''.$channel_filter.'\''.$sqldate.$sqlpattern;

lgaetz commented 11 years ago

this ticket addressed in ver. 1.1.0