diff --git a/Monitoring Server Influx V1/module.php b/Monitoring Server Influx V1/module.php index f7399e5..03ca349 100644 --- a/Monitoring Server Influx V1/module.php +++ b/Monitoring Server Influx V1/module.php @@ -469,7 +469,41 @@ class MonitoringServer extends IPSModule { if ($numbersWhatsapp != ""){ $numbers = str_getcsv($numbersWhatsapp); foreach ($numbers as $number){ - WBM_SendMessageEx($idWhatsapp,$number,$paramvals); + // WBM_SendMessageEx($idWhatsapp,$number,$paramvals); + $url = 'https://whatsappapi.se-inno.de'; // 👈 API-URL hier eintragen + + $data = [ + 'api_key' => $idWhatsapp, + 'number' => $number, + 'message' => $smname, + 'template' => 'stoerung', + 'pn' => $art + ]; + + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + + // Optional: SSL-Validierung ausschalten (nur zu Testzwecken!) + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + + $response = curl_exec($ch); + $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $error = curl_error($ch); + curl_close($ch); + + header('Content-Type: text/plain'); + + echo "HTTP-Code: $httpcode\n"; + if ($error) { + echo "cURL Error: $error\n"; + } else { + echo "Response:\n$response\n"; + } + // IPS_LogMessage ("Send Whatsapp " .$projectnumber , "Whatsapp an folgende Nummer gesendet: ". $number ); } $whatsapped = 1; diff --git a/library.json b/library.json index b1da8c6..1727bf4 100644 --- a/library.json +++ b/library.json @@ -7,7 +7,7 @@ "version": "6.0", "date": 1491343200 }, - "version": "2.6", + "version": "2.7", "build": 1, "date": 0 } \ No newline at end of file