diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 49910af81c..f8540e9e60 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -418,8 +418,25 @@ if (!class_exists('xml_cdr')) { $recording = $parts[3]; $record_path = dirname($recording); $record_name = basename($recording); + $record_length = urldecode($xml->variables->duration); + } + } + elseif (strlen($xml->variables->bridge) > 0) { + $commands = explode(",", urldecode($xml->variables->bridge)); + foreach ($commands as $command) { + $cmd = explode("=", $command); + if ($cmd[0] == "api_on_answer") { + $a = explode("]", $cmd[1]); + $command = str_replace("'", "", $a[0]); + $parts = explode(" ", $command); + if ($parts[0] == "uuid_record") { + $recording = $parts[3]; + $record_path = dirname($recording); + $record_name = basename($recording); + $record_length = urldecode($xml->variables->duration); + } + } } - $record_length = urldecode($xml->variables->duration); } //add the call recording