Get the snom local IP address

Show the local IP address on the Registrations page.
This commit is contained in:
FusionPBX
2023-12-13 14:28:55 -07:00
committed by GitHub
parent 40998fdac1
commit 3a854aa24a

View File

@@ -165,9 +165,14 @@ if (!class_exists('registrations')) {
}
$registrations[$id]['lan-ip'] = $lan_ip;
}
else if (preg_match('/real=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $row['contact'] ?? '', $ip_match)) {
//get ip address for snom phones
$lan_ip = str_replace('real=', '', $ip_match[0]);
$registrations[$id]['lan-ip'] = $lan_ip;
}
else if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $row['contact'] ?? '', $ip_match)) {
$lan_ip = preg_replace('/_/', '.', $ip_match[0]);
$registrations[$id]['lan-ip'] = "$lan_ip";
$registrations[$id]['lan-ip'] = $lan_ip;
}
else {
$registrations[$id]['lan-ip'] = '';