Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support upcoming change in freeswitch - bridge_uuid changes to bridge_uuids array #6531

Merged
merged 1 commit into from Jan 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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