diff --git a/app/dialplan/resources/xml/dialplan/320_vmain.xml b/app/dialplan/resources/xml/dialplan/320_vmain.xml index 8d5c728882..858e4cf158 100644 --- a/app/dialplan/resources/xml/dialplan/320_vmain.xml +++ b/app/dialplan/resources/xml/dialplan/320_vmain.xml @@ -1,6 +1,6 @@ - + diff --git a/app/dialplan/resources/xml/dialplan/330_vmain_user.xml b/app/dialplan/resources/xml/dialplan/330_vmain_user.xml index be6a457345..cdf328ede8 100644 --- a/app/dialplan/resources/xml/dialplan/330_vmain_user.xml +++ b/app/dialplan/resources/xml/dialplan/330_vmain_user.xml @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 45af23d93a..e602b7318b 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -133,10 +133,10 @@ function process_xml_cdr($db, $leg, $xml_string) { //store the call leg $database->fields['leg'] = $leg; - //store the call direction. + //store the call direction $database->fields['direction'] = check_str(urldecode($xml->variables->call_direction)); - //store post dial delay, in milliseconds. + //store post dial delay, in milliseconds $database->fields['pdd_ms'] = check_str(urldecode($xml->variables->progress_mediamsec) + urldecode($xml->variables->progressmsec)); //get break down the date to year, month and day @@ -145,23 +145,30 @@ function process_xml_cdr($db, $leg, $xml_string) { $tmp_month = date("M", $tmp_time); $tmp_day = date("d", $tmp_time); - //find the domain_uuid by using the domain_name + //get the domain values from the xml $domain_name = check_str(urldecode($xml->variables->domain_name)); - $sql = "select domain_uuid from v_domains "; - if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') { - $sql .= "where domain_name = '".$context."' "; - } - else { - $sql .= "where domain_name = '".$domain_name."' "; - } - $row = $db->query($sql)->fetch(); - $domain_uuid = $row['domain_uuid']; + $domain_uuid = check_str(urldecode($xml->variables->domain_uuid)); + + //get the domain_uuid with the domain_name if (strlen($domain_uuid) == 0) { - $sql = "select domain_name, domain_uuid from v_domains "; + $sql = "select domain_uuid from v_domains "; + if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') { + $sql .= "where domain_name = '".$context."' "; + } + else { + $sql .= "where domain_name = '".$domain_name."' "; + } $row = $db->query($sql)->fetch(); $domain_uuid = $row['domain_uuid']; - if (strlen($domain_name) == 0) { $domain_name = $row['domain_name']; } + if (strlen($domain_uuid) == 0) { + $sql = "select domain_name, domain_uuid from v_domains "; + $row = $db->query($sql)->fetch(); + $domain_uuid = $row['domain_uuid']; + if (strlen($domain_name) == 0) { $domain_name = $row['domain_name']; } + } } + + //set values in the database $database->domain_uuid = $domain_uuid; $database->fields['domain_uuid'] = $domain_uuid; $database->fields['domain_name'] = $domain_name;