From 06062b7fba065c26ceb9c06c8bdcf54d4403bc82 Mon Sep 17 00:00:00 2001 From: agree Date: Sun, 9 May 2021 15:52:42 -0400 Subject: [PATCH 1/2] * 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) --- app/call_centers/call_center_queue_edit.php | 1 + app/xml_cdr/app_config.php | 6 ++++++ app/xml_cdr/resources/classes/xml_cdr.php | 18 +++--------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 60640b2014..f78ef8f5fb 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -337,6 +337,7 @@ if (is_numeric($queue_extension)) { $dialplan_xml .= " \n"; } + $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; if ($queue_time_base_score_sec != '') { $dialplan_xml .= " \n"; diff --git a/app/xml_cdr/app_config.php b/app/xml_cdr/app_config.php index dc51e1ab47..2f2fb6faf8 100644 --- a/app/xml_cdr/app_config.php +++ b/app/xml_cdr/app_config.php @@ -576,6 +576,12 @@ $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_queue_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_call_centers"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "call_center_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Queue uuid"; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "cc_side"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Queue side is either member or agent"; diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 9e415cedc7..5228f43cac 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -151,6 +151,7 @@ if (!class_exists('xml_cdr')) { $this->fields[] = "last_app"; $this->fields[] = "last_arg"; $this->fields[] = "voicemail_message"; + $this->fields[] = "call_center_queue_uuid"; $this->fields[] = "cc_side"; $this->fields[] = "cc_member_uuid"; $this->fields[] = "cc_queue_joined_epoch"; @@ -387,21 +388,8 @@ if (!class_exists('xml_cdr')) { if (urldecode($xml->variables->cc_side) == 'agent') { $this->array[$key]['direction'] = 'inbound'; } - if (strlen($xml->variables->cc_queue) > 0) { - $cc_queue = urldecode($xml->variables->cc_queue); - $cc_queue_array = explode('@', $cc_queue); - $cc_queue_extension = $cc_queue_array[0]; - if (is_numeric($cc_queue_extension)) { - $sql = "select call_center_queue_uuid from v_call_center_queues "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and queue_extension = :queue_extension "; - $parameters['domain_uuid'] = urldecode($xml->variables->domain_uuid); - $parameters['queue_extension'] = $cc_queue_extension; - $database = new database; - $this->array[$key]['cc_queue'] = $database->select($sql, $parameters, 'column'); - unset($parameters); - } - } + $this->array[$key]['cc_queue'] = urldecode($xml->variables->cc_queue); + $this->array[$key]['call_center_queue_uuid'] = urldecode($xml->variables->call_center_queue_uuid); //app info $this->array[$key]['last_app'] = urldecode($xml->variables->last_app); From d7d7c6c6788f07c57215639542c1a830539129d6 Mon Sep 17 00:00:00 2001 From: agree <37550360+greenbea@users.noreply.github.com> Date: Sun, 9 May 2021 16:07:17 -0400 Subject: [PATCH 2/2] remove reference --- app/xml_cdr/app_config.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/xml_cdr/app_config.php b/app/xml_cdr/app_config.php index 2f2fb6faf8..2779af87cf 100644 --- a/app/xml_cdr/app_config.php +++ b/app/xml_cdr/app_config.php @@ -578,8 +578,6 @@ $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_queue_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_call_centers"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "call_center_uuid"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Queue uuid"; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "cc_side";