Add another work around for FreeSWITCH XML CDR that is not escaped correctly in FreeSWITCH 1.4.17.

This commit is contained in:
Mark Crane
2015-03-21 20:52:59 +00:00
parent 15135a05ac
commit 2943ad648b

View File

@@ -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 <sip_invite_record_route>
preg_match("/<sip_invite_record_route>(.*)<\/sip_invite_record_route>/", $xml_string, $matches);
$match_result = str_replace("<", "&lt;", $matches[1]);
$match_result = str_replace(">", "&gt;", $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);