mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-01 01:33:49 +00:00
When using redirect cdr also can contain e.g. `sip_redirect_contact_0` / `sip_redirected_to`.
I use `preg_replace_callback` to proceed all fields.
May be it more correct use urlencode because if we get xml with non UTF8 char we lost CDR.
```php
$xml_string = preg_replace_callback("/<([^><]+)>(.*?)<\/\g1>/",
function ($matches) {
// var_dump($matches);
return '<' . $matches[1] . '>' .
urlencode($matches[2]).
'</' . $matches[1] . '>';
},
$xml_string
);
```