Commit Graph

759 Commits

Author SHA1 Message Date
FusionPBX bcd7482e5c
Use elseif instead of a series of if statements. 2021-06-15 13:44:14 -06:00
FusionPBX 6d536ce4d7
Add more to the missed call check
Only count as a missed call if the bridge_uuid has a length.
2021-06-15 12:53:46 -06:00
FusionPBX 3e2ae03295
Count a going to voicemail as a missed call. 2021-06-15 12:20:04 -06:00
markjcrane af3610d986 Add CIDR option to HTTP POST 2021-05-26 20:41:26 -06:00
markjcrane 2750475ab2 Add better logging to XML CDR 2021-05-26 14:29:46 -06:00
FusionPBX 764a46458e
Update xml_cdr_import.php 2021-05-26 10:53:50 -06:00
Andrew Querol b67d55b39c
Replace duplicated v_xml_cdr_import.php with a call to the post method of xml_cdr (#5956)
* Redirect duplicated xml_cdr_import script

This replaces the duplicated code in v_xml_cdr_import.php with xml_cdr_import.php

This also adds a call to `$cdr->post();` in that file to then process the POSTed data from FreeSWITCH
2021-05-26 09:54:08 -06:00
demonspork 7133f35af5
Use epoch times for CDR Imports (#5955)
* Use epoch times for CDR Imports

There has been some discussion of edge cases for CDR Importing time zones/time stamps.

This modification makes the start_stamp, answer_stamp, and end_stamp values use the corresponding _epoch times for import into the v_xml_cdr table to remove any chance of time zone mis-alignment.

* Set Call recording date with Epoch

Use the start_epoch to set the call recording date.
2021-05-26 09:11:09 -06:00
FusionPBX b2e0402478
Get the call_center_queue_uuid from the channel variables. 2021-05-21 13:16:18 -06:00
FusionPBX a7efbe178f
Merge pull request #5952 from greenbea/patch-40
[cdr] Add call stats to cdr details
2021-05-21 09:05:02 -06:00
agree aef22cd47f remove unnecessary line 2021-05-21 01:02:34 -04:00
agree 0fc6915a7a [cdr] Add call stats to cdr details 2021-05-21 00:55:42 -04:00
FusionPBX 21ab598390
Merge pull request #5935 from greenbea/upstream/patch-39
[call_center] export call_center_queue_uuid channel variable to agent legs for cdr import
2021-05-10 12:29:55 -06:00
FusionPBX 10ca93cbc0
Add timestamptz and timezone to the extension summary. 2021-05-10 11:34:47 -06:00
FusionPBX 755f5aaf66
Use the database for formatted date and time. 2021-05-10 11:30:22 -06:00
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
agree d7d7c6c678
remove reference 2021-05-09 16:07:17 -04:00
agree 06062b7fba * export call_center_queue_uuid channel variable to agent legs for cdr import
* add call_center_queue_uuid field to cdr for referenceing the call center queue table (cc_queue is a freeswitch variable for  the queue name)
2021-05-09 15:52:42 -04:00
markjcrane 884720489f Use the cc_queue to get the call_center_queue_uuid 2021-05-07 22:21:08 -06:00
markjcrane 8bd751f1c9 Use the cc_queue to get the call_center_queue_uuid 2021-05-07 22:04:38 -06:00
markjcrane e09a97f013 Add { and } brackets for each $field 2021-05-07 19:08:11 -06:00
markjcrane 9cfd41d222 Update CDR imports fix syntax 2021-05-07 16:06:03 -06:00
markjcrane cfd70fb18f Use the queue uuid for the cc_queue 2021-05-06 23:23:07 -06:00
markjcrane 014cbd1cd0 Replace data type timestamp with timestamptz 2021-05-05 20:46:53 -06:00
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