Fix the Destination Select Dynamic mode

Category: destinations
Subcategory: select_mode 
Value: dynamic

Destination Select list - Category: Dialplans
- Check Voicemail
- Company Directory
- Hangup
- Record

The select_mode default was working
This commit is contained in:
FusionPBX
2026-02-21 15:29:49 -07:00
committed by GitHub
parent 65ff94c0fe
commit 01aef7e8b6
2 changed files with 43 additions and 37 deletions

View File

@@ -48,27 +48,33 @@
$apps[$x]['destinations'][$y]['select_label'] = "\${destination_number} \${destination_description}";
$y++;
$apps[$x]['destinations'][$y]['type'] = 'array';
$apps[$x]['destinations'][$y]['label'] = 'other';
$apps[$x]['destinations'][$y]['label'] = 'dialplans';
$apps[$x]['destinations'][$y]['name'] = 'dialplans';
$apps[$x]['destinations'][$y]['field']['name'] = 'name';
$apps[$x]['destinations'][$y]['field']['destination'] = 'destination';
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}";
$apps[$x]['destinations'][$y]['select_label'] = "\${name}";
/*
$z=0;
$apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'check_voicemail';
$apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'check_voicemail';
$apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*98 XML ${context}';
$apps[$x]['destinations'][$y]['result']['data'][$z]['extension'] = '*98';
$z++;
$apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'company_directory';
$apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'company_directory';
$apps[$x]['destinations'][$y]['result']['data'][$z]['extension'] = '*411';
$apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*411 XML ${context}';
$z++;
$apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'hangup';
$apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'hangup';
$apps[$x]['destinations'][$y]['result']['data'][$z]['extension'] = '';
$apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = 'hangup';
$z++;
$apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'company_directory';
$apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'record';
$apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'record';
$apps[$x]['destinations'][$y]['result']['data'][$z]['extension'] = '*732';
$apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*732 XML ${context}';
*/
//permission details
$y=0;

View File

@@ -286,32 +286,32 @@
}
}
$this->destinations[$x]['type'] = 'array';
$this->destinations[$x]['label'] = 'other';
$this->destinations[$x]['name'] = 'dialplans';
$this->destinations[$x]['field']['name'] = "name";
$this->destinations[$x]['field']['destination'] = "destination";
$this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}";
$this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}";
$this->destinations[$x]['select_label'] = "\${name}";
$y = 0;
$this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail';
$this->destinations[$x]['result']['data'][$y]['name'] = '*98';
$this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}';
$y++;
$this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory';
$this->destinations[$x]['result']['data'][$y]['name'] = '*411';
$this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}';
$y++;
$this->destinations[$x]['result']['data'][$y]['label'] = 'hangup';
$this->destinations[$x]['result']['data'][$y]['name'] = 'hangup';
$this->destinations[$x]['result']['data'][$y]['application'] = 'hangup';
$this->destinations[$x]['result']['data'][$y]['destination'] = '';
$y++;
$this->destinations[$x]['result']['data'][$y]['label'] = 'record';
$this->destinations[$x]['result']['data'][$y]['name'] = '*732';
$this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}';
$y++;
// $this->destinations[$x]['type'] = 'array';
// $this->destinations[$x]['label'] = 'other';
// $this->destinations[$x]['name'] = 'dialplans';
// $this->destinations[$x]['field']['name'] = "name";
// $this->destinations[$x]['field']['destination'] = "destination";
// $this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}";
// $this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}";
// $this->destinations[$x]['select_label'] = "\${name}";
// $y = 0;
// $this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail';
// $this->destinations[$x]['result']['data'][$y]['name'] = '*98';
// $this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}';
// $y++;
// $this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory';
// $this->destinations[$x]['result']['data'][$y]['name'] = '*411';
// $this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}';
// $y++;
// $this->destinations[$x]['result']['data'][$y]['label'] = 'hangup';
// $this->destinations[$x]['result']['data'][$y]['name'] = 'hangup';
// $this->destinations[$x]['result']['data'][$y]['application'] = 'hangup';
// $this->destinations[$x]['result']['data'][$y]['destination'] = '';
// $y++;
// $this->destinations[$x]['result']['data'][$y]['label'] = 'record';
// $this->destinations[$x]['result']['data'][$y]['name'] = '*732';
// $this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}';
// $y++;
}
/**
@@ -741,7 +741,7 @@
$select_label = $row['select_label'];
//echo $select_label." ".__line__." ".$name."<br />\n";
foreach ($row['field'] as $key => $value) {
if ($key == 'destination' and is_array($value)) {
if ($key == 'destination' && is_array($value)) {
if ($value['type'] == 'csv') {
$array = explode($value['delimiter'], $data[$key]);
$select_value = str_replace("\${destination}", $array[0], $select_value);
@@ -769,7 +769,7 @@
$select_label = str_replace("\${".$key."}", ($data[$key] ?? ''), $select_label);
}
else {
$select_label = str_replace("\${".$key."}", ($text2['option-'.$label] ?? ''), $select_label);
$select_label = str_replace("\${".$key."}", ($text2['option-'.$data['label']] ?? ''), $select_label);
}
}
//application: hangup
@@ -779,11 +779,11 @@
}
}
//view_array($data, false);
//echo "name ".$name."\n";
//echo "select_value ".$select_value."\n";
//echo "select_label ".$select_label."\n";
//echo "\n";
// view_array($data, false);
// echo "name ".$name."\n";
// echo "select_value ".$select_value."\n";
// echo "select_label ".$select_label."\n";
// echo "\n";
$select_value = str_replace("\${domain_name}", $this->domain_name, $select_value);
$select_value = str_replace("\${context}", $this->domain_name, $select_value);