Fixes: #77
Fixes: #82 Fixes: #85 Fixes: #87 --- Bugfix sip protocol Special thanks for help Diederik de Groot
This commit is contained in:
parent
f93b846dc1
commit
7b48b289af
|
@ -758,6 +758,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$ver_id = ' on found active model !';
|
||||
foreach ($models as $data) {
|
||||
$ver_id = $this->createSccpDeviceXML($data['name']);
|
||||
if ($ver_id == -1) {
|
||||
return array('status' => false, 'message' => 'Error Create Configuration Divice :' . $data['name']);
|
||||
}
|
||||
};
|
||||
|
||||
if ($this->sccpvalues['siptftp']['data'] == 'on') { // Check SIP Support Enabled
|
||||
|
@ -1283,7 +1286,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$save_buttons = $this->getPhoneButtons($get_settings, $name_dev, $hw_type);
|
||||
$this->dbinterface->write("sccpbuttons", $save_buttons, $update_hw, '', $name_dev);
|
||||
$this->createSccpDeviceXML($name_dev);
|
||||
|
||||
if ($hw_id == 'new') {
|
||||
$this->srvinterface->sccpDeviceReset($name_dev);
|
||||
} else {
|
||||
|
@ -1925,6 +1927,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$dev_line_data = $this->sipconfigs->get_db_sip_TableData('DeviceById', array('id' => $tmp_line[1]));
|
||||
$f_linetype = ($dev_line_data['dial'] == 'PJSIP') ? 'pjsip' : 'sip';
|
||||
$dev_line_data['sbind'] = $tmp_bind[$f_linetype];
|
||||
if ((!$this->array_key_exists_recursive('udp', $tmp_bind[$f_linetype])) && (!$this->array_key_exists_recursive('tcp', $tmp_bind[$f_linetype]))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!empty($dev_line_data)) {
|
||||
$data_value['siplines'][] = $dev_line_data;
|
||||
}
|
||||
|
@ -2283,6 +2289,18 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
return substr($inthat, 0, strpos($inthat, $thing));
|
||||
}
|
||||
|
||||
private function array_key_exists_recursive($key, $arr) {
|
||||
if (array_key_exists($key, $arr)) {
|
||||
return true;
|
||||
}
|
||||
foreach ($arr as $currentKey => $value) {
|
||||
if (is_array($value)) {
|
||||
return $this->array_key_exists_recursive($key, $value);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function strpos_array($haystack, $needles) {
|
||||
if (is_array($needles)) {
|
||||
foreach ($needles as $str) {
|
||||
|
|
|
@ -90,7 +90,11 @@ class sipconfigs
|
|||
if ($f_data['ip'] == "127.0.0.1") {
|
||||
continue;
|
||||
}
|
||||
if (empty($result[$f_protocol][$f_data['ip']])) {
|
||||
$result[$f_protocol][$f_data['ip']]= $f_port;
|
||||
} else {
|
||||
$result[$f_protocol][$f_data['ip']]= array_merge($result[$f_protocol][$f_data['ip']],$f_port);
|
||||
}
|
||||
$result[$f_protocol][$f_data['ip']]['ip']=$f_data['ip'];
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -536,7 +536,6 @@ class xmlinterface
|
|||
$bind_proto = (isset($value['tcp'])) ? 'tcp' : 'udp';
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($xml_template)) {
|
||||
$xml_work = simplexml_load_file($xml_template);
|
||||
|
||||
|
|
Loading…
Reference in a new issue