Commit Graph

135 Commits

Author SHA1 Message Date
frytimo d529021b3f
Use boolean setting as true boolean (#7284)
* use boolean setting as true boolean

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.
2025-03-04 11:25:47 -07:00
Antonio Fernandez fab9a6bbc9
Ring Group search in CDR (#7177)
* Adding Ring Group dropdown in cdr search

* 2nd commit

* remove unused permission
2024-11-01 10:06:23 -06:00
FusionPBX 0d747ae3d6
Fix permisisons for call detail records export 2024-08-29 11:35:05 -06:00
FusionPBX 0044f0b69e
Update permissions handling for performance
- For pages using large number of permission like these
- Creating a permission array that is populated with permission_exists
- Then using the permission array is more efficient
2024-08-08 16:17:28 -06:00
frytimo 7630056bb8
Remove the unset($database) statements (#7084)
* Remove the unset($database) statements
The database object is a global variable that contains a database object reference and should not be unset.

* Update event_guard.php

* Update event_guard.php

* Update event_guard.php

---------

Co-authored-by: Tim Fry <tim@fusionpbx.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
2024-08-06 13:19:45 -06:00
FusionPBX 5672944a5d
Add the extension name to CDR 2024-05-23 14:31:56 -06:00
frytimo 2264e2c0ed
Add read and write codec to columns displayed (#6913)
* add read and write codec to columns displayed

* update the column display name to be Codecs
2024-03-16 10:56:28 -06:00
Alex 7436d8e651
Update xml_cdr_inc.php (#6903) 2024-02-22 15:54:18 -07:00
FusionPBX 76bcd70824
Use the domain time_format 12h or 24h 2024-02-20 13:57:29 -07:00
FusionPBX 4ebdcdf4b2
Update CDR new call center search 2024-01-13 17:07:11 -07:00
Antonio Fernandez 69fc0c8378
Added CDR dropdown for showing CC Queue calls (#6869)
* Added dropdown for filtering Call Center Queues

* added more translations

* fixed the wrong permission that I had originally

* added the  Call Center dropdown to advanced search
2024-01-13 14:14:51 -07:00
FusionPBX c44d1825cf
Add cc_side and call_center_queue_uuid 2024-01-12 13:57:48 -07:00
fusionate ae5cb03547
CDR: Add permission for Account Code inclusion. 2024-01-10 21:34:53 +00:00
FusionPBX d7e2ab900b
Call Detail Record add status and use billsec for the duration 2023-10-24 15:58:13 -06:00
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
Alex 22a01b147d
Fixed call center queue agents table (#6746)
* Update destination_edit.php

* Fixed php 8.1 errors

* Fixed cdr recording download not working

* Update call_center_queue_edit.php

* Update call_center_queue_edit.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-06-06 11:31:22 -06:00
fusionate 69900445b5
CDR: Updates for PHP 8.1 2023-06-01 22:55:19 +00:00
Luis Daniel Lucio Quiroz 3f544496b7
DB and protection (#6696)
so this small change has 2 purposes.
first, I found the hard way, that PHP PDO is not always coded with the same criteria between versions and databases.  While PDO PGSQL on PHP 8.x may work, PDO SQLITE on PHP 7.4 may not and so on.. This will make sure that the value there is an integer.

Second, since these two values are taken from the _GET, which is in the URL string, it will protect against "imaginative" users.
2023-05-16 13:05:07 -06:00
markjcrane 155f15a407 Fix CDR paging and minor code changes 2023-05-16 10:07:32 -06:00
FusionPBX 590faa4e83
Set the export_format
To prevent null and prevent unintended behavior set an empty string to as the default export format.
2023-05-12 14:30:16 -06: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 95dd6094e0
Removing this because it breaks Missed Call results
Missed calls should include hangup_cause NO_ANSWER
2022-10-24 15:27:41 -06:00
markjcrane d50bcb476a Replace root.php 2022-10-10 16:35:14 -06:00
FusionPBX 0a45b7acf1
Don't show these by default.
Permissions are there to show these however its is expected that these permissions will be assigned to a group rarely.
Considering removing the permissions and not import the records.
2022-08-05 11:30:57 -06:00
FusionPBX d5e7552fb4
Hide not answered calls Ring Group Destinations that were answered by someone else.
Improve the form
2022-08-05 11:15:09 -06:00
FusionPBX 74d034d7a9
Work on missed_call field. 2022-08-04 18:37:14 -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
FusionPBX 4066d868e3
Add flexible search with improved wildcard support. 2021-08-30 19:10:31 -06:00
FusionPBX 287869d71f
Add sip_call_id to the xml cdr SQL select. 2021-07-31 19:28:59 -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
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