Commit Graph

105 Commits

Author SHA1 Message Date
FusionPBX 49cf078c5c
XML CDR add timestamptz and timezone
- If the server time is set to UTC then the search needs to account for the local time zone.
- Use the database to format the date in the most efficient way.
2021-05-10 11:28:22 -06:00
demonspork c11589b1c3 Track Voicemail Message Success/Failure in CDR
Track whether or not a message was actually left in the voicemail box. Previously we only knew that voicemail answered, now we know whether the caller left a message.
Callers who didn't leave a message now show up in the "Cancelled" call filter in xml_cdr.php

Bonus: Fixed a bug with the originating_leg_uuid that was breaking extension summary from a previous commit and some other minor bugs/typos.
2021-02-21 21:09:37 -06:00
demonspork 0ef2551698 Exclude cc_side agent legs from missed_call
Excluded cc_side = agent calls from being marked as missed_call = true

Fixed the previous performance issue with adding the cc_side != 'agent' to the SQL and removed its filter from the rendering loop for the xml_cdr.
2021-02-21 18:26:24 -06:00
demonspork b5272984d1 Don't filter LOSE_RACE of already filtering originating_leg_uuid
It is redundant to filter out LOSE_RACE when originating_leg_uuid is also filtered, there is an overlap where every call with LOSE_RACE also has an originating_leg.
2021-02-20 11:51:24 -06:00
demonspork 77974b71dc Fix Query performance for cc_side agent
For some unexplained reason, including the `"and cc_side != 'agent'` in the WHERE tanks the query performance from seconds to minutes on Postgres 9.4. It runs great on Postgresql 13. Reverting to the "blank content while writing the page content" approach for this value unless I can find the source of the problem. - Oh, also removed an unnecessary condition that prevents you from filtering by LOSE_RACE.
2021-02-20 11:51:24 -06:00
demonspork d150f16b9d Fixed "Failed" call status in CDR
Re-implemented the commented out "Failed" call status SQL filter. It was no different than leaving the "Call status" search box empty. Removed the send_refuse restriction.
2021-02-20 11:51:24 -06:00
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