Change TFTP detection logic
Accept first hit
This commit is contained in:
parent
d83c3ab93f
commit
bab83c7e3e
|
@ -911,8 +911,13 @@ function checkTftpServer() {
|
||||||
// Need to set the new value here to pass to extconfigs below
|
// Need to set the new value here to pass to extconfigs below
|
||||||
$settingsFromDb['tftp_path']['data'] = $tftpRootPath;
|
$settingsFromDb['tftp_path']['data'] = $tftpRootPath;
|
||||||
}
|
}
|
||||||
|
// Found sentinel file. Remove it and exit loop
|
||||||
|
if (file_exists($tempFile)) {
|
||||||
|
unlink($tempFile);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// remove all sentinel file
|
// Did not find sentinel so remove and continue
|
||||||
if (file_exists($tempFile)) {
|
if (file_exists($tempFile)) {
|
||||||
unlink($tempFile);
|
unlink($tempFile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -583,15 +583,15 @@ class xmlinterface
|
||||||
case 'softKeyFile':
|
case 'softKeyFile':
|
||||||
case 'dialTemplate': // Доработать !
|
case 'dialTemplate': // Доработать !
|
||||||
$xml_ext_file = '';
|
$xml_ext_file = '';
|
||||||
$templet_path = (($dkey == 'softKeyFile') ? $dev_config['tftp_softkey_path'] : $dev_config['tftp_dialplan_path']);
|
$template_path = (($dkey == 'softKeyFile') ? $dev_config['tftp_softkey_path'] : $dev_config['tftp_dialplan_path']);
|
||||||
$tmp_key = ($dkey == 'softKeyFile') ? 'softkeyset' : '_dialrules';
|
$tmp_key = ($dkey == 'softKeyFile') ? 'softkeyset' : '_dialrules';
|
||||||
if (!empty($dev_config[$tmp_key])) {
|
if (!empty($dev_config[$tmp_key])) {
|
||||||
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkey' . $dev_config[$tmp_key] . '.xml' : $dev_config[$tmp_key] . '.xml');
|
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkey' . $dev_config[$tmp_key] . '.xml' : $dev_config[$tmp_key] . '.xml');
|
||||||
}
|
}
|
||||||
if (empty($xml_ext_file) || !file_exists($templet_path . '/' . $xml_ext_file)) {
|
if (empty($xml_ext_file) || !file_exists($template_path . '/' . $xml_ext_file)) {
|
||||||
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkeydefault.xml' : 'dialplan.xml');
|
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkeydefault.xml' : 'dialplan.xml');
|
||||||
}
|
}
|
||||||
if (file_exists($templet_path . '/' . $xml_ext_file)) {
|
if (file_exists($template_path . '/' . $xml_ext_file)) {
|
||||||
$xml_node->$dkey = $xml_ext_file;
|
$xml_node->$dkey = $xml_ext_file;
|
||||||
} else {
|
} else {
|
||||||
$xml_node->$dkey = null;
|
$xml_node->$dkey = null;
|
||||||
|
|
Loading…
Reference in a new issue