Commit Graph

38 Commits

Author SHA1 Message Date
frytimo d7bbcd89f5
Use magic constant dir (#6711)
* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__ to load only functions.php

* replace spaces with tab character

* update dirname command to use levels instead of nesting

* use magic constant __DIR__

* update dirname command to use levels instead of nesting

* Update access_control_edit.php

* Update access_control_import.php

* Update access_controls.php

* Update dnd.php

* Update access_controls_reload.php

* Update call_center_agents.php

* Update call_center_agents.php

* Update fax_queue.php

* Update login.php

* Update pdo.php

* Update pdo_vm.php

* Update switch.php

* Update index.php

* Update css.php

* Update v_mailto.php

* Update fax_to_email.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-06-15 11:28:23 -06:00
fusionate 3adeb15ace
CDR Statistics: Updates for PHP 8.1 2023-05-25 21:34:41 +00:00
frytimo 9dc8bcf7e9
Fix xml cdr for PHP 8.1 (#6692)
* fix multiple warnings

* fix multiple warnings

* ensure array key exists

* ensure array key exists

* assign boolean variable for showall in url

* change boolean to show_all instead of showall

* revert some changes. Create default leg value and mos_score

* validate page integer

* revert back to showall from get
2023-05-12 13:28:42 -06:00
frytimo fef8165be2
Frytimo pr patches for php8.1 (#6630)
* Passing null to parameter #2 ($string) of type string is deprecated

* Passing null to parameter #1 ($string) of type string is deprecated

* php 8.1 fixes

* php 8.1 fixes - replace strlen($var) > 0 with !empty($var)

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - strlower with null

* php 8.1 fixes - strreplace with null

* php 8.1 fixes - passing null to base64_decode

* php 8.1 fixes - check for false and check for null on $this->dir

* php 8.1 fixes - remove assignment of $db variable to modules object

* php 8.1 fixes - avoid sending null to substr

* php 8.1 fixes - change ${var} to {$var}

* php 8.1 fixes - check for null before preg_replace

* php 8.1 fixes - remove setting db variable on domains object

* php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null

* php 8.1 fixes - set empty string if $_REQUEST['show'] is not available

* php 8.1 fixes

* php 8.1 fixes - correct $_POST checking syntax

* php 8.1 fixes - correct $_POST variables

* php 8.1 fixes

* Use brackets consistently

* Update user_setting_edit.php

* Change to not empty

* Update device.php

* Update text.php

---------

Co-authored-by: Tim Fry <tim@voipstratus.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-05-05 10:46:37 -06:00
FusionPBX e91f78bafe
permission exists xml_cdr_domain false 2023-02-20 12:29:32 -07:00
FusionPBX d4458782b8
Change is_group to permission_exists
Use the xml_cdr_domain permission instead of is_group admin or superadmin.
Using the permission is more flexible.
2023-02-20 12:12:43 -07:00
FusionPBX cd517ea403
Show the latest 24 hours for CDR statistics 2023-02-18 17:28:15 -07:00
FusionPBX 712b1e7281
Update xml_cdr_statistics.php (#6557)
* Update xml_cdr_statistics.php

* Build the xml cdr statistics with a query
2023-02-16 22:09:00 -07:00
markjcrane d50bcb476a Replace root.php 2022-10-10 16:35:14 -06:00
agree b7e7d27c79
[xml_cdr] LOSE_RACE handled in wrong place (#6433)
LOSE_RACE is already being handled later `if (permission_exists('xml_cdr_lose_race'))`
2022-06-25 12:04:44 -06:00
agree f907619679
[xml_cdr] cdr statistics fix LOSE_RACE (#6432) 2022-06-25 12:04:23 -06:00
FusionPBX 4ab4fbbae9
Exclude LOSE_RACE for missed calls (#6338)
* Exclude LOSE_RACE for missed calls

* Update xml_cdr_inc.php
2022-04-07 10:05:54 -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 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
Nate 8ce40ea768 CDR, Advanced Search, Statistics - Button updates, minor adjustments. 2020-02-07 07:44:08 -07:00
FusionPBX cae9b1708c Update xml_cdr_statistics_inc.php 2019-12-24 14:34:26 -07:00
chansizzle 1ac40747a3 Update xml_cdr_statistics_inc.php (#4877)
* Update xml_cdr_statistics_inc.php

* Update xml_cdr_statistics_inc.php
2019-11-19 11:10:50 -07:00
Nate cc33248ac7 CDR: Database class integration. 2019-09-03 08:29:44 -06:00
FusionPBX 7bea8d07be Update xml_cdr_statistics_inc.php 2019-04-19 11:02:58 -06:00
Alexey Melnichuk d707c966fe Fix. Display statistic for all domains (showall=true) (#2915) 2017-11-20 13:58:35 -07:00
Alexey Melnichuk 9ccf44e059 Add. Display both CPM for all calls and for answered only. (#2707) 2017-06-22 09:04:44 -06:00
Alexey Melnichuk 74454b738f Update CDR Stats application. (#2704)
* Update CDR Stats application.

Fix. Number of calls always calculate only for all domain.
Fix. Number of missed calls ignores any search parameters and use only `inbound` filter.
Fix. Calls duration for days use only domain filter and do not use any other filters.
Add. Limit setting for number of hours to calculate statistic.
Add. When timestamp set then calculate statistic only for this period.

* Fix. Calculate `Calls per minute`
Fix. Prevent divide `0/0` when calculate `ALOC`

* Fix. `Hours` have to be integer type.
2017-06-21 08:20:29 -06:00
Alexey Melnichuk d093b37c22 Add. Statistics takes account to leg. (#2653)
Add. Leg field to advanced search form.
2017-06-08 09:45:27 -06:00
FusionPBX f94a3caef0 Update xml_cdr_statistics_inc.php 2017-03-21 22:51:06 -06:00
Harry G. Coin 8abe003a71 The goal is to increase confidence in fusionpbx, one step is to run by default with error_reporting (E_ALL ^ E_NOTICE);
So, please find in this set numerous small changes which eliminate numerous php warning messages.

Also, a small bug fix in an sql statistics routine, naming a count(*) field as count, so displaying correct detail.

If any of the proposed changes are omitted, the relevant page will experience php warnings.

There are no doubt fusionpbx pages I've yet to visit that still generate warnings, this set is nearly certainly not comprehensive.
2016-04-25 20:19:58 -05:00
mafoo 4131926b86 WhitespaceClean-app/xml_cdr
whitespace pass over files
for reference regex that was used s/[ \t]+(\r?\n)/\1/
2016-03-11 11:54:18 +00:00
blackc2004 034d6b05c9 remove print 2015-12-10 11:10:32 -08:00
blackc2004 0a08484546 CDR Stats Add ADV Search options request 1173
CDR Stats Add ADV Search options request 1173
2015-12-10 11:06:42 -08:00
blackc2004 1d986f1b85 test 2015-12-09 14:44:22 -08:00
Nate Jones 63aba24bc7 CDR Stats: Added missing 'and' in SQL queries. 2015-04-05 02:26:31 +00:00
Mark Crane 5dd8efb071 Fix the CDR statistics show all. 2015-03-07 12:39:42 +00:00
Mark Crane 669fb08d4e Add show all code donated by Chris Black 2015-03-06 17:15:09 +00:00
Mark Crane c44d39dcf9 Change the path for includes/require.php to the resources directory. 2013-07-06 06:03:27 +00:00
Mark Crane 6a70d8db41 Change includes/checkauth.php to resources/check_auth.php. 2013-07-06 05:50:55 +00:00
Mark Crane f3581a860e Add missed calls to CDR and CDR statistics. 2013-01-17 18:32:16 +00:00
Mark Crane 0a6f879c58 Add hours, start_stamp, and stop_stamp to the cdr statistics csv file. 2012-12-22 00:45:06 +00:00
Mark Crane af103e9c41 Add a missing file sip_profile_copy.php to the dev branch. 2012-06-04 14:58:40 +00:00