Add support for algo to send check-sync
This commit is contained in:
@@ -348,11 +348,15 @@
|
|||||||
|
|
||||||
public static function get_vendor_by_agent($agent){
|
public static function get_vendor_by_agent($agent){
|
||||||
if ($agent) {
|
if ($agent) {
|
||||||
|
//set the user agent string to lower case
|
||||||
$agent = strtolower($agent);
|
$agent = strtolower($agent);
|
||||||
//get the vendor
|
//get the vendor
|
||||||
if (preg_replace('/^.*?(aastra).*$/i', '$1', $agent) == "aastra") {
|
if (preg_replace('/^.*?(aastra).*$/i', '$1', $agent) == "aastra") {
|
||||||
return "aastra";
|
return "aastra";
|
||||||
}
|
}
|
||||||
|
if (preg_replace('/^.*?(algo).*$/i', '$1', $agent) == "algo") {
|
||||||
|
return "algo";
|
||||||
|
}
|
||||||
if (preg_replace('/^.*?(cisco\/spa).*$/i', '$1', $agent) == "cisco/spa") {
|
if (preg_replace('/^.*?(cisco\/spa).*$/i', '$1', $agent) == "cisco/spa") {
|
||||||
return "cisco-spa";
|
return "cisco-spa";
|
||||||
}
|
}
|
||||||
@@ -360,8 +364,8 @@
|
|||||||
return "cisco";
|
return "cisco";
|
||||||
}
|
}
|
||||||
if (preg_replace('/^.*?(digium).*$/i', '$1', $agent) == "digium") {
|
if (preg_replace('/^.*?(digium).*$/i', '$1', $agent) == "digium") {
|
||||||
return "digium";
|
return "digium";
|
||||||
}
|
}
|
||||||
if (preg_replace('/^.*?(grandstream).*$/i', '$1', $agent) == "grandstream") {
|
if (preg_replace('/^.*?(grandstream).*$/i', '$1', $agent) == "grandstream") {
|
||||||
return "grandstream";
|
return "grandstream";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,16 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--algo
|
||||||
|
if (vendor == "algo") then
|
||||||
|
if (command == "reboot") then
|
||||||
|
event:addHeader('event-string', 'check-sync;reboot=true');
|
||||||
|
end
|
||||||
|
if (command == "check_sync") then
|
||||||
|
event:addHeader('event-string', 'check-sync');
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--cisco
|
--cisco
|
||||||
if (vendor == "cisco") then
|
if (vendor == "cisco") then
|
||||||
if (command == "reboot") then
|
if (command == "reboot") then
|
||||||
|
|||||||
Reference in New Issue
Block a user