Commit Graph

735 Commits

Author SHA1 Message Date
agree 69e892e790 [callcenter] Add ability for callcenter presence
* Freeswitch requires callcenters to have queue_name@domain for presence to work
2021-04-22 18:51:25 -04: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 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 92dc62a7b4 Fix TTA display bug in Export CDR PDF
Same thing as in the xml_cdr.php page display. If the call is answered instantly, less than a second, then the difference is 0s, and the 0s is a visual indicator that the call was answered, it just took less than a second. Calls that didn't get answered have a large negative number stored in the TTA field, 0 is an answered call.
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 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 ef38b15cdc Add new missed call rules to HTTP CDR Imports
Add new missed call rules to HTTP CDR Imports. They had only been added to the xml_cdr class used by the file import.
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
demonspork 202bc7363e Fixed "Missed" link and exclude LOSE_RACE from CDR stats
Simple change to exclude lose_race and fix a URL change for the xml_cdr page.
2021-02-16 21:21:59 -06:00
agree ee1ca8a507
fix comparison operator 2021-02-09 14:18:21 -05:00
FusionPBX 0bc3b4cf57
Merge pull request #5714 from emaktech/patch-11
French language update
2021-01-26 08:38:56 -07:00
agree 08f5c1631c
Add missing variable 2021-01-23 23:53:36 -05:00
agree 9c9507e2e3
Fix xml_cdr_details fix application log
When there's a single app in the app log it's saved as an single object in the json not as an array of objects
2021-01-23 23:47:53 -05:00
FusionPBX 246ffb3e12
Add a permission check for xml_cdr_export_csv and xml_cdr_export_pdf to the CDR export. 2021-01-18 00:00:18 -07:00
FusionPBX 1b2812976d
Add xml_cdr_export_csv and xml_cdr_export_pdf permissions to app_config.php. 2021-01-17 23:56:45 -07:00
FusionPBX 9788b7b99f
Add xml_cdr_export_csv and xml_cdr_export_pdf permission checks. 2021-01-17 23:55:23 -07:00
agree 5778f71663
Update app_config.php 2021-01-13 13:13:11 -05: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
emaktech d61388b3ee
Update app_languages.php
French language update
2021-01-06 16:20:26 -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
FusionPBX fa835103e3
Use isset instead of strlen. 2020-12-21 11:13:55 -07:00
agree 60ed198a2e
CDR Import fix missing sql parameter 2020-12-15 12:42:47 -05:00
FusionPBX c314f4352a
Minor change add a little better description. 2020-12-10 20:20:51 -07:00
FusionPBX d5016a107b
Delete xml_cdr_import_update.php 2020-12-10 20:19:54 -07:00
FusionPBX 53cbf8c9b4
Fix a situation where call recording was not showing up in Call Detail Records.
Make sure the record_path is set to the default path if that value doesn't exist in the xml.
2020-12-10 20:03:53 -07: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
fusionate da069651f4 CDR: Grant xml_cdr_domain permission to admin group by default. 2020-12-02 13:37:49 -07:00
FusionPBX 08de8d1f81
Remove code that caused an error. 2020-10-07 13:48:17 -06:00
Nate 41501eee61 CDR: Mitigate warnings if no extensions assigned to user. 2020-09-29 13:56:10 -06:00
agree aabd4059be
cdr add call flow summary (#5454) 2020-09-23 10:29:13 -06:00
agree 9fc63d2643
Fix call direction (#5456) 2020-09-23 10:27:02 -06:00
agree ca313c9d34
Update xml_cdr_details.php (#5455) 2020-09-23 10:25:55 -06:00
agree 4670a50fb0
xml cdr details format duration (#5457) 2020-09-18 12:34:22 -06:00
FusionPBX 95d3684cd1
Make the export page use the new xml_cdr_export permission. 2020-09-16 15:48:43 -06:00
FusionPBX b9c6f56554
Add new permission xml_cdr_export. 2020-09-16 15:47:48 -06:00
FusionPBX 89bc913d97
Add permission_exists xml_cdr_export 2020-09-16 15:47:12 -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 1abd1f1670
Change prefix from tmp_ to start_ as the variable is based on the start date. 2020-08-11 10:39:27 -06:00
agree e2498a81de
fix extension summary date selection (#5358) 2020-07-16 09:54:10 -06:00
agree b0b788427e
remove CDR Statistics from default menu for users (#5347)
* Remove CDR stattistics from user group menu

users don't have CDR statistics vier permission no need to have it in the menu

* remove status from user group menu

No need to have it in the default menu for the user group
2020-07-13 12:46:57 -06:00
FusionPBX 0d2e62bc9b
Add answered to the extension summary 2020-07-07 22:13:28 -06:00
FusionPBX fa7bb2a781
Add direction inbound for call center calls and update missed_calls. 2020-07-02 18:02:19 -06:00
FusionPBX e1f428db59
Add direction inbound for call center calls and update missed_calls. 2020-07-02 18:01:59 -06:00
FusionPBX 2d5745c283
Adjust the key string to match the value. 2020-07-02 16:48:07 -06:00
FusionPBX 0a3d809556
Add cc values to the altnernate import. 2020-07-02 16:27:54 -06:00