Commit Graph

191 Commits

Author SHA1 Message Date
FusionPBX 755f5aaf66
Use the database for formatted date and time. 2021-05-10 11:30:22 -06:00
emaktech a0ab52d369
CDR - Don't Check Filesystem for Recording on Load
I have been debugging slow loading on our CDR pages for the last few days now.

One issue that we have encountered is that currently as the page loads, it checks the filesystem for each file one at a time. In our case, we move recordings to object storage after 1 week, so each time we check for a file it passes api calls which take over 1 second each to return a result. This causes this page to not load at all for us in many cases.

Regardless, this current method is unnecessarily I/O intensive and really page load is probably not the time to be checking for each file one by one.

So this PR is the simplest solution - remove the check entirely. I would contend that the administrator should remove the record_path from the database if the file was removed so this should be acceptable.

This solves this particular issue for us, but would need feedback from others if not checking for files makes sense.
2021-03-03 15:48:17 -05: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 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 56a318b2f0 Fix TTA display bug
If the TTA is 0 because the call was answered in less than a second (so that the answer_epoch and start_epoch are in the same second), it would not display the TTA at all. This is safe to include 0 because "unanswered" calls are going to have a TTA that is is the negative value of the start time, significantly lower than 0.
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
FusionPBX 9788b7b99f
Add xml_cdr_export_csv and xml_cdr_export_pdf permission checks. 2021-01-17 23:55:23 -07:00
agree 33b206c6a7
Update xml_cdr.php 2021-01-13 13:12:23 -05: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
FusionPBX 89bc913d97
Add permission_exists xml_cdr_export 2020-09-16 15:47:12 -06:00
FusionPBX 88846e822c
Update xml_cdr.php 2020-04-28 12:00:07 -06:00
FusionPBX 81f665c65a
Update xml_cdr.php 2020-04-17 12:06:50 -06:00
Luis Daniel Lucio Quiroz 4af2120e42
[4.5] REQUESTED_CHAN_UNAVAIL option in xml cdr (#5216)
just another option for searching calls
2020-03-27 15:36:08 -06:00
Nate d7824ab5a8 CDR: Modal integration. 2020-03-26 16:36:36 -06:00
FusionPBX 827e9d7faa Update xml_cdr.php 2020-03-05 16:24:20 -07:00
Nate e8494facee Multiple: Add IDs to form tags, remove empty action attributes. 2020-03-05 10:02:25 -07:00
Nate 029c7174b4 Multiple - Add IDs to common/default action buttons. 2020-03-05 00:05:45 -07:00
Nate dbdfafcfd8 CDR & Archive: Merge and simplify, integrating some features of CDR into Archive. 2020-02-11 10:44:00 -07:00
Nate e0ea637184 CDR: Remove duplicate hidden input for show all. 2020-02-07 08:41:13 -07:00
Nate 8ce40ea768 CDR, Advanced Search, Statistics - Button updates, minor adjustments. 2020-02-07 07:44:08 -07:00
FusionPBX 3f019e7855 Update xml_cdr.php 2020-01-31 21:09:41 -07:00
FusionPBX 492e88592f Update xml_cdr.php 2020-01-28 18:43:04 -07:00
Nate 3ca46887d9 CDR: Only allow user to select assigned extensions when xml_cdr_search_extensions permission is assigned but xml_cdr_domain permission not assigned. 2020-01-23 07:05:01 -07:00
Nate 983ec065b1 CDR: Add window titles. 2020-01-06 10:56:27 -07:00
FusionPBX bd593532ad Update xml_cdr.php 2019-12-24 14:29:17 -07:00
Nate aa593c03fc List Views: Minor adjustments to code. 2019-11-30 14:18:00 -07:00
Nate bfb17507f1 List Views: Simplify action handling. 2019-11-30 11:12:41 -07:00
Nate 2a0a1d1e12 Email Logs, CDR: Minor adjustments. 2019-11-27 11:00:16 -07:00
Nate 02b35a7a99 Device: List view updates. 2019-11-07 09:00:29 -07:00
chansizzle f7a2fba9c2 Update xml_cdr.php (#4831) 2019-11-05 11:21:38 -07:00
agree 6ebd3d5796 Update xml_cdr.php (#4816) 2019-10-31 23:42:29 -06:00
Nate e8c77ddbef CDR: Minor adjustment to columns. 2019-10-26 09:24:09 -06:00
Nate 94994315fa CDR: Center Date and Time column headings. 2019-10-25 19:00:19 -06:00
Nate 97538888a0 CDR: Center Date/Time column headings. 2019-10-25 18:55:50 -06:00
Nate 756367bfa5 CDR adjustments. 2019-10-24 20:18:20 -06:00
Nate ff70a88efa CDR adjustment 2019-10-24 18:29:54 -06:00
Nate 8dd1e426f0 Misc CDR/other adjustments. 2019-10-24 18:27:48 -06:00
Nate f0347b5214 Action Bar mods. 2019-10-24 16:31:14 -06:00
Nate 6879195ae2 Action Bar mods. 2019-10-24 16:28:09 -06:00
Nate ea536d2f6e Button class updates, logic updates to other files. 2019-10-23 21:19:37 -06:00
FusionPBX 679c78d269 Update xml_cdr.php 2019-10-22 10:06:24 -06:00
FusionPBX 31180e7afb Update xml_cdr.php 2019-10-22 09:53:36 -06:00
Nate b3acbdc7e4 Update theme/template. 2019-10-22 01:57:20 -06:00
Nate 0ebddaf2fa CDR: List view updates. 2019-10-22 01:43:55 -06:00
FusionPBX 1477526fd1 Update xml_cdr.php 2019-10-04 13:16:21 -06:00
Nate b480ffb9c3 Update xml_cdr.php 2019-10-02 16:00:01 -06:00
Nate 8044a851eb CDR: Permissions to control data columns displayed. 2019-10-02 15:41:49 -06:00
Nate 489362a002 CDR: Responsive search form, add permissions to control search field visibility. 2019-10-02 14:01:27 -06:00
Nate bb97f65b3f CDR: Additional search fields. 2019-09-28 19:13:01 -06:00
Nate 46a6461630 CDR: Move column sort to select box in search form. 2019-09-26 08:27:13 -06:00