Commit Graph

99 Commits

Author SHA1 Message Date
demonspork 1a1edf1195 Improved Missed Call accuracy, cdr statistics, and hide duplicated CDRs from Enterprise Ring Groups
Changes
--------
  - Improve CDR Import Logic so that missed_call column is more accurate to the "missed" status. It would previously mark unanswered outbound calls as "missed". These are their own category of call.
  - Don't mark the CDRs of the "legs" of an Enterprise Ring Group call as missed, only the originating_leg will be marked (one missed call per call) - We could also just "skip" importing these call legs. Simultaneous ring groups don't have these duplicated CDRs for every ringing phone. The "Skip" approach might make most of the rest of this work irrelevant.
  - Create `originating_leg_uuid` column in v_xml_cdr and import it into the database during CDR imports so it is available for filtering Enterprise Ring Group calls out of CDRs and reports.
  - Move logic that hides the agent leg of CC calls, LOSE_RACE calls, and the Enterprise Leg hiding code from xml_cdr.php into xml_cdr_inc.php into the SQL query WHERE clause so the CDR page looks more consistent. The logic is the same, but these calls are now excluded from the query result entirely instead of having to "skip" rendering them in the list on the xml_cdr.php page.
  - Improved CDR statistics page to use the missed_call variable instead of relying upon billsec and answer_stamp/answer_epoch. Added the same logic as the xml_cdr pages to the query so it excludes enterprise ring group call legs.
  - Laid the query groundwork in xml_cdr_statistics to report on Average TTA (No UI changes yet to include that statistic)

Retroactive Changes
---------------------
There are a few changes going back in time to bring everything in line with this better reporting accuracy:
  - If you want the populated the `originating_leg_uuid column` in `v_xml_cdr`, it will rely upon having the `json` column and not having deleted the data from it like I know some people do for space saving.
  - If you don't have the json column,  you are mostly out of luck for hiding the duplicate legs of Enterprise ring group calls. It might be possible, but it isn't going to be easy.
  - On Newer Versions of postgres, this works:
```
UPDATE v_xml_cdr SET originating_leg_uuid = (json->'variables'->>'originating_leg_uuid')::uuid WHERE json->'variables'->>'originating_leg_uuid' IS NOT NULL;
```
  - For some reason on postgres 9.4, I had to UPDATE every single record because I couldn't get it to allow the json syntax properly after the WHERE. This is fine, it doesn't change the end result it just means it has to run the UPDATE on every record, which will take a while
```
UPDATE v_xml_cdr SET originating_leg_uuid = (json->'variables'->>'originating_leg_uuid')::uuid;
```
  - To remove the `missed_call = true` on all your previous outbound records so that they don't show up when you filter on missed (outbound unanswered calls can be accurately listed with TTA max 0 and direction outbound)
```
UPDATE v_xml_cdr SET missed_call = false WHERE direction = 'outbound' AND missed_call = true;
```
2021-02-20 11:51:24 -06:00
Greenbea 3a01537487 CDR add permision to hide call center agent legs
Author:    agree <ahrongreenberg@gmail.com>
2021-01-12 16:55:27 -05:00
fusionate e8e67a6af7 CDR: Verify is array before checking size. 2020-12-28 14:23:00 -07:00
emaktech cc5eba5699
Revert "Order by start_epoch to Speed Up Query Execution" 2020-12-23 23:52:15 -05:00
emaktech c97d9e7022
Order by start_epoch to Speed Up Query Execution
In some cases, this seems to speed up xml_cdr loading times by ~10x.

It appears one big cause of this is the final ORDER_BY statements are very slow in PostgreSQL for timestamp fields. Ordering by start_epoch field improves query execution time in a dramatic way and should result in the same ordering.
2020-12-07 15:56:26 -05:00
Nate 41501eee61 CDR: Mitigate warnings if no extensions assigned to user. 2020-09-29 13:56:10 -06:00
FusionPBX 4b413ee745
Comment out the json results so that the code uses less RAM. 2020-09-16 15:26:50 -06:00
FusionPBX d53bf56ee6
Remove is_array on extension_uuids 2020-05-14 20:48:57 -06:00
konradSC ef116cedd9
Specify table for Accountcode Search (#5243)
I had to add "c." in order for accountcode CDR searches to work under Advanced CDR Search. 

I suspect there may be more that require this, but I haven't checked every field under advanced search.
2020-04-24 10:07:35 -06:00
Nate dbdfafcfd8 CDR & Archive: Merge and simplify, integrating some features of CDR into Archive. 2020-02-11 10:44:00 -07:00
FusionPBX 1076c99d63 Update xml_cdr_inc.php 2020-01-28 17:27:23 -07:00
chansizzle 2bc43685b9 Update xml_cdr_inc.php (#4876) 2019-11-19 11:11:35 -07:00
Nate 0ebddaf2fa CDR: List view updates. 2019-10-22 01:43:55 -06:00
Nate eec1699e01 CDR: Recording filter search support. 2019-09-28 19:47:00 -06:00
Nate 90c7afb442 CDR: TTA min/max search support. 2019-09-28 19:30:07 -06:00
Nate 407230e580 CDR: Duration min/max search support. 2019-09-28 19:21:55 -06:00
FusionPBX 52a5cf12fb Update xml_cdr_inc.php 2019-09-28 18:47:53 -06:00
FusionPBX 38686dd5ab Update xml_cdr_inc.php 2019-09-28 18:42:13 -06:00
Nate 46a6461630 CDR: Move column sort to select box in search form. 2019-09-26 08:27:13 -06:00
chansizzle e36acf1dcd Update xml_cdr_inc.php (#4646)
removes potential "Warning: Use of undefined constant"
2019-09-24 13:38:07 -06:00
FusionPBX c7fe77b328 Update xml_cdr_inc.php 2019-09-06 18:46:50 -06:00
Nate cc33248ac7 CDR: Database class integration. 2019-09-03 08:29:44 -06:00
FusionPBX eb0d39f1f9 Update xml_cdr_inc.php 2019-06-27 09:05:06 -06:00
FusionPBX 788614f74e Update xml_cdr_inc.php 2019-06-17 23:35:48 -06:00
FusionPBX 1fcd780aa0 Update xml_cdr_inc.php 2019-06-06 21:10:20 -06:00
agree a2d67d8e7a Update xml_cdr_inc.php 2019-05-24 13:55:59 -04:00
FusionPBX 97587e58a2 Update xml_cdr_inc.php 2019-04-24 14:37:26 -06:00
FusionPBX 8eda84cf55 Update xml_cdr_inc.php 2019-04-11 17:53:10 -06:00
FusionPBX acac0f284d Update xml_cdr_inc.php 2019-03-03 12:03:13 -07:00
FusionPBX a7785cef65 Update xml_cdr_inc.php 2019-02-01 13:35:30 -07:00
FusionPBX 29bf914dcb Update xml_cdr_inc.php 2019-01-30 08:36:37 -07:00
FusionPBX 9c2e8e2ae2 Update xml_cdr_inc.php 2018-12-16 14:33:55 -07:00
FusionPBX 778debc34c Update xml_cdr_inc.php 2018-10-17 22:22:46 -06:00
FusionPBX 92e9978e43 Update xml_cdr_inc.php 2018-07-03 18:40:35 -06:00
FusionPBX 19bb43b0cd Update xml_cdr_inc.php 2018-06-29 14:18:34 -06:00
FusionPBX 758a89484c Update xml_cdr_inc.php 2018-06-26 11:38:23 -06:00
konradSC 9c86e5bae1 Fix wildcard search for Source (#3197)
Match updates in 4.4 branch to fix search options
2018-06-26 11:36:48 -06:00
FusionPBX 0125eb42e8 Update xml_cdr_inc.php 2018-05-01 03:16:40 -06:00
FusionPBX e05683f66b Update xml_cdr_inc.php 2018-05-01 02:57:47 -06:00
konradSC c7510768c7 Updates for CDR archives database server (#3036)
* Updates for CDR archives database server

* Add CDR Archive Server

* Updates for CDR archive server

* Updates for CDR Archive server

* Updates for CDR Archive server

* Create xml_cdr_archive.php
2018-04-23 13:24:30 -06:00
FusionPBX db74dfd932 Update xml_cdr_inc.php 2018-02-09 13:39:32 -07:00
FusionPBX 2e39ad9444 Update xml_cdr_inc.php 2017-12-09 12:26:36 -07:00
FusionPBX 95a4ca1f2a Update xml_cdr_inc.php 2017-11-02 22:05:33 -06:00
FusionPBX c505ee2a41 Update xml_cdr_inc.php 2017-11-02 09:14:12 -06:00
FusionPBX 482321a3b8 Update xml_cdr_inc.php 2017-10-15 12:55:00 -06:00
Alexey Melnichuk 6adce64d7f Add. Support `missed` argument in xml_cdr.php (#2711)
This argument used when build link in xml_cdr_statistics.php.
2017-06-23 09:21:25 -06:00
Alexey Melnichuk 9050da03cc Add. Handle `b` legs in CDR. (#2626)
* Add. Handle `b` legs in CDR.

CDR list/statistic by default handle only `a` legs.
So it prevent display wrong result when b-leg turn on.
Add ability to write to db `b` legs only for specific call directions.

To be able see b-legs in CDR need set xml_cdr_b_leg permission.
To add specific call direction to filter need add element to `cdr/b_leg/array` in default/domain settings.

* Add. `b_leg` to defalut settings.
2017-06-02 22:31:20 -06:00
FusionPBX bc73617cf4 Update xml_cdr_inc.php 2017-05-29 15:51:45 -06:00
FusionPBX e8d3d7a64a Update xml_cdr_inc.php 2017-05-29 10:56:28 -06:00
FusionPBX 0920e72a23 Update xml_cdr_inc.php 2017-04-08 15:17:52 -06:00