Get Aastra phone MAC address from request header (#2762)

This commit is contained in:
sergey-mz 2017-07-30 12:47:13 -04:00 committed by FusionPBX
parent f19c4fe3fa
commit 6ee250f586
1 changed files with 6 additions and 0 deletions

View File

@ -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