Commit Graph

231 Commits

Author SHA1 Message Date
FusionPBX 3336e1420a
If caller_destination is not set use dialed_user 2022-03-15 14:50:28 -06:00
FusionPBX af994de554
Set caller_id_number using sip_from_user if the variable is not set. 2022-03-15 14:43:55 -06:00
FusionPBX 76a4e9dd50
Work on caller_destination, caller_id_name and caller_id_number. 2022-03-15 14:33:44 -06:00
FusionPBX fac8ee8244
Hide Extension Summary Show all by default. (#6318)
* Hide Extension Summary button show all by default. Add new permission xml_cdr_extension_summary_all

Many extensions and CDR records make this a resource very intensive query. Disable by default for all groups.

* Add new permission xml_cdr_extension_summary_all

* Update xml_cdr_extension_summary.php

* Update xml_cdr.php
2022-02-24 01:53:54 -07:00
FusionPBX ba2f5c379f
Only compare sip_from_domain with domain_name if the sip_from_domain exists. 2022-01-18 12:05:32 -07:00
FusionPBX e16cc5e725
Need to keep the caller ID prefix on the caller ID name.
This was needed to keep caller id prefix for the caller ID name so it shows up in the Call Detail Records.
2022-01-18 11:52:26 -07:00
FusionPBX 9d01324da7
Use sip_from_display and sip_from_user when the call originated from the VoIP Provider.
When an inbound call is forwarded the call_direction is set to inbound and then updated to outbound. In this situation we use the sip_from_display and sip_from_user to get the original caller ID instead of the updated caller ID after the call was forwarded.
2022-01-04 17:50:51 -07:00
FusionPBX 1f0af43d83
Use the date c function only if the the epoch is_numeric 2022-01-04 16:54:47 -07:00
FusionPBX dd106a6871
Replace event_socket_mkdir with php mkdir. (#6170) 2021-12-02 19:03:55 -07:00
FusionPBX 2d4c65abee
Simplify missed call handling. 2021-11-19 15:47:54 -07:00
FusionPBX 80cfab92b8
Use answer_stamp and bridge_uuid to deteremine if the call was answered. 2021-11-19 11:11:40 -07:00
FusionPBX 4da962e4e0
Add sip_call_id to the xml cdr import.
The sip_call_id is the Call-ID found in the SIP headers.
2021-07-31 19:25:23 -06:00
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 2750475ab2 Add better logging to XML CDR 2021-05-26 14:29:46 -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 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
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 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
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
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 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 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 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
FusionPBX 08de8d1f81
Remove code that caused an error. 2020-10-07 13:48:17 -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
FusionPBX fa7bb2a781
Add direction inbound for call center calls and update missed_calls. 2020-07-02 18:02:19 -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
FusionPBX 87a7073889
If you don't have xml_cdr_lose_race permission then hide the call. 2020-06-01 16:13:40 -06:00
FusionPBX 314a217d56
Update xml_cdr.php 2020-05-05 21:32:33 -06:00
FusionPBX b261c7e6d5
Update xml_cdr.php 2020-04-28 16:11:06 -06:00
FusionPBX 4c34f3d4be
Update xml_cdr.php 2020-04-17 12:53:50 -06:00
FusionPBX 311e647783
Update xml_cdr.php 2020-04-06 16:11:31 -06:00
Nate 365e20926f Safari Audio Support: Call Recordings, MOH, VM Greetings & Messages and CDR audio files. 2020-03-30 20:08:45 -06:00
FusionPBX c1b80ade27 Update xml_cdr.php 2020-03-10 10:43:58 -06:00
FusionPBX 4bc1512fec Update xml_cdr.php 2020-02-19 12:56:16 -07:00
Nate 82367a5137 CDR: Remove domain_uuid from delete() method. 2020-02-12 14:14:16 -07:00
FusionPBX a2b135809f Update xml_cdr.php 2020-02-02 12:50:34 -07:00
FusionPBX c00563efd8 Update xml_cdr.php 2020-01-31 21:28:29 -07:00
FusionPBX 729c06cb25 Update xml_cdr.php 2020-01-31 17:17:55 -07:00
FusionPBX 2185780bef Update xml_cdr.php 2019-12-23 11:20:43 -07:00
Nate 0ebddaf2fa CDR: List view updates. 2019-10-22 01:43:55 -06:00
FusionPBX dd7279b6e4 Update xml_cdr.php 2019-10-07 23:49:24 -06:00
FusionPBX a9e60d0fb8 Update xml_cdr.php 2019-10-07 15:44:05 -06:00
FusionPBX 64158012a2 Update xml_cdr.php 2019-10-07 15:32:23 -06:00
FusionPBX 05dc333ef6 Update xml_cdr.php 2019-10-07 15:28:05 -06:00
FusionPBX 25f3ff2051 Update xml_cdr.php 2019-09-16 08:00:30 -06:00
Nate fe1493fcb5 Update xml_cdr.php 2019-09-16 04:13:03 -06:00
FusionPBX fca9b7d848 Update xml_cdr.php 2019-09-13 00:36:24 -06:00
FusionPBX 76e1f2fa06 Update xml_cdr.php 2019-09-13 00:11:37 -06:00
FusionPBX 304eba3601 Update xml_cdr.php 2019-09-12 18:28:34 -06:00
Nate 0618d4eada Extension Summary: Fix Start & End Date/Time search. 2019-09-11 17:12:01 -06:00
FusionPBX c2027ab6bb Update xml_cdr.php 2019-09-06 11:04:17 -06:00
FusionPBX 50d7e33fbd Update xml_cdr.php 2019-09-03 23:41:04 -06:00
FusionPBX bfc548b5ce Update xml_cdr.php 2019-09-03 23:25:58 -06:00
FusionPBX 811b53fd47 Update xml_cdr.php 2019-09-03 23:01:19 -06:00
FusionPBX 39cf5583bb Update xml_cdr.php 2019-09-03 14:32:33 -06:00
konradSC d0bc9034a1 Check for null uuid's (#4402)
Null UUID's are not very kind. They will sneak into your CDR's when you aren't looking and break an otherwise very nice database INSERT statement. We cannot tolerate that sort of behavior.
2019-07-31 16:00:20 -06:00
Luis Daniel Lucio Quiroz 186d7981a2 [4.5] fixes null record_name and record_path fields in v_xml_cdr (#4053)
* record_name verification

* record_name better verification

when you carry on some updates from 4.0 to 4.2 and then 4.4, old dialplans do not create all the variables, record_session is created, but record_name (and record_path) are not null, set and lenght zero,  "" in otherwords.

Then, in the db record, record_name and record_path are empty, regardless if the recording file exists. Therefore, they are not shown in the CDR app.
This fixes this issue.
2019-04-20 17:05:40 -06:00
konradSC 7eafc693c4 Bug fix: No answer_stamp in CDR (#4049)
* Bug fix: No answer_stamp in CDR

Here's a fun little bug that took me a longer than it should have to figure out. When a person make a call and then cancels the request there is no "answer_stamp" written to the CDR. Because of this, v_call_recordings.call_recording_name gets imported as NULL. This causes all the canceled calls to show up in the Call Recordings app first in the list and with no date set.

* Update xml_cdr.php

* Update v_xml_cdr_import.php
2019-04-11 18:00:11 -06:00
FusionPBX ea63afcc02 Update xml_cdr.php 2019-03-17 00:55:09 -06:00
FusionPBX 0d98092c9c Update xml_cdr.php 2019-02-18 13:30:17 -07:00
FusionPBX 7b8eda9e49 Update xml_cdr.php 2018-11-23 08:03:36 -07:00
FusionPBX 6ca703693a Update xml_cdr.php 2018-11-21 16:07:02 -07:00
FusionPBX fabc145bd7 Update xml_cdr.php 2018-10-17 22:08:20 -06:00
FusionPBX 3bcd6b1f4f Update xml_cdr.php 2018-10-17 15:52:15 -06:00
Luis Daniel Lucio Quiroz 07a292b552 Same logic as v_xml_cdr_import.php (#3048) 2018-06-09 09:30:02 -06:00
FusionPBX ff363d921f Update xml_cdr.php 2018-02-05 13:32:40 -07:00
FusionPBX 20219c1735 Update xml_cdr.php 2018-01-29 17:25:40 -07:00
FusionPBX 73cd5b3443 Update xml_cdr.php 2018-01-09 11:11:03 -07:00
konradSC 0170979401 Update xml_cdr.php (#2942)
Add check for duplicate call records. Duplicate records will cause the entire db insert to fail. I have tested this with the /app/xml_cdr/xml_cdr_import.php method for cdr insertion.
2018-01-09 11:01:10 -07:00
Alexey Melnichuk 9ee2b71ce2 Fix. Extension summary for local calls (#2918) 2017-11-21 09:13:58 -07:00
konradSC ba0606c7ae Bug Fix - Match correct database column names (#2908)
call_recording_name & call_recording_path are the correct values.
2017-11-14 22:02:08 -07:00
konradSC f3f7c5ea40 More ways of adding recordings to CDR's (#2904)
This grabs a recording if started by bind_digit_action "*2" or by "nolocal:api_on_answer=uuid_record ${uuid} start ${recordings_dir}/${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.${record_ext}".
2017-11-08 09:51:53 -07:00
FusionPBX 35e069f3a8 Update xml_cdr.php 2017-11-05 11:32:05 -07:00
konradSC f6217c6e49 Bug fix for caller_destination populating CDR's (#2902) 2017-11-02 21:57:36 -06:00
FusionPBX 3c0ffc943d Update xml_cdr.php 2017-10-20 18:04:07 -06:00
FusionPBX 0ab3fcaff4 Update xml_cdr.php 2017-10-20 17:54:49 -06:00
FusionPBX d500708a92 Update xml_cdr.php 2017-10-20 16:55:19 -06:00
FusionPBX 6fca820102 Update xml_cdr.php 2017-10-15 14:26:06 -06:00
FusionPBX f4931adfe7 Update xml_cdr.php 2017-10-15 11:53:10 -06:00
FusionPBX 8bc2864b1e Update xml_cdr.php 2017-10-15 11:35:55 -06:00
FusionPBX 4a78d69aac Update xml_cdr.php 2017-10-05 12:52:08 -06:00
FusionPBX 7b75aed3d0 Update xml_cdr.php 2017-09-22 19:24:40 -06:00
FusionPBX a0a3c1c5ee Update xml_cdr.php 2017-09-22 19:04:18 -06:00
FusionPBX d36c4bbcbd Update xml_cdr.php 2017-09-14 17:27:38 -05:00
FusionPBX 132aa88275 Update xml_cdr.php 2017-09-11 01:27:37 -05:00
FusionPBX 958551c55b Update xml_cdr.php 2017-09-11 01:23:41 -05:00
FusionPBX 5130a1750e Update xml_cdr.php 2017-09-10 13:14:42 -06:00
FusionPBX 88ef151220 Update xml_cdr.php 2017-09-10 11:53:40 -06:00
FusionPBX af71ec5ca8 Update xml_cdr.php 2017-06-21 23:46:17 -06:00
FusionPBX b8e460a81c Update xml_cdr.php 2017-06-21 23:39:56 -06:00
Mafoo 7bdea2c30c dos2unix (#2682)
find . -name "*.php" | xargs dos2unix
2017-06-12 22:09:36 -07:00
FusionPBX 0deed74c56 Update xml_cdr.php 2017-05-29 15:54:39 -06:00
FusionPBX c3ab507841 Update xml_cdr.php
Capitalize the SQL, change tmp_cdr to an alias of c for CDR, and remove the spaces from the indentation.
2016-12-30 10:54:33 -07:00
Karolis Pabijanskas fcc1ff7af4 Fix xml_cdr_extension_summary.php speed issues (#2280) 2016-12-29 12:59:52 -07:00
FusionPBX e7a7d0086a Update xml_cdr.php 2016-12-22 21:14:22 -07:00
FusionPBX f4378f8c2d Update xml_cdr.php 2016-12-21 14:02:56 -07:00
FusionPBX d2b65acc3a Update xml_cdr.php 2016-11-23 05:24:33 -07:00
FusionPBX aef9abc28c Update xml_cdr.php 2016-10-25 18:06:34 -06:00
FusionPBX edf8117215 Update xml_cdr.php 2016-10-25 18:02:26 -06:00
markjcrane bd23c78670 Use FreeSWITCH to run mkdir so it inherits its own user and group permissions. 2016-06-28 15:18:40 -06:00
FusionPBX 5f1d64bd61 Update xml_cdr.php
Fix the order by number alias addition by grouping it with ( and ).
2016-06-15 11:48:53 -06:00
Alexey Melnichuk 97d6bd24d8 Fix. Display correct info for extensions with number-alias. (#1665) 2016-06-15 11:39:09 -06:00
FusionPBX 08ceeece82 Update xml_cdr.php
Update the xml cdr class to generate a complete extension / user summary array.
2016-06-14 22:44:34 -06:00
FusionPBX e9ce02147a Update xml_cdr.php
In the xml_cdr class change method xml_array from $row to $key. Key is more descriptive and should prevent bugs in the future.
2016-06-11 16:17:35 -06:00
FusionPBX c4532e782e Update xml_cdr.php
Use the class variables.
2016-06-05 21:53:28 -06:00
markjcrane 32e43d942f Remove the second quick_select variable that was accidently added. 2016-06-05 17:51:23 -06:00
markjcrane 01ae160e04 Adding user summary (extension summary) to the xml_cdr class. 2016-06-05 17:19:06 -06:00
markjcrane ee3ae4b7c2 If last_sent_callee_id_number is set use it as the destination_number. 2016-06-01 16:45:50 -06:00
Mafoo 71525c26b0 I got the permissions wrong (#1616)
it should have been in octal mod (leading 0)
also updated the fax application as it needs the stickygid too
2016-05-26 05:55:46 -06:00
Mafoo 86c4742347 Added sticky GID permissions (#1615) 2016-05-25 21:51:41 -06:00
markjcrane 8e01682c3c Fix a minor issue. 2016-05-11 18:42:30 -06:00
markjcrane e3792a33a6 Additional work on caller id name and number. 2016-05-11 18:37:01 -06:00
markjcrane e752e5fab7 Additional work on the destination_number on the new xml cdr import tool. 2016-05-11 17:58:43 -06:00
markjcrane 1833df9567 Fix the syntax to the last commit. 2016-05-11 17:05:06 -06:00
markjcrane e1f0c205c7 Add source_number and change the destination_number to the number sent to the carrier. 2016-05-11 16:23:42 -06:00
markjcrane 17620586c4 Add a new xml_cdr_import.php and add limit and filter options to the xml_cdr.php class. 2016-05-01 17:44:53 -06:00
markjcrane 61a0dfe9f7 Improve the xml cdr class. 2016-04-30 00:33:35 -06:00
markjcrane 37f725d6ab Update the xml_cdr php class to get it operational. 2016-04-27 23:51:53 -06:00
markjcrane 0a039eb7b5 Add a new xml_cdr php class. 2016-04-27 13:24:59 -06:00