From 37e33552374b2054502cfd4580d6dad5d6e0bd38 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 7 Mar 2015 10:45:33 +0000 Subject: [PATCH] Escape sip_full_from, sip_full_to, caller_id so that the HTTP POST for CDR will work. Will remove once FreeSWITCH corrects the bug and its in a release version. --- app/xml_cdr/v_xml_cdr_import.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 29e6f7b12f..34f2f6a0c6 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -66,6 +66,24 @@ //set global variable global $debug; + //fix the xml by escaping the contents of + preg_match("/(.*)<\/sip_full_from>/", $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); + + //fix the xml by escaping the contents of + preg_match("/(.*)<\/sip_full_to>/", $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); + + //fix the xml by escaping the contents of + preg_match("/(.*)<\/caller_id>/", $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);