From 3a854aa24acd090940c71cb57b43ce5bdcc1e508 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 13 Dec 2023 14:28:55 -0700 Subject: [PATCH] Get the snom local IP address Show the local IP address on the Registrations page. --- app/registrations/resources/classes/registrations.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/registrations/resources/classes/registrations.php b/app/registrations/resources/classes/registrations.php index 89bf18fbb2..788770b608 100644 --- a/app/registrations/resources/classes/registrations.php +++ b/app/registrations/resources/classes/registrations.php @@ -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'] = '';