MAC detection for some Grandstream phones (#2486)

Some GS models send the Mac address in the user agent
This commit is contained in:
Luis Daniel Lucio Quiroz
2017-04-08 01:47:52 -04:00
committed by FusionPBX
parent 189578e982
commit a78eaacbcb

View File

@@ -82,6 +82,11 @@
$mac = substr($_SERVER['HTTP_USER_AGENT'],-14);
$mac = preg_replace("#[^a-fA-F0-9./]#", "", $mac);
}
//Grandstream: $_SERVER['HTTP_USER_AGENT'] = "Grandstream Model HW GXP2135 SW 1.0.7.97 DevId 000b828aa872"
if (substr($_SERVER['HTTP_USER_AGENT'],0,11) == "Grandstream") {
$mac = substr($_SERVER['HTTP_USER_AGENT'],-12);
$mac = preg_replace("#[^a-fA-F0-9./]#", "", $mac);
}
}
//prepare the mac address