From a78eaacbcb48cd74bbc2b411058a1fa7fdef3b7f Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Sat, 8 Apr 2017 01:47:52 -0400 Subject: [PATCH] MAC detection for some Grandstream phones (#2486) Some GS models send the Mac address in the user agent --- app/provision/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/provision/index.php b/app/provision/index.php index 32ba7129be..56c36de16e 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -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