From 0286c39347f2733baffe4ee61fcff8c70dc79c42 Mon Sep 17 00:00:00 2001 From: simon golpe Date: Thu, 15 Feb 2024 12:25:14 +0100 Subject: [PATCH] test scanning RICOH devices --- SnomDeskphone/form.json | 6 ++++++ SnomDeskphone/module.php | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/SnomDeskphone/form.json b/SnomDeskphone/form.json index c28578a..130d9fc 100644 --- a/SnomDeskphone/form.json +++ b/SnomDeskphone/form.json @@ -345,6 +345,12 @@ "For seeing the current fkey settings, press the button \"See current function keys settings\"';", "SNMD_setFkeysSettings($id);" ] + }, + { + "type": "Select", + "name": "ips", + "caption": "found ips", + "options": [] } ] } \ No newline at end of file diff --git a/SnomDeskphone/module.php b/SnomDeskphone/module.php index 87c0aa3..061070b 100644 --- a/SnomDeskphone/module.php +++ b/SnomDeskphone/module.php @@ -252,9 +252,31 @@ public function fkeysAreUnique(array $fkeys_settings): bool return $fkeys_are_unique; } + public function getIps(): array + { + $options = []; + $ricohDevices = []; + $devices = ZC_QueryServiceType(38338, "_http._tcp", ""); + foreach ($devices as $device) { + if (str_contains($device["Name"], "RICOH")) { + array_push($ricohDevices, $device["Name"]); + } + } + $ricohIps =[]; + foreach ($ricohDevices as $ricohDevice) { + $deviceIp = ZC_QueryService(38338, $ricohDevice, "_http._tcp", "local.")[0]["IPv4"][0]; + // echo var_dump($deviceInfo); + array_push($options, ["caption" => $deviceIp, "value" => $deviceIp]); + } + // echo var_dump($ricohIps); + return $options; + } + public function GetConfigurationForm(): string { $data = json_decode(file_get_contents(__DIR__ . "/form.json"), true); + // echo var_dump(); + $data["elements"][8]["options"] = $this->getIps(); $device_info = array( "is snom phone" => false, "mac address" => '00:04:13:',