Escene provision (#1140)

* Add. Provision to Escene ES330/ES320

* Add. Look up Escene device by ext+domain.

* Update Escene template.

* Add. `provision` section in config.

Found than ES330 some time hangup when it try get software/core and get error from fusion.
This commit is contained in:
Alexey Melnichuk
2016-05-06 10:49:43 +03:00
committed by FusionPBX
parent 170d4be4a1
commit f1c31e0935
9 changed files with 2014 additions and 1754 deletions

View File

@@ -26,6 +26,7 @@
include "root.php";
require_once "resources/require.php";
require_once "resources/functions/device_by.php";
openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
//set default variables
@@ -38,6 +39,7 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
//define PHP variables from the HTTP values
$mac = check_str($_REQUEST['mac']);
$file = check_str($_REQUEST['file']);
$ext = check_str($_REQUEST['ext']);
//if (strlen(check_str($_REQUEST['template'])) > 0) {
// $device_template = check_str($_REQUEST['template']);
//}
@@ -51,6 +53,20 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
}
}
// Escence make request based on UserID for Memory keys
/*
The file name is fixed to `Account1_Extern.xml`.
(Account1 is the first account you register)
*/
if(empty($mac) && !empty($ext)){
$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
$domain_name = $domain_array[0];
$device = device_by_ext($db, $ext, $domain_name);
if(($device !== false)&&($device['device_vendor']=='escene')){
$mac = $device['device_mac_address'];
}
}
//check alternate MAC source
if (empty($mac)){
//set the http user agent