From e7703ad3b77eda7a77cd9945fe2ee62611179010 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 15 May 2015 09:26:13 +0000 Subject: [PATCH] Filter for sip_P-Preferred-Identity in xml cdr import as a work around for invalid XML sent over HTTP POST. --- app/xml_cdr/v_xml_cdr_import.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 370af56803..90231c1460 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -96,6 +96,12 @@ $match_result = str_replace(">", ">", $match_result); $xml_string = str_replace($matches[1], $match_result, $xml_string); + //fix the xml by escaping the contents of + preg_match("/(.*)<\/sip_P-Preferred-Identity>/", $xml_string, $matches); + $match_result = str_replace("<", "<", $matches[1]); + $match_result = str_replace(">", ">", $match_result); + $xml_string = str_replace($matches[1], $match_result, $xml_string); + //parse the xml to get the call detail record info try { $xml = simplexml_load_string($xml_string);