From ee3ae4b7c2a5a8a4f66f47222239d83e92a54753 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 1 Jun 2016 16:45:50 -0600 Subject: [PATCH] If last_sent_callee_id_number is set use it as the destination_number. --- app/xml_cdr/resources/classes/xml_cdr.php | 5 +++++ app/xml_cdr/v_xml_cdr_import.php | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 9d8680424f..b28301a68a 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -232,6 +232,11 @@ if (!class_exists('xml_cdr')) { $destination_number = urldecode($xml->variables->sip_to_user); } + //if last_sent_callee_id_number is set use it for the destination_number + if (strlen($xml->variables->last_sent_callee_id_number) > 0) { + $destination_number = urldecode($xml->variables->last_sent_callee_id_number); + } + //get the caller id $caller_id_name = urldecode($xml->variables->effective_caller_id_name); $caller_id_number = urldecode($xml->variables->effective_caller_id_number); diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 5a047c513c..3792c44c14 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -173,6 +173,11 @@ } unset($x); + //if last_sent_callee_id_number is set use it for the destination_number + if (strlen($xml->variables->last_sent_callee_id_number) > 0) { + $database->fields['destination_number'] = urldecode($xml->variables->last_sent_callee_id_number); + } + //store the call leg $database->fields['leg'] = $leg; @@ -269,7 +274,7 @@ $db2->sql = $sql_rate; $db2->result = $db2->execute(); -// print_r($db2->result); + //print_r($db2->result); $lcr_currency = (strlen($db2->result[0]['currency'])?check_str($db2->result[0]['currency']): (strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD') );