Skip to content

Commit

Permalink
Support upcoming change in freeswitch - bridge_uuid changes to bridge…
Browse files Browse the repository at this point in the history
…_uuids array (#6531)
  • Loading branch information
demonspork committed Jan 27, 2023
1 parent 21b639c commit a381112
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/xml_cdr/resources/classes/xml_cdr.php
Expand Up @@ -427,6 +427,11 @@ function ($matches) {
//missed call
$missed_call = 'true';
}

//get the last bridge_uuid from the call to preserve previous behavior
foreach ($xml->variables->bridge_uuids as $bridge) {
$last_bridge = urldecode($bridge);
}

//misc
$uuid = urldecode($xml->variables->uuid);
Expand All @@ -442,7 +447,7 @@ function ($matches) {
$this->array[$key]['caller_destination'] = $caller_destination;
$this->array[$key]['accountcode'] = urldecode($xml->variables->accountcode);
$this->array[$key]['default_language'] = urldecode($xml->variables->default_language);
$this->array[$key]['bridge_uuid'] = urldecode($xml->variables->bridge_uuid);
$this->array[$key]['bridge_uuid'] = urldecode($xml->variables->bridge_uuid) ?: $last_bridge;
//$this->array[$key]['digits_dialed'] = urldecode($xml->variables->digits_dialed);
$this->array[$key]['sip_hangup_disposition'] = urldecode($xml->variables->sip_hangup_disposition);
$this->array[$key]['pin_number'] = urldecode($xml->variables->pin_number);
Expand Down Expand Up @@ -678,7 +683,7 @@ function ($matches) {
}
}
if (!isset($record_name)) {
$bridge_uuid = urldecode($xml->variables->bridge_uuid);
$bridge_uuid = urldecode($xml->variables->bridge_uuid) ?: $last_bridge;
$path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
if (file_exists($path.'/'.$bridge_uuid.'.wav')) {
$record_path = $path;
Expand All @@ -705,7 +710,7 @@ function ($matches) {

//last check
if (!isset($record_name) || is_null ($record_name) || (strlen($record_name) == 0)) {
$bridge_uuid = urldecode($xml->variables->bridge_uuid);
$bridge_uuid = urldecode($xml->variables->bridge_uuid) ?: $last_bridge ;
$path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
if (file_exists($path.'/'.$bridge_uuid.'.wav')) {
$record_path = $path;
Expand Down

0 comments on commit a381112

Please sign in to comment.