Update provision.php

This commit is contained in:
FusionPBX 2017-07-28 16:31:26 -06:00 committed by GitHub
parent f2dd304270
commit 00d7b29a56
1 changed files with 67 additions and 71 deletions

View File

@ -544,81 +544,77 @@ include "root.php";
} }
else { else {
//use the user_agent to pre-assign a template for 1-hit provisioning. Enter the a unique string to match in the user agent, and the template it should match. //use the user_agent to pre-assign a template for 1-hit provisioning. Enter the a unique string to match in the user agent, and the template it should match.
$template_list=array( $templates['Linksys/SPA-2102'] = 'linksys/spa2102';
"Linksys/SPA-2102"=>"linksys/spa2102", $templates['Linksys/SPA-3102'] = 'linksys/spa3102';
"Linksys/SPA-3102"=>"linksys/spa3102", $templates['Linksys/SPA-9212'] = 'linksys/spa921';
"Linksys/SPA-9212"=>"linksys/spa921", $templates['Cisco/SPA301'] = 'cisco/spa301';
"Cisco/SPA301"=>"cisco/spa301", $templates['Cisco/SPA301D'] = 'cisco/spa302d';
"Cisco/SPA301D"=>"cisco/spa302d", $templates['Cisco/SPA303'] = 'cisco/spa303';
"Cisco/SPA303"=>"cisco/spa303", $templates['Cisco/SPA501G'] = 'cisco/spa501g';
"Cisco/SPA501G"=>"cisco/spa501g", $templates['Cisco/SPA502G'] = 'cisco/spa502g';
"Cisco/SPA502G"=>"cisco/spa502g", $templates['Cisco/SPA504G'] = 'cisco/spa504g';
"Cisco/SPA504G"=>"cisco/spa504g", $templates['Cisco/SPA508G'] = 'cisco/spa508g';
"Cisco/SPA508G"=>"cisco/spa508g", $templates['Cisco/SPA509G'] = 'cisco/spa509g';
"Cisco/SPA509G"=>"cisco/spa509g", $templates['Cisco/SPA512G'] = 'cisco/spa512g';
"Cisco/SPA512G"=>"cisco/spa512g", $templates['Cisco/SPA514G'] = 'cisco/spa514g';
"Cisco/SPA514G"=>"cisco/spa514g", $templates['Cisco/SPA525G2'] = 'cisco/spa525g2';
"Cisco/SPA525G2"=>"cisco/spa525g2", $templates['snom300-SIP'] = 'snom/300';
"snom300-SIP"=>"snom/300", $templates['snom320-SIP'] = 'snom/320';
"snom320-SIP"=>"snom/320", $templates['snom360-SIP'] = 'snom/360';
"snom360-SIP"=>"snom/360", $templates['snom370-SIP'] = 'snom/370';
"snom370-SIP"=>"snom/370", $templates['snom820-SIP'] = 'snom/820';
"snom820-SIP"=>"snom/820", $templates['snom-m3-SIP'] = 'snom/m3';
"snom-m3-SIP"=>"snom/m3", $templates['yealink SIP-CP860'] = 'yealink/cp860';
"yealink SIP-CP860"=>"yealink/cp860", $templates['yealink SIP-T19p'] = 'yealink/t19p';
"yealink SIP-T19p"=>"yealink/t19p", $templates['yealink SIP-T20p'] = 'yealink/t20p';
"yealink SIP-T20p"=>"yealink/t20p", $templates['yealink SIP-T21p'] = 'yealink/t21p';
"yealink SIP-T21p"=>"yealink/t21p", $templates['yealink SIP-T22p'] = 'yealink/t22p';
"yealink SIP-T22p"=>"yealink/t22p", $templates['yealink SIP-T23p'] = 'yealink/t23p';
"yealink SIP-T23p"=>"yealink/t23p", $templates['yealink SIP-T23g'] = 'yealink/t23g';
"yealink SIP-T23g"=>"yealink/t23g", $templates['yealink SIP-T27g'] = 'yealink/t27g';
"yealink SIP-T27g"=>"yealink/t27g", $templates['yealink SIP-T26p'] = 'yealink/t26p';
"yealink SIP-T26p"=>"yealink/t26p", $templates['yealink SIP-T28p'] = 'yealink/t28p';
"yealink SIP-T28p"=>"yealink/t28p", $templates['yealink SIP-T29p'] = 'yealink/t29p';
"yealink SIP-T29p"=>"yealink/t29p", $templates['Yealink SIP-T32g'] = 'yealink/t32g';
"Yealink SIP-T32g"=>"yealink/t32g", $templates['Yealink SIP-T38g'] = 'yealink/t38g';
"Yealink SIP-T38g"=>"yealink/t38g", $templates['Yealink SIP-T40p'] = 'yealink/t40p';
"Yealink SIP-T40p"=>"yealink/t40p", $templates['Yealink SIP-T41p'] = 'yealink/t41p';
"Yealink SIP-T41p"=>"yealink/t41p", $templates['Yealink SIP-T41g'] = 'yealink/t41g';
"Yealink SIP-T41g"=>"yealink/t41g", $templates['Yealink SIP-T41s'] = 'yealink/t41s';
"Yealink SIP-T41s"=>"yealink/t41s", $templates['Yealink SIP-T42g'] = 'yealink/t42g';
"Yealink SIP-T42g"=>"yealink/t42g", $templates['Yealink SIP-T46g'] = 'yealink/t46g';
"Yealink SIP-T46g"=>"yealink/t46g", $templates['Yealink SIP-T46s'] = 'yealink/t46s';
"Yealink SIP-T46s"=>"yealink/t46s", $templates['Yealink SIP-T48g'] = 'yealink/t48g';
"Yealink SIP-T48g"=>"yealink/t48g", $templates['Yealink SIP-T48s'] = 'yealink/t48s';
"Yealink SIP-T48s"=>"yealink/t48s", $templates['Yealink SIP-T49g'] = 'yealink/t49g';
"Yealink SIP-T49g"=>"yealink/t49g", $templates['Yealink SIP-VP530'] = 'yealink/vp530';
"Yealink SIP-VP530"=>"yealink/vp530", $templates['Yealink SIP-W52p'] = 'yealink/w52p';
"Yealink SIP-W52p"=>"yealink/w52p", $templates['Yealink SIP-W56p'] = 'yealink/w56p';
"Yealink SIP-W56p"=>"yealink/w56p", $templates['HW DP750'] = 'grandstream/dp750';
"HW DP750"=>"grandstream/dp750", $templates['HW GXP1450'] = 'grandstream/gxp1450';
"HW GXP1450"=>"grandstream/gxp1450", $templates['HW GXP1628'] = 'grandstream/gxp16xx';
"HW GXP1628"=>"grandstream/gxp16xx", $templates['HW GXP1610'] = 'grandstream/gxp16xx';
"HW GXP1610"=>"grandstream/gxp16xx", $templates['HW GXP1620'] = 'grandstream/gxp16xx';
"HW GXP1620"=>"grandstream/gxp16xx", $templates['HW GXP1625'] = 'grandstream/gxp16xx';
"HW GXP1625"=>"grandstream/gxp16xx", $templates['HW GXP1630'] = 'grandstream/gxp16xx';
"HW GXP1628"=>"grandstream/gxp16xx", $templates['HW GXP2124'] = 'grandstream/gxp2124';
"HW GXP1630"=>"grandstream/gxp16xx", $templates['HW GXP2130'] = 'grandstream/gxp2130';
"HW GXP2124"=>"grandstream/gxp2124", $templates['HW GXP2135'] = 'grandstream/gxp2135';
"HW GXP2130"=>"grandstream/gxp2130", $templates['HW GXP2140'] = 'grandstream/gxp2140';
"HW GXP2135"=>"grandstream/gxp2135", $templates['HW GXP2160'] = 'grandstream/gxp2160';
"HW GXP2140"=>"grandstream/gxp2140", $templates['HW GXP2170'] = 'grandstream/gxp2170';
"HW GXP2160"=>"grandstream/gxp2160", $templates['HW GXV3140'] = 'grandstream/gxv3140';
"HW GXP2170"=>"grandstream/gxp2170", $templates['HW GXV3240'] = 'grandstream/gxv3240';
"HW GXV3140"=>"grandstream/gxv3140", $templates['HW GXV3175'] = 'grandstream/gxv3175';
"HW GXV3240"=>"grandstream/gxv3240", $templates['Vesa VCS754'] = 'vtech/vcs754';
"HW GXV3175"=>"grandstream/gxv3175", $templates['Wget/1.11.3'] = 'konftel/kt300ip';
"Vesa VCS754"=>"vtech/vcs754", foreach ($templates as $key=>$value){
"Wget/1.11.3"=>"konftel/kt300ip"
);
foreach ($template_list as $key=>$val){
if(stripos($_SERVER['HTTP_USER_AGENT'],$key)!== false) { if(stripos($_SERVER['HTTP_USER_AGENT'],$key)!== false) {
$device_template = $val; $device_template = $value;
break; break;
} }
} }
unset($template_list); unset($templates);
//mac address does not exist in the table so add it //mac address does not exist in the table so add it
if ($_SESSION['provision']['auto_insert_enabled']['boolean'] == "true" and strlen($domain_uuid) > 0) { if ($_SESSION['provision']['auto_insert_enabled']['boolean'] == "true" and strlen($domain_uuid) > 0) {