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:
committed by
FusionPBX
parent
73605b4454
commit
f828c1c56b
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
function device_by_mac($db, $mac) {
|
||||
$sql = 'SELECT * FROM v_devices ';
|
||||
$sql .= 'WHERE device_mac_address=:mac';
|
||||
$prep = $db->prepare(check_sql($sql));
|
||||
if ($prep) {
|
||||
$prep->bindParam(':mac', $mac);
|
||||
$prep->execute();
|
||||
$row = $prep->fetch();
|
||||
unset($prep);
|
||||
return $row;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function device_by_ext($db, $ext, $domain) {
|
||||
$sql = 'select t1.* ';
|
||||
$sql .= 'from v_devices t1 inner join v_device_lines t2 on t1.device_uuid=t2.device_uuid ';
|
||||
$sql .= 'inner join v_domains t3 on t2.domain_uuid=t3.domain_uuid ';
|
||||
$sql .= 'where t2.user_id=:ext ';
|
||||
$sql .= 'and t3.domain_name=:domain ';
|
||||
$sql .= 'and t3.domain_enabled = \'true\' ';
|
||||
$prep = $db->prepare(check_sql($sql));
|
||||
if ($prep) {
|
||||
$prep->bindParam(':ext', $ext);
|
||||
$prep->bindParam(':domain', $domain);
|
||||
$prep->execute();
|
||||
$row = $prep->fetch();
|
||||
unset($prep);
|
||||
return $row;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user