From 621f5036e5ed72b89e702826af9ddd7edf1a679b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 21 Mar 2015 20:52:59 +0000 Subject: [PATCH] Add another work around for FreeSWITCH XML CDR that is not escaped correctly in FreeSWITCH 1.4.17. --- 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 301feaca87..cdf97d0a22 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -84,6 +84,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_invite_record_route>/", $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);