POSSA / freepbx-Call-Statistics

FreePBX module for reporting concurrent calls as well as breaking calls down by extension
https://github.com/POSSA/freepbx-Call-Statistics
31 stars 18 forks source link

Proposal: Support for "custom" trunks #14

Open zlobar opened 10 years ago

zlobar commented 10 years ago

For example, chan_dongle's "custom" trunks for USB GSM modems.

zlobar commented 10 years ago

By the way, thanks for module! :)

lgaetz commented 10 years ago

You're very welcome!

I made some changes to support custom trunks but have no way to test. Give this a try:

cd /var/www/html/admin/modules/callstatistics/concurrentcalls
mv concurrentcalls.php concurrentcalls.php.back
wget https://raw.githubusercontent.com/POSSA/freepbx-Call-Statistics/working/concurrentcalls/concurrentcalls.php
chown asterisk:asterisk concurrentcalls.php

Now go to the GUI and load the concurrent calls graph and see what happens.

lgaetz commented 9 years ago

This code does not work. In order to query the CDR for calls to a single custom trunk you need to:

  1. query FreePBX for list of custom trunks (done)
  2. determine the dial string for the selected custom trunk
  3. query the CDR for the appearance of the dial string

A custom trunk defined with a SIP/ dial string gets recorded in the CDR as a SIP call not a 'custom' call, so it will be included in all queries looking for SIP trunks. There is not an easy way of aggregating all custom trunks together.