From 6ee250f5864bc3f2b7df7d1fc449f8edcf4bb836 Mon Sep 17 00:00:00 2001 From: sergey-mz Date: Sun, 30 Jul 2017 12:47:13 -0400 Subject: [PATCH] Get Aastra phone MAC address from request header (#2762) --- app/provision/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/provision/index.php b/app/provision/index.php index 10acea8b55..49cee79d24 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -91,6 +91,12 @@ $mac = substr($_SERVER['HTTP_USER_AGENT'],-13); $mac = preg_replace("#[^a-fA-F0-9./]#", "", $mac); } + //Aastra: $_SERVER['HTTP_USER_AGENT'] = "Aastra6731i MAC:00-08-5D-29-4C-6B V:3.3.1.4365-SIP" + if (substr($_SERVER['HTTP_USER_AGENT'],0,6) == "Aastra") { + preg_match("/MAC:([A-F0-9-]{17})/", $_SERVER['HTTP_USER_AGENT'], $matches); + $mac = $matches[1]; + $mac = preg_replace("#[^a-fA-F0-9./]#", "", $mac); + } } //prepare the mac address