Class properties:
Class methods:
Class objects:
say("Отключено питание", 1);
/* $command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); $objects=getObjectsByClass("voice_command"); foreach($objects as $obj){ $fl=1; foreach(explode(" ",mb_strtolower($obj['TITLE'],'utf-8')) as $wo){ if (!(preg_match('/'.$wo.'(.*)/is',mb_strtolower($command,'utf-8'),$m))) { $fl=0; } } if ($fl==1) { callMethod($obj['TITLE'].".action",array("command"=>$m[1])); return; } if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); return; } } // если голосовых команд не найдено - отправим в чат callMethod("Chat_request.action",array("command"=>$command)); // say("Команда не опознана"); */
Class properties:
Class methods:
$this->setProperty('updated',time()); $this->setProperty("updatedTime",date('H:i'));
Class objects:
Class properties:
Class objects:
Class properties:
Class methods:
Class objects:
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX'; $username = getGlobal('GMailUsername'); // имя пользователя (лучше брать из объекта, например через getGlobal('GMailUsername'); -- на случай публикации через CONNECT, что б не светить) $password = getGlobal('GMailUserpass'); // пароль (аналогично) $mbox = imap_open($host, $login, $passwd); $count = 0; if (!$mbox) { echo "Error"; //ошибка доступа return; } else { $headers = imap_headers($mbox); foreach ($headers as $mail) { $flags = substr($mail, 0, 4); $isunr = (strpos($flags, "U") !== false); if ($isunr) $count++; } } imap_close($mbox); setGlobal('unread')=$count; // здесь устанавливаем полученное значение в объект
Class properties:
Class methods:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Class objects:
Class properties:
Class methods:
if ($this->getProperty("enabled")) { $function='Modect'; } else { $function='None'; } $enabled=$this->getProperty("enabled"); $username = $this->getProperty("user"); $password = $this->getProperty("pass"); $monitor = $this->getProperty("number"); $path = $this->getProperty("path"); $loginUrl = "$path/index.php"; $apiUrl = "$path/api"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $loginUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'username='.$username.'&password='.$password.'&action=login&view=console'); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $store = curl_exec($ch); #turn off POST after login - important curl_setopt($ch, CURLOPT_POST, 0); print "---------- Disable Monitor -----------------"; curl_setopt($ch, CURLOPT_URL, $apiUrl."/monitors/$monitor.json"); curl_setopt($ch, CURLOPT_POSTFIELDS, 'username='.$username.'&password='.$password."&Monitor[Function]=$function&Monitor[Enabled]=$enabled"); $content = curl_exec($ch); print $content; curl_close($ch);
Class objects:
Class properties:
Class objects:
Class objects:
Class properties:
Class methods:
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { $this->callMethod("deactivate"); say("Режим ".$this->getProperty('title')." выключен.",1); } else { $this->callMethod("activate"); say("Режим ".$this->getProperty('title')." включен.",1); }
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i'));
$this->callMethod("modeChanged");
Class objects:
$this->setProperty('active',1); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_activate.php'); /* end injection of {SDevices} */
$this->setProperty('active',0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
$this->setProperty('active',0);
$this->setProperty('active',1);
if ((!isOnline('online_CorridorCam')) & (getGlobal("CamCorridor.enabled") ==1)) { say("Предупреждение. Недоступна камера в коридоре",3); }; if ((!isOnline('online_Outdoor1Cam')) & (getGlobal("Outdoor1Cam.enabled") ==1)) { say("online_Предупреждение. Недоступна камера во внутреннем дворе",3); }; if ((!isOnline('online_Outdoor2Cam')) & (getGlobal("Outdoor2Cam.enabled") ==1)) { say("Предупреждение. Недоступна камера во дворе",3); }; // Принудительно гасим все датчики движения //Получаем список датчиков $objects=getObjectsByClass("SMotions"); foreach($objects as $obj) { $sensors[]=$obj['TITLE']; }; //Обнуляем состояние foreach($sensors as $sensor) { setGlobal("$sensor.status",0); }; $this->setProperty('active',1); $this->setProperty('Alarm',0);
if ($this->getProperty('Alarm') == 1) { say ("Обнаружены нарушения.",1); } else { say ("Нарушений не обнаружено.",1); }; $this->setProperty('active',0); $this->setProperty('Alarm',0);
$this->setProperty('active',0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_deactivate.php'); /* end injection of {SDevices} */
$this->setProperty('active',1); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_activate.php'); /* end injection of {SDevices} */
$this->setProperty('active',1); //Получаем список комнат $objects=getObjectsByClass("Rooms"); foreach($objects as $obj) { $rooms[]=$obj['TITLE']; }; //Уменьшаем контролируемую температуру /* foreach($rooms as $room) { $ctemp=getGlobal("$room.ControlTemperature"); if ($ctemp>0) { setGlobal("$room.ControlTemperature",$ctemp-4); }; }; */ /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */
$this->setProperty('active',0); //Получаем список комнат $objects=getObjectsByClass("Rooms"); foreach($objects as $obj) { $rooms[]=$obj['TITLE']; }; //Увеличиваем контролируемую температуру /* foreach($rooms as $room) { $ctemp=getGlobal("$room.ControlTemperature"); if ($ctemp>0) { setGlobal("$room.ControlTemperature",$ctemp+4); }; }; */ /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
$this->setProperty('active',1); setGlobal('voicemode','0'); setGlobal("minMsgLevel",3); setGlobal("minPushLevel",3); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
$this->setProperty('active',0); setGlobal('voicemode','1'); setGlobal("minMsgLevel",0); setGlobal("minPushLevel",2); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_deactivate.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
$Current = $this->getProperty("CO2"); $Control = $this->getProperty("ControlCO2"); if (($Current - $Control) <= 0) { // Выключаем вентиляцию }; if (($Current - $Control) > 500) { // Включаем вентиляцию };
$this->setProperty("SomebodyHere",0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_logicAction.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SButtons_pressed.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSeries.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_updatePreview.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSnapshot.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
require(DIR_MODULES.'devices/SControllers_switch.php');
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_turnOn.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
require(DIR_MODULES.'devices/SDimmers_turnOff.php');
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_setColor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOff.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_enable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_switchEnable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_disable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_refreshStats.php'); /* end injection of {SDevices} */
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
Class objects:
//Устанавливаем заначения в суммарный датчик движения CallMethod("Motion01.motionDetected");
//Устанавливаем заначения в суммарный датчик движения CallMethod("Motion01.motionDetected");
if (gg("SecurityArmedMode.active") == 1) { sg("SecurityArmedMode.Alarm",1); }
//Устанавливаем заначения в суммарный датчик движения CallMethod("Motion01.motionDetected");
//Устанавливаем заначения в суммарный датчик движения CallMethod("Motion01.motionDetected");
//Устанавливаем заначения в суммарный датчик движения CallMethod("Motion01.motionDetected");
Class properties:
Class methods:
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SBatterySensors_valueVoltageUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SBatterySensors_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
// Передать данные слинкованной комнате $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.".Humidity", $this->getProperty("value")); }
Class objects:
Class properties:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
Class methods:
// Передать данные слинкованной комнате $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.".Temperature", $this->getProperty("value")); }
Class objects:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.php'); /* end injection of {SDevices} */
Class methods:
Class objects:
echo "status received: ".$params['status'];
global $voicemode; $voicemode='off'; processCommand($params['message']);
Class properties:
Class methods:
Class methods:
// http://192.168.0.52/web/getallservices /* This XML file does not appear to have any style information associated with it. The document tree is shown below. <e2servicelistrecursive> <e2bouquet> <e2servicereference> 1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.____________tv_.tv" ORDER BY bouquet </e2servicereference> <e2servicename>Алена (TV)</e2servicename> <e2servicelist> <e2service> <e2servicereference>1:0:1:17D4:C:55:310000:0:0:0:</e2servicereference> <e2servicename>1+1</e2servicename> </e2service> <e2service> <e2servicereference>1:0:16:17ED:C:55:310000:0:0:0:</e2servicereference> <e2servicename>1+1 International</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:7:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>Inter</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B4E:11:55:310000:0:0:0:</e2servicereference> <e2servicename>INTER +</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:5:3:1:DE82BA7:0:0:0:</e2servicereference> <e2servicename>ICTV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:19D2:10:55:310000:0:0:0:</e2servicereference> <e2servicename>UKRAINA-SD</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:4:3:1:DE82BA7:0:0:0:</e2servicereference> <e2servicename>NOVY CHANNEL</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1:3:1:DE82BA7:0:0:0:</e2servicereference> <e2servicename>KIEV STB</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:17DE:C:55:310000:0:0:0:</e2servicereference> <e2servicename>TET</e2servicename> </e2service> <e2service> <e2servicereference> 1:134:1:0:0:0:0:0:0:0:FROM BOUQUET "alternatives.k1.tv" ORDER BY bouquet </e2servicereference> <e2servicename>K1</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CBB:13:55:310000:0:0:0:</e2servicereference> <e2servicename>K2</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:4:1:1:DE829E2:0:0:0:</e2servicereference> <e2servicename>Kiev TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:17E8:C:55:310000:0:0:0:</e2servicereference> <e2servicename>2+2</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>Tonis HD</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:C:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>112 UkraineHD</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6AB:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>STS International</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:2010:24B8:13E:820000:0:0:0:</e2servicereference> <e2servicename>1TVRUS Romania</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:182E:C:55:310000:0:0:0:</e2servicereference> <e2servicename>O-TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CCA:13:55:310000:0:0:0:</e2servicereference> <e2servicename>Enter Film</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:8:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>NTN</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B17:11:55:310000:0:0:0:</e2servicereference> <e2servicename>RTi</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6AE:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>ROSSIYA24</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B08:11:55:310000:0:0:0:</e2servicereference> <e2servicename>SONCE (UA)</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:2:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>Bigudi</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:C:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>Culture</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B1C:11:55:310000:0:0:0:</e2servicereference> <e2servicename>KRT</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CC0:13:55:310000:0:0:0:</e2servicereference> <e2servicename>ZOOM</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CA2:13:55:310000:0:0:0:</e2servicereference> <e2servicename>Horizont TEST</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B03:11:55:310000:0:0:0:</e2servicereference> <e2servicename>NADIYA</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CAC:13:55:310000:0:0:0:</e2servicereference> <e2servicename>MEGA</e2servicename> </e2service> <e2service> <e2servicereference>1:0:16:1A0E:10:55:310000:0:0:0:</e2servicereference> <e2servicename>34</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B44:11:55:310000:0:0:0:</e2servicereference> <e2servicename>MAXXI TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1A18:10:55:310000:0:0:0:</e2servicereference> <e2servicename>NLO TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B30:11:55:310000:0:0:0:</e2servicereference> <e2servicename>Pro BCE</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:17F2:C:55:310000:0:0:0:</e2servicereference> <e2servicename>GLAS</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:8:1:1:DE829E2:0:0:0:</e2servicereference> <e2servicename>3S.TV Savik Shuster</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:D:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>UA:</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1806:C:55:310000:0:0:0:</e2servicereference> <e2servicename>Espreso TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:B:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>QTV_</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1A22:10:55:310000:0:0:0:</e2servicereference> <e2servicename>Indigo</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6AC:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>RTR</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:3:1:4660:DE80000:0:0:0:</e2servicereference> <e2servicename>ZIK</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:5:1:1:DE829E2:0:0:0:</e2servicereference> <e2servicename>Plus Plus</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1CC5:13:55:310000:0:0:0:</e2servicereference> <e2servicename>PIXEL</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:3:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>Tysa 1</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:3:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>MILADY TELEVISION</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6B6:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>8 TV RU</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B49:11:55:310000:0:0:0:</e2servicereference> <e2servicename>RIVIVAL</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6AD:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>RUSBestseller</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:E:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>UA KRYM</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:A:14:1:DE82A36:0:0:0:</e2servicereference> <e2servicename>KDR TRK</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1:1:1:DE829E2:0:0:0:</e2servicereference> <e2servicename>Unian TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B12:11:55:310000:0:0:0:</e2servicereference> <e2servicename>Channel 5 (Ukraine)</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:A:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>Pervy delovoy</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:7:1:1:DE829E2:0:0:0:</e2servicereference> <e2servicename>EKO-TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1824:C:55:310000:0:0:0:</e2servicereference> <e2servicename>Kvartal TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:16:19FA:10:55:310000:0:0:0:</e2servicereference> <e2servicename>Donbass</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1C93:13:55:310000:0:0:0:</e2servicereference> <e2servicename>Black Sea TV</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:8:D:1:DE82A07:0:0:0:</e2servicereference> <e2servicename>NEWS 24</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1AFE:11:55:310000:0:0:0:</e2servicereference> <e2servicename>NewsNetwork</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1:65:1:82AFC2:0:0:0:</e2servicereference> <e2servicename>CurrentTime HD 1</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:200C:24B8:13E:820000:0:0:0:</e2servicereference> <e2servicename>BBC World News</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:29DE:3CF0:13E:820000:0:0:0:</e2servicereference> <e2servicename>Belarus24</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:8B6:1F4:13E:820000:0:0:0:</e2servicereference> <e2servicename>24-TV RUS</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:8B7:1F4:13E:820000:0:0:0:</e2servicereference> <e2servicename>24TV RUS</e2servicename> </e2service> <e2service> <e2servicereference>1:0:16:2BD:7:70:1680000:0:0:0:</e2servicereference> <e2servicename>8 канал</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:1B26:11:55:310000:0:0:0:</e2servicereference> <e2servicename>ATR</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6B1:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>NTV MIR</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:395:9:FD:1680000:0:0:0:</e2servicereference> <e2servicename>Promo</e2servicename> </e2service> <e2service> <e2servicereference>1:0:1:6A7:3138:13E:820000:0:0:0:</e2servicereference> <e2servicename>THT</e2servicename> </e2service> </e2servicelist> </e2bouquet> <e2bouquet>...</e2bouquet> <e2bouquet>...</e2bouquet> <e2bouquet>...</e2bouquet> <e2service>...</e2service> </e2servicelistrecursive> */
$ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/subservices'; if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; }; $this->setProperty ("servicereference",$data->e2service[0]->e2servicereference); $this->setProperty ("servicename",$data->e2service[0]->e2servicename);
urldecode ($params); $command = ($params['command']); $ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/remotecontrol?command='.$command; echo ($url); if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; }; /* 116 Key "Power" 2 Key "1" 3 Key "2" 4 Key "3" 5 Key "4" 6 Key "5" 7 Key "6" 8 Key "7" 9 Key "8" 10 Key "1" 11 Key "0" 412 Key "previous" 407 Key "next 115 Key "volume up" 113 Key "mute" 402 Key "bouquet up" 114 Key "volume down" 174 Key "lame" 403 Key "bouquet down" 358 Key "info" 103 Key "up" 139 Key "menu" 105 Key "left" 352 Key "OK" 106 Key "right" 392 Key "audio" 108 Key "down" 393 Key "video" 398 Key "red" 399 Key "green" 400 Key "yellow" 401 Key "blue" 377 Key "tv" 385 Key "radio" 388 Key "text" 138 Key "help" */
$ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/vol?set=up'; if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; };
$ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/vol?set=down'; if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; };
$ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/vol?set=mute'; if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; };
$this->callMethod("SendCommand",array("command"=>'407')); $this->callMethod("ChCurrent");
$this->callMethod("SendCommand",array("command"=>'412')); $this->callMethod("ChCurrent");
$ip = $this->getProperty('ip'); $url = 'http://'.$ip.'/web/vol'; if (($response_xml_data = file_get_contents($url))===false){ DebMes($url." -> Error fetching XML"); } else { libxml_use_internal_errors(true); $data = simplexml_load_string($response_xml_data); if (!$data) { echo "Error loading XML\n"; DebMes("Error loading XML"); foreach(libxml_get_errors() as $error) { DebMes($url." -> $error->message"); }; }; }; $this->setProperty ("volume",$data->e2volume[0]->e2current);
Class objects:
Class properties:
Class methods:
Class objects:
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; if (getGlobal('RT3000.InputVoltage')<1) { if (getGlobal('RT3000.BatteryCharge')<10) { $red_state=1; $details[]="Критический уровень заряда батареи энергообеспечения"; } elseif ((getGlobal('RT3000.BatteryCharge')>10) && (getGlobal('RT3000.BatteryCharge')<99)) { $yellow_state=1; $details[]="Система работает на источнике питания."; }; } elseif (getGlobal('RT3000.InputVoltage')>255) { $yellow_state=1; $details[]="Превышено напряжение в сети"; }; if (getGlobal('RT3000.status') == 'OL RB') { $red_state=1; $details[]="Необходима замена батареи источника питания"; }; if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; } $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Уровень системы энергообеспечения изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Уровень системы энергообеспечения восстановился на ".$state_title,$mlevel); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; $sensors=array(); $sensors['Sensor_temp01']="датчик температуры в детской"; $sensors['Sensor_temp02']="датчик температуры на улице"; $sensors['Sensor_humidity01']="датчик влажности в детской"; $sensors['Sensor_humidity02']="датчик влажности на улице"; foreach($sensors as $k=>$v) { if (!gg($k.'.alive')) { $yellow_state=1; $details[]="Не обновляется ".$v; } } //Получаем список зон $objects=getObjectsByClass("Rooms"); foreach($objects as $obj) { $rooms[]=$obj['TITLE']; }; //Контроль температуры в зонах foreach($rooms as $room) { $Current = getGlobal("$room.Temperature"); $Control = getGlobal("$room.ControlTemperature"); if ($Control <>'') { if (($Current - $Control) < -7) { $yellow_state=1; $details[]="Температура в зоне ".getGlobal("$room.Title")." ниже комфортной"; }; if (($Current - $Control) > 8) { $yellow_state=1; $details[]="Температура в зоне ".getGlobal("$room.Title")." выше комфортной"; }; }; }; //Контроль влажности в зонах foreach($rooms as $room) { $Current = getGlobal("$room.Humidity"); $Control = getGlobal("$room.ControlHumidity"); if ($Control <>'') { if (($Current - $Control) <= -15) { $yellow_state=1; $details[]="Влажность в зоне ".getGlobal("$room.Title")." ниже оптимальной"; }; if (($Current - $Control) >= 15) { $yellow_state=1; $details[]="Влажность в зоне ".getGlobal("$room.Title")." выше оптимальной"; }; }; }; //Контроль углекислого газа foreach($rooms as $room) { $Current = getGlobal("$room.CO2"); $Control = getGlobal("$room.ControlCO2"); if ((($Current - $Control) > 0) && (($Current - $Control) <= 400)) { $yellow_state=1; $details[]="Уровень углекислого газа в зоне ".getGlobal("$room.Title")." выше оптимального"; } elseif (($Current - $Control) > 400) { $red_state=1; $details[]="Опасный уровень углекислого газа в зоне ".getGlobal("$room.Title"); }; }; if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; } $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Уровень системы контроля климата изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Уровень системы контроля климата восстановился на ".$state_title,$mlevel); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; //Получаем список пользователей $objects=getObjectsByClass("Users"); foreach($objects as $obj) { $users[]=$obj['TITLE']; }; //Проверяем обновление информации от пользователей foreach($users as $user) { $uat=getGlobal("$user.CoordinatesUpdatedTimestamp"); setGlobal("$user.NameColor",'green'); if (time()-$uat>180*60) { $yellow_state=1; $details[]="Не обновляется информация о пользователе ".getGlobal("$user.fullName"); setGlobal("$user.NameColor",'yellow'); setGlobal("$user.status",'Offline'); setGlobal("$user.atHome",0); setGlobal("$user.Location",'Неизвестно'); }; }; //Проверяем уровень заряда батареи телефонов пользователей foreach($users as $user) { $bl=getGlobal("$user.BattLevel"); if ($bl < 10) { $red_state=1; $details[]="Критический уровень заряда в телефоне пользователя ".getGlobal("$user.fullName"); setGlobal("$user.NameColor",'red'); } elseif (($bl > 10) && ($bl < 20)) { $yellow_state=1; $details[]="Низкий уровень заряда в телефоне пользователя ".getGlobal("$user.fullName"); setGlobal("$user.NameColor",'yellow'); }; }; if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; }; $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Состояние пользователей изменилось на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Состояние пользователей восстановилось на ".$state_title,$mlevel); }; $this->callMethod('stateChanged'); };
// При красном статусе формируем файл для дозвона и оповещения //if (gg("Server.stateColor") == "red") { //$calltmp = "/var/spool/asterisk/tmp/server_red.call"; //$calldir = "/var/spool/asterisk/outgoing/server_red.call"; //$callnumber = "SIP/200"; //$dirmessage = "/var/www/cached/voice/"; //$message = (md5("Статус сервера изменился на ".gg("Server.stateTitle").". ".implode(". ",gg("Server.stateDetails")))); //$callfile = fopen ($calltmp, "w"); //fwrite ($callfile,"Channel: $callnumber\n"); //fwrite ($callfile,"Callerid: 299\n"); //fwrite ($callfile,"MaxRetries: 2\n"); //fwrite ($callfile,"RetryTime: 60\n"); //fwrite ($callfile,"WaitTime: 60\n"); //fwrite ($callfile,"Context: majordomo\n"); //fwrite ($callfile,"Extension: s\n"); //fwrite ($callfile,"Priority: 1\n"); //fwrite ($callfile,"Set: playfile=$dirmessage$message\n"); //fwrite ($callfile,"Archive: Yes\n"); //fclose($callfile); //copy ($calltmp,$calldir); // //};
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; //Проверяем состояние вентилятора процессора //if (getGlobal('CoreFan')<100) { // $red_state=1; // $details[]="Остановлен вентилятор процессора"; //}; ////Проверяем состояние системного вентилятора //if (getGlobal('SysFan')<100) { // $yellow_state=1; // $details[]="Остановлен системный вентилятор"; //}; //Проверяем температуру ядер процессора if (getGlobal('TempCore0')>80) { $red_state=1; $details[]="Критическая температура процессора"; } elseif ((getGlobal('TempCore0')>75) && (getGlobal('TempCore0')<80)) { $yellow_state=1; $details[]="Превышена температура процессора"; }; // Проверяем температуру винчестеров if (getGlobal('TempHDD1')>50) { $red_state=1; $details[]="Критическая температура винчестера"; } elseif ((getGlobal('TempHDD1')>45) && (getGlobal('TempHDD1')<50)) { $yellow_state=1; $details[]="Превышена температура винчестера"; }; // Проверяем наличие свободного места на системном винчестере $bytes = disk_free_space("."); $si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' ); $base = 1024; $class = min((int)log($bytes , $base) , count($si_prefix) - 1); $space = round($bytes / pow($base,$class)); if ($space<2) { $red_state=1; $details[]="Критически недостаточно свободного места на системном диске"; } elseif (($space>3) && ($space<4)) { $yellow_state=1; $details[]="Заканчивается свободное место на системном диске"; }; // Проверяем наличие свободного места на файловом винчестере $bytes = disk_free_space("/mnt/work"); $si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' ); $base = 1024; $class = min((int)log($bytes , $base) , count($si_prefix) - 1); $space = round($bytes / pow($base,$class)); if ($space<20) { $red_state=1; $details[]="Критически недостаточно свободного места на файловом диске"; } elseif (($space>20) && ($space<50)) { $yellow_state=1; $details[]="Заканчивается свободное место на файловом диске"; }; if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; }; $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Статус сервера изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Статус сервера восстановился на ".$state_title,$mlevel); }; $this->callMethod('stateChanged'); };
//if ((gg("Communication.stateColor") == "red") && (!isOnline('Интернет'))) { //$calltmp = "/var/spool/asterisk/tmp/comm_red.call"; //$calldir = "/var/spool/asterisk/outgoing/comm_red.call"; //$callnumber = "Dongle/dongle0/holdother:+380504453405"; //$dirmessage = "/var/www/cached/voice/"; //$message = (md5("Уровень системы связи изменился на ".gg("Communication.stateTitle").". ".implode(". ",gg("Communication.stateDetails")))); //$callfile = fopen ($calltmp, "w"); //fwrite ($callfile,"Channel: $callnumber\n"); //fwrite ($callfile,"Callerid: 299\n"); //fwrite ($callfile,"MaxRetries: 2\n"); //fwrite ($callfile,"RetryTime: 60\n"); //fwrite ($callfile,"WaitTime: 60\n"); //fwrite ($callfile,"Context: majordomo\n"); //fwrite ($callfile,"Extension: s\n"); //fwrite ($callfile,"Priority: 1\n"); //fwrite ($callfile,"Set: playfile=$dirmessage$message\n"); //fwrite ($callfile,"Archive: Yes\n"); //fclose($callfile); //copy ($calltmp,$calldir); //};
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; if (!isOnline('online_Router')) { $red_state=1; $details[]="Недоступен роутер"; } if (!isOnline('online_Internet')) { $red_state=1; $details[]="Недоступен интернет"; } if (!isOnline('asterisk')) { $yellow_state=1; $details[]="Недоступен сервер телефонии"; } if (!isOnline('online_MSGate')) { $red_state=1; $details[]="Недоступен шлюз сенсоров"; } if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; } $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Уровень системы связи изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Уровень системы связи восстановился на ".$state_title,$mlevel); } $this->callMethod('stateChanged'); }
// При красном статусе формируем файл для дозвона и оповещения //if (gg("System.stateColor") == "red") { //$calltmp = "/var/spool/asterisk/tmp/system_red.call"; //$calldir = "/var/spool/asterisk/outgoing/system_red.call"; //$callnumber = "SIP/200"; //$dirmessage = "/var/www/cached/voice/"; //$message = (md5("Уровень целостности системы изменился на ".gg("System.stateTitle").". ".gg("System.stateDetails"))); //$callfile = fopen ($calltmp, "w"); //fwrite ($callfile,"Channel: $callnumber\n"); //fwrite ($callfile,"Callerid: 299\n"); //fwrite ($callfile,"MaxRetries: 2\n"); //fwrite ($callfile,"RetryTime: 60\n"); //fwrite ($callfile,"WaitTime: 60\n"); //fwrite ($callfile,"Context: majordomo\n"); //fwrite ($callfile,"Extension: s\n"); //fwrite ($callfile,"Priority: 1\n"); //fwrite ($callfile,"Set: playfile=$dirmessage$message\n"); //fwrite ($callfile,"Archive: Yes\n"); //fclose($callfile); //copy ($calltmp,$calldir); //};
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; $tmp=SQLSelectOne("SELECT ID FROM system_errors WHERE ACTIVE>0 LIMIT 1"); if ($tmp['ID']) { $yellow_state=1; $details[]="Сохранена системная ошибка"; } $cycles=array('states'=>'цикл проверки состояния','main'=>'главный цикл','execs'=>'цикл запуска команд','scheduler'=>'цикл планировщика'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60) { $red_state=1; $details[]="Остановлен ".$v; } } $cycles=array('ping'=>'цикл пинг','webvars'=>'цикл веб переменных','mysensor'=>'цикл опроса датчиков'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; $details[]="Остановлен ".$v; } } if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Жёлтый'; $mlevel=2; } else { $state='green'; $state_title='Зелёный'; $mlevel=2; } $this->setProperty('stateDetails',implode(". ",$details)); if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Уровень целостности системы изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Уровень целостности системы восстановился на ".$state_title,$mlevel); } $this->callMethod('stateChanged'); } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/system_checkstate.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; $mlevel=0; if ((!isOnline('online_CorridorCam')) & (getGlobal("CamCorridor.enabled") ==1)) { if (getGlobal("SecurityArmedMode.active")==1) { $red_state=1; $details[]="Недоступна камера в коридоре"; } else { $yellow_state=1; $details[]="Недоступна камера в коридоре"; } } if ((!isOnline('online_Outdoor1Cam')) & (getGlobal("Outdoor1Cam.enabled") ==1)) { if (getGlobal("SecurityArmedMode.active")==1) { $red_state=1; $details[]="Недоступна камера во внутреннем дворе"; } else { $yellow_state=1; $details[]="Недоступна камера во внутреннем дворе"; } } if ((!isOnline('online_Outdoor2Cam')) & (getGlobal("Outdoor2Cam.enabled") ==1)) { if (getGlobal("SecurityArmedMode.active")==1) { $red_state=1; $details[]="Недоступна камера во дворе"; } else { $yellow_state=1; $details[]="Недоступна камера во дворе"; } } if ((!isOnline('online_Outdoor3Cam')) & (getGlobal("Outdoor3Cam.enabled") ==1)) { if (getGlobal("SecurityArmedMode.active")==1) { $red_state=1; $details[]="Недоступна камера на заднем дворе"; } else { $yellow_state=1; $details[]="Недоступна камера на заднем дворе"; } } if (gg("SecurityArmedMode.Alarm") == 1) { if (gg("Motion01.status") == 1) { $red_state=1; $details[]="Обнаружено движение!"; } else { $yellow_state=1; $details[]="Безопасность восстановлена"; }; }; if ($red_state) { $state='red'; $state_title='Красный'; $mlevel=3; } elseif ($yellow_state) { $state='yellow'; $state_title='Желтый'; $mlevel=2; } else { $state='green'; $state_title='Зеленый'; $mlevel=2; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say ("Статус системы безопасности изменился на ".$state_title.". ".implode(". ",$details),$mlevel); } else { say("Статус системы безопасности восстановлен на ".$state_title,$mlevel); } $this->callMethod('stateChanged'); }
// При красном статусе формируем файл для дозвона и оповещения //if (gg("Security.stateColor") == "red") { //$calltmp = "/var/spool/asterisk/tmp/security_red.call"; //$calldir = "/var/spool/asterisk/outgoing/security_red.call"; //$callnumber = "SIP/200"; //$dirmessage = "/var/www/cached/voice/"; //$message = (md5("Статус системы безопасности изменился на ".gg("Security.stateTitle").". ".implode(". ",gg("Security.stateDetails")))); // //$callfile = fopen ($calltmp, "w"); //fwrite ($callfile,"Channel: $callnumber\n"); //fwrite ($callfile,"Callerid: 299\n"); //fwrite ($callfile,"MaxRetries: 2\n"); //fwrite ($callfile,"RetryTime: 60\n"); //fwrite ($callfile,"WaitTime: 60\n"); //fwrite ($callfile,"Context: majordomo\n"); //fwrite ($callfile,"Extension: s\n"); //fwrite ($callfile,"Priority: 1\n"); //fwrite ($callfile,"Set: playfile=$dirmessage$message\n"); //fwrite ($callfile,"Archive: Yes\n"); //fclose($callfile); //copy ($calltmp,$calldir); //};
Class methods:
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
echo date('Y-m-d H:i:s')." : Event ".$params['Event']." received. Process... \n";
Class objects:
/** Array received form Asterisk: [Event] => CallAnswered [Privilege] => call,all [Channel] => SCCP/202-00000017 [SCCPLine] => 202 [SCCPDevice] => SEP00506003B22A [Uniqueid] => 1520531329.158 [CallingPartyNumber] => +380504453405 [CallingPartyName] => MTS [originalCallingParty] => [lastRedirectingParty] => */
/** Array received form Asterisk: [Event] => AgentRingNoAnswer [Privilege] => agent,all [Channel] => Dongle/dongle0-010000000c [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380504453405 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1520531285.147 [Linkedid] => 1520531285.147 [DestChannel] => SIP/212-00000017 [DestChannelState] => 0 [DestChannelStateDesc] => Down [DestCallerIDNum] => 212 [DestCallerIDName] => Phone2 [DestConnectedLineNum] => +380504453405 [DestConnectedLineName] => MTS [DestLanguage] => ru [DestAccountCode] => [DestContext] => DialPlanMain [DestExten] => 80505498409 [DestPriority] => 1 [DestUniqueid] => 1520531293.151 [DestLinkedid] => 1520531285.147 [Queue] => local [Interface] => SIP/212 [MemberName] => SIP/212 [RingTime] => 0 */
/** Array received form Asterisk: [Event] => AgentComplete [Privilege] => agent,all [Channel] => Dongle/dongle0-010000000d [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380504453405 [CallerIDName] => MTS [ConnectedLineNum] => 202 [ConnectedLineName] => Video [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1520531322.156 [Linkedid] => 1520531322.156 [DestChannel] => SCCP/202-00000017 [DestChannelState] => 6 [DestChannelStateDesc] => Up [DestCallerIDNum] => 202 [DestCallerIDName] => Video [DestConnectedLineNum] => +380504453405 [DestConnectedLineName] => MTS [DestLanguage] => ru [DestAccountCode] => 202 [DestContext] => DialPlanMain [DestExten] => 80505498409 [DestPriority] => 1 [DestUniqueid] => 1520531329.158 [DestLinkedid] => 1520531322.156 [HoldTime] => 5 [Queue] => local [Interface] => SCCP/202 [TalkTime] => 38 [MemberName] => SCCP/202 [Reason] => caller */
/** Array received form Asterisk: [Event] => AgentCalled [Privilege] => agent,all [Channel] => Dongle/dongle0-010000000c [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380504453405 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1520531285.147 [Linkedid] => 1520531285.147 [DestChannel] => SCCP/200-00000014 [DestChannelState] => 5 [DestChannelStateDesc] => Ringing [DestCallerIDNum] => 200 [DestCallerIDName] => Hall [DestConnectedLineNum] => +380504453405 [DestConnectedLineName] => MTS [DestLanguage] => ru [DestAccountCode] => 200 [DestContext] => DialPlanMain [DestExten] => 80505498409 [DestPriority] => 1 [DestUniqueid] => 1520531292.148 [DestLinkedid] => 1520531285.147 [Queue] => local [Interface] => SCCP/200 [MemberName] => SCCP/200 */
/** Array received form Asterisk: [Event] => Hold [Privilege] => call,all [Status] => On [Channel] => SCCP/202-0000000e [Uniqueid] => 1503855215.44 */
/** Array received form Asterisk: [Event] => BridgeDestroy [Privilege] => call,all [BridgeUniqueid] => 3808895a-f5ae-4b93-8ac5-8cc8799f0496 [BridgeType] => basic [BridgeTechnology] => simple_bridge [BridgeCreator] => <unknown> [BridgeName] => <unknown> [BridgeNumChannels] => 0 [BridgeVideoSourceMode] => none */
/** Array received form Asterisk: [Event] => AgentConnect [Privilege] => agent,all [Channel] => Dongle/dongle0-010000000d [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380504453405 [CallerIDName] => MTS [ConnectedLineNum] => 202 [ConnectedLineName] => Video [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1520531322.156 [Linkedid] => 1520531322.156 [DestChannel] => SCCP/202-00000017 [DestChannelState] => 6 [DestChannelStateDesc] => Up [DestCallerIDNum] => 202 [DestCallerIDName] => Video [DestConnectedLineNum] => +380504453405 [DestConnectedLineName] => MTS [DestLanguage] => ru [DestAccountCode] => 202 [DestContext] => DialPlanMain [DestExten] => 80505498409 [DestPriority] => 1 [DestUniqueid] => 1520531329.158 [DestLinkedid] => 1520531322.156 [HoldTime] => 5 [Queue] => local [Interface] => SCCP/202 [MemberName] => SCCP/202 [RingTime] => 4 */
/** Array received form Asterisk: [Event] => DialEnd [Privilege] => call,all [Channel] => SCCP/200-00000005 [ChannelState] => 4 [ChannelStateDesc] => Ring [CallerIDNum] => 200 [CallerIDName] => Hall [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => 200 [Context] => DialPlanMain [Exten] => 0504453405 [Priority] => 2 [Uniqueid] => 1502613938.12 [Linkedid] => 1502613938.12 [DestChannel] => Dongle/dongle0-0100000000 [DestChannelState] => 3 [DestChannelStateDesc] => Dialing [DestCallerIDNum] => 0504453405 [DestCallerIDName] => <unknown> [DestConnectedLineNum] => 200 [DestConnectedLineName] => Hall [DestLanguage] => ru [DestAccountCode] => 200 [DestContext] => dongle-incoming [DestExten] => 0504453405 [DestPriority] => 1 [DestUniqueid] => 1502613947.13 [DestLinkedid] => 1502613938.12 [DialStatus] => CANCEL */
/** Array received form Asterisk: [Event] => BridgeEnter [Privilege] => call,all [BridgeUniqueid] => 8508ce8b-88d5-4a96-ad6f-71d7ea6eb85f [BridgeType] => parking [BridgeTechnology] => holding_bridge [BridgeCreator] => Parking [BridgeName] => default [BridgeNumChannels] => 1 [Channel] => SCCP/200-00000003 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => 200 [CallerIDName] => Hall [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => 200 [Context] => DialPlanMain [Exten] => 700 [Priority] => 1 [Uniqueid] => 1502613909.8 [Linkedid] => 1502613909.8 */
/** Array received form Asterisk: [Event] => ParkedCall [Privilege] => call,all [ParkeeChannel] => SCCP/200-00000003 [ParkeeChannelState] => 6 [ParkeeChannelStateDesc] => Up [ParkeeCallerIDNum] => 200 [ParkeeCallerIDName] => Hall [ParkeeConnectedLineNum] => <unknown> [ParkeeConnectedLineName] => <unknown> [ParkeeLanguage] => ru [ParkeeAccountCode] => 200 [ParkeeContext] => DialPlanMain [ParkeeExten] => 700 [ParkeePriority] => 1 [ParkeeUniqueid] => 1502613909.8 [ParkeeLinkedid] => 1502613909.8 [ParkerDialString] => SCCP/200 [Parkinglot] => default [ParkingSpace] => 701 [ParkingTimeout] => 45 [ParkingDuration] => 0 */
/** Array received form Asterisk: [Event] => Reload [Privilege] => system,all [Module] => Enum [Status] => Enabled [Message] => ENUM reload Requested */
/** Array received form Asterisk: [Event] => Newexten [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-00000000;1 [ChannelState] => 0 [ChannelStateDesc] => Down [CallerIDNum] => ussd [CallerIDName] => dongle0 [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => ussd [Priority] => 1 [Uniqueid] => 1490899894.0 [Linkedid] => 1490899894.0 [Extension] => ussd [Application] => System [AppData] => echo '2017-03-30 21:51:34 — dongle0: Na osobovomu rakhunku 295371964011: avans 16.49 hrn. na 30.03.17 21:51. TV online u Vashomu smartfoni z Vodafone TV! Info: *999#' >> /var/log/asterisk/ussd.txt */
/** Array received form Asterisk: [Event] => DeviceStateChange [Privilege] => call,all [Device] => Local/ussd@dongle-incoming [State] => NOT_INUSE */
/** Array received form Asterisk: [Event] => NewConnectedLine [Privilege] => call,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 0 [ChannelStateDesc] => Down [CallerIDNum] => 0504453405 [CallerIDName] => <unknown> [ConnectedLineNum] => 200 [ConnectedLineName] => Hall [Language] => ru [AccountCode] => 200 [Context] => dongle-incoming [Exten] => 0504453405 [Priority] => 1 [Uniqueid] => 1502613947.13 [Linkedid] => 1502613938.12 */
/** Array received form Asterisk: [Event] => DialBegin [Privilege] => call,all [Channel] => SCCP/200-00000005 [ChannelState] => 4 [ChannelStateDesc] => Ring [CallerIDNum] => 200 [CallerIDName] => Hall [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => 200 [Context] => DialPlanMain [Exten] => 0504453405 [Priority] => 2 [Uniqueid] => 1502613938.12 [Linkedid] => 1502613938.12 [DestChannel] => Dongle/dongle0-0100000000 [DestChannelState] => 0 [DestChannelStateDesc] => Down [DestCallerIDNum] => 0504453405 [DestCallerIDName] => <unknown> [DestConnectedLineNum] => 200 [DestConnectedLineName] => Hall [DestLanguage] => ru [DestAccountCode] => 200 [DestContext] => dongle-incoming [DestExten] => 0504453405 [DestPriority] => 1 [DestUniqueid] => 1502613947.13 [DestLinkedid] => 1502613938.12 [DialString] => dongle0/holdother:+380504453405 */
/** Array received form Asterisk: [Event] => NewAccountCode [Privilege] => call,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 0 [ChannelStateDesc] => Down [CallerIDNum] => 0504453405 [CallerIDName] => <unknown> [ConnectedLineNum] => 200 [ConnectedLineName] => Hall [Language] => ru [AccountCode] => 200 [Context] => dongle-incoming [Exten] => 0504453405 [Priority] => 1 [Uniqueid] => 1502613947.13 [Linkedid] => 1502613938.12 [OldAccountCode] => */
/** Array received form Asterisk: [Event] => DND [Privilege] => call,all [ChannelType] => SCCP [ChannelObjectType] => Device [Feature] => dnd [Status] => Reject [SCCPDevice] => SEP00506003B22A */
/** Array received form Asterisk: [Event] => ParkedCallGiveUp [Privilege] => call,all [ParkeeChannel] => SCCP/200-00000003 [ParkeeChannelState] => 6 [ParkeeChannelStateDesc] => Up [ParkeeCallerIDNum] => 200 [ParkeeCallerIDName] => Hall [ParkeeConnectedLineNum] => <unknown> [ParkeeConnectedLineName] => <unknown> [ParkeeLanguage] => ru [ParkeeAccountCode] => 200 [ParkeeContext] => DialPlanMain [ParkeeExten] => 700 [ParkeePriority] => 1 [ParkeeUniqueid] => 1502613909.8 [ParkeeLinkedid] => 1502613909.8 [ParkerDialString] => SCCP/200 [Parkinglot] => default [ParkingSpace] => 701 [ParkingTimeout] => 40 [ParkingDuration] => 5 */
/** Array received form Asterisk: [Event] => QueueCallerLeave [Privilege] => agent,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380414722080 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1491481336.12 [Linkedid] => 1491481336.12 [Queue] => local [Position] => 1 [Count] => 0 */
/** Array received form Asterisk: [Event] => DongleNewUSSDBase64 [Privilege] => call,all [Device] => dongle0 [Message] => TmEgb3Nvk2NDAxMTogYXZhbnMgNyjAzLjE2IDE5IERldGFsaSAxMTE= */
/** Array received form Asterisk: [Event] => BridgeLeave [Privilege] => call,all [BridgeUniqueid] => 8508ce8b-88d5-4a96-ad6f-71d7ea6eb85f [BridgeType] => parking [BridgeTechnology] => holding_bridge [BridgeCreator] => Parking [BridgeName] => default [BridgeNumChannels] => 0 [Channel] => SCCP/200-00000003 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => 200 [CallerIDName] => Hall [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => 200 [Context] => DialPlanMain [Exten] => 700 [Priority] => 1 [Uniqueid] => 1502613909.8 [Linkedid] => 1502613909.8 */
/** Array received form Asterisk: [Event] => SoftHangupRequest [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-0000000e;1 [Uniqueid] => 1458926768.28 [Cause] => 16 */
/** Array received form Asterisk: [Event] => HangupRequest [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-0000000e;2 [Uniqueid] => 1458926768.29 */
/** Array received form Asterisk: [Event] => Hangup [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-0000000e;2 [Uniqueid] => 1458926768.29 [CallerIDNum] => <unknown> [CallerIDName] => <unknown> [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [AccountCode] => [Cause] => 0 [Cause-txt] => Unknown */
/** Array received form Asterisk: [Event] => DongleUSSDStatus [Privilege] => call,all [Device] => dongle0 [ID] => 0x7f1c38008b90 [Status] => Sent */
/** Array received form Asterisk: [Event] => DongleNewCUSD [Privilege] => call,all [Device] => dongle0 [Message] => +CUSD: 0,"004E006F006D00750,15 */
/** Array received form Asterisk: [Event] => DongleNewUSSD [Privilege] => call,all [Device] => dongle0 [LineCount] => 2 [MessageLine0] => Na osobovomu rakhunku XXXXXXXXX: avans 7.34 hrn. na 25.03.16 19:28. [MessageLine1] => Telefonuite za kordon vid 0 hrn za khvylynu z posluhoiu '0 za kordon'. Detali 111 */ if(!empty($params['MessageLine0'])) { $message = explode(" ", $params['MessageLine0']); switch($message[4]) { case 'avans': sayReply("На счете Водафон аванс $message[5]",2,'Баланс МТС'); sg('MTSCounter.counter',"$message[5]"); break; case 'zaborgovanist': sayReply("На счете Водафон задолженность $message[5]",2,'Баланс МТС'); sg('MTSCounter.counter',"-$message[5]"); break; default: say("Полученю Ю С С Д сообщение",2); say($params['MessageLine0'],2); break; } }
/** Array received form Asterisk: [Event] => DongleSMSStatus [Privilege] => call,all [Device] => dongle0 [ID] => 0x7f8350001710 [Status] => Sent */
/** Array received form Asterisk: [Event] => ChannelReload [Privilege] => system,all [ChannelType] => SIP [ReloadReason] => RELOAD (Channel module reload) [Registry_Count] => 0 [Peer_Count] => 0 */
/** Array received form Asterisk: [Event] => Shutdown [Privilege] => system,all [Shutdown] => Cleanly [Restart] => False */
/** Array received form Asterisk: [Event] => NewCallerid [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-0000000e;1 [CallerIDNum] => ussd [CallerIDName] => dongle0 [Uniqueid] => 1458926768.28 [CID-CallingPres] => 0 (Presentation Allowed, Not Screened) */
/** Array received form Asterisk: [Event] => DonglePortFail [Privilege] => call,all [Device] => /dev/ttyUSB3 [Message] => Open Failed [ErrorCode] => 13 */
/** Array received form Asterisk: [Event] => BridgeCreate [Privilege] => call,all [BridgeUniqueid] => 8508ce8b-88d5-4a96-ad6f-71d7ea6eb85f [BridgeType] => parking [BridgeTechnology] => holding_bridge [BridgeCreator] => Parking [BridgeName] => default [BridgeNumChannels] => 0 */
/** Array received form Asterisk: [Event] => MusicOnHoldStop [Privilege] => call,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380414722080 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1491481336.12 [Linkedid] => 1491481336.12 */
/** Array received form Asterisk: [Event] => DialState [Privilege] => call,all [Channel] => SIP/211-00000002 [ChannelState] => 4 [ChannelStateDesc] => Ring [CallerIDNum] => 211 [CallerIDName] => Phone1 [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => DialPlanMain [Exten] => 0504453705 [Priority] => 2 [Uniqueid] => 1519153368.14 [Linkedid] => 1519153368.14 [DestChannel] => Dongle/dongle0-0100000000 [DestChannelState] => 3 [DestChannelStateDesc] => Dialing [DestCallerIDNum] => 0504453705 [DestCallerIDName] => <unknown> [DestConnectedLineNum] => 211 [DestConnectedLineName] => Phone1 [DestLanguage] => ru [DestAccountCode] => [DestContext] => dongle-incoming [DestExten] => 0504453705 [DestPriority] => 1 [DestUniqueid] => 1519153369.15 [DestLinkedid] => 1519153368.14 [DialStatus] => PROGRESS */
/** Array received form Asterisk: [Event] => QueueCallerJoin [Privilege] => agent,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380414722080 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1491481336.12 [Linkedid] => 1491481336.12 [Queue] => local [Position] => 1 [Count] => 1 */
/** Array received form Asterisk: [Event] => MusicOnHoldStart [Privilege] => call,all [Channel] => Dongle/dongle0-0100000000 [ChannelState] => 6 [ChannelStateDesc] => Up [CallerIDNum] => +380414722080 [CallerIDName] => MTS [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [Language] => ru [AccountCode] => [Context] => dongle-incoming [Exten] => 80505498409 [Priority] => 7 [Uniqueid] => 1491481336.12 [Linkedid] => 1491481336.12 [Class] => default */
/** Array received form Asterisk: [Event] => Leave [Privilege] => call,all [Channel] => Dongle/dongle0-0100000001 [Queue] => local [Count] => 0 [Position] => 1 [Uniqueid] => 1459415001.44 */
/** Array received form Asterisk: [Event] => DongleCallStateChange [Privilege] => call,all [Device] => dongle0 [CallIdx] => 1 [NewState] => dialing */
/** Array received form Asterisk: [Event] => DongleCEND [Privilege] => call,all [Device] => dongle0 [CallIdx] => 1 [Duration] => 0 [EndStatus] => 29 [CCCause] => 16 */
/** Array received form Asterisk: [Event] => DongleNewSMSBase64 [Privilege] => call,all [Device] => dongle0 [From] => +38050XXXXXXX [Message] => 0KLQtdGB0YCx0YnQtdC90LjQuQ== */
/** Array received form Asterisk: [Event] => JabberStatus [Privilege] => user,all [Account] => asterisk [JID] => XYZ@com.com [Resource] => MessagingA8306b836 [Status] => 3 [Priority] => 0 [Description] => */
/** Array received form Asterisk: [Event] => Join [Privilege] => call,all [Channel] => Dongle/dongle0-0100000001 [CallerIDNum] => +38050XXXXXXX [CallerIDName] => MTS [ConnectedLineNum] => unknown [ConnectedLineName] => unknown [Queue] => local [Position] => 1 [Count] => 1 [Uniqueid] => 1459415001.44 */
/** Array received form Asterisk: [Event] => MusicOnHold [Privilege] => call,all [State] => Start [Channel] => Dongle/dongle0-0100000001 [UniqueID] => 1459415001.44 [Class] => default */
/** Array received form Asterisk: [Event] => QueueCallerAbandon [Privilege] => agent,all [Queue] => local [Uniqueid] => 1459415001.44 [Position] => 1 [OriginalPosition] => 1 [HoldTime] => 20 */
/** Array received form Asterisk: [Event] => DongleStatus [Privilege] => call,all [Device] => dongle0 [Status] => Used */
/** Array received form Asterisk: [Event] => Dial [Privilege] => call,all [SubEvent] => Begin [Channel] => SCCP/XXXXX-00000009 [Destination] => Dongle/dongle0-0100000000 [CallerIDNum] => XXXXX [CallerIDName] => Hall [ConnectedLineNum] => <unknown> [ConnectedLineName] => <unknown> [UniqueID] => 1458927105.40 [DestUniqueID] => 1458927114.41 [Dialstring] => dongle0/holdother:+380XXXXXXX */
/** Array received form Asterisk: [Event] => DeviceStatus [Privilege] => call,all [ChannelType] => SCCP [ChannelObjectType] => Device [DeviceStatus] => UNREGISTERED [SCCPDevice] => SEPXXXXXXXX */
/** Array received form Asterisk: [Event] => PeerStatus [Privilege] => call,all [ChannelType] => SCCP [ChannelObjectType] => DeviceLine [PeerStatus] => DETACHED [SCCPDevice] => SEPXXXXXXXX [SCCPLine] => XXXXX [SCCPLineName] => Hall [SubscriptionId] => [SubscriptionName] => */
/** Array received form Asterisk: [Event] => MessageWaiting [Privilege] => call,all [Mailbox] => XXXXX@default [Waiting] => 0 */ // say('На автоответчик записано сообщение',2);
/** Array received form Asterisk: [Event] => ChannelUpdate [Privilege] => system,all [Channel] => SCCP/XXXXX-00000001 [Uniqueid] => 1458926905.32 [Channeltype] => SCCP [SCCPdevice] => SEPXXXXXXXX [SCCPline] => XXXXX [SCCPcallid] => 00000001 [SCCPCallDesignator] => SCCP/XXXXX-00000001 */
/** Array received form Asterisk: [Event] => Newstate [Privilege] => call,all [Channel] => SIP/XXXXX-00000001 [ChannelState] => 2 [ChannelStateDesc] => OffHook [CallerIDNum] => XXXXX [CallerIDName] => Hall [ConnectedLineNum] => [ConnectedLineName] => [Uniqueid] => 1458926905.32 */
/** Array received form Asterisk: [Event] => QueueMemberStatus [Privilege] => agent,all [Queue] => local [Location] => SIP/XXXXX [MemberName] => SIP/XXXXX [StateInterface] => SIP/XXXXX [Membership] => static [Penalty] => 1 [CallsTaken] => 0 [LastCall] => 0 [Status] => 2 [Paused] => 0 */
/** Array received form Asterisk: [Event] => DongleNewSMS [Privilege] => call,all [Device] => dongle0 [From] => +38050XXXXXXX [LineCount] => 1 [MessageLine0] => Тестовое сообщение */ if(!empty($params['MessageLine0'])) { $message = explode(" ", $params['MessageLine0']); switch($message[2]) { case 'popovneno': say("Счет Водафон пополнен на $message[4] гривен",2); $params = array ( "command" => "Command", "option" => "dongle ussd dongle0 *110*10#", ); callMethod ('Asterisk.Action',$params); break; default: for ($i = $params['LineCount']; $i > 0; $i--) { $SMS = $SMS.$params['MessageLine0']; } // say ("Получено СМС. Отправитель ".$params['From'],2); say ($SMS,2); break; } } $SMS = '';
/** Array received form Asterisk: [Event] => Newchannel [Privilege] => call,all [Channel] => Local/ussd@dongle-incoming-0000000e;1 [ChannelState] => 0 [ChannelStateDesc] => Down [CallerIDNum] => [CallerIDName] => [AccountCode] => [Exten] => ussd [Context] => dongle-incoming [Uniqueid] => 1458926768.28 */ // say('Входящий звонок с номера '.$params['CallerIDNum'],2);
$command = $params['command']; $option = $params['option']; $amihost = $this->getProperty('amihost'); $amiport = $this->getProperty('amiport'); $amiusername = $this->getProperty('amiusername'); $amipassword = $this->getProperty('amipassword'); include_once ('./lib/phpagi/phpagi-asmanager.php'); if (!$params['command']) { DebMes (" Asterisk : Can't process empty command"); exit; } if (!$amihost) { DebMes (" Asterisk : Can't process command - AMI is not configured"); exit; } $com_man = new AGI_AsteriskManager(); if (!$com_man->connect($amihost.":".$amiport, $amiusername, $amipassword)) { DebMes (" Asterisk : Can't connect to AMI "); exit; } $response = $com_man->$command($option); $com_man->disconnect(); if ($response['Response'] != 'Success') { DebMes (" Asterisk : Can't process command => ".$response['Message']); } return $response; // For debug // DebMes (" Asterisk : Process command $command"); // DebMes ($response);
/** Array received form Asterisk: [Event] => DongleNewCMGR [Privilege] => call,all [Device] => dongle0 [Message] => +CMGR: 0,,55\r\3040C918352404220433E043E043104490435043D04380435 */
/** Array received form Asterisk: [Event] => JabberEvent [Privilege] => user,all [Account] => XXX [Packet] => */
/** Array received form Asterisk: [Event] => FullyBooted [Privilege] => system,all [Status] => Fully Booted */
/** Array received form Asterisk: [Event] => ModuleLoadReport [Privilege] => system,all [ModuleLoadStatus] => Done [ModuleSelection] => All [ModuleCount] => 199 */
Class properties:
Class methods:
say(timeNow(),1); //START openweather module $updateTime = gg('ow_setting.updateTime'); if($updateTime > 0) { $count = gg('ow_setting.countTime'); if($count >= $updateTime) { include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $app_openweather = new app_openweather(); $app_openweather->get_weather(gg('ow_city.id')); sg('ow_setting.countTime', 1); } else { $count++; sg('ow_setting.countTime', $count); } } // END openweather module
Class objects:
$h=(int)date('G',time()); $m=date('i',time()); setGlobal("timeNow",date('H:i')); //Обновляем хэш zoneminder runScriptSafe('ZM-Hash'); // Читаем состояние сенсоров сервера //runScriptSafe('sensorsPC'); runScriptSafe('sensorsBPI'); // Проверяем скорость интернет if ($m==0) { runScriptSafe('speedTest'); } // Активизируем Режим "Не беспокоить" if (timeIs("20:01")) { callMethod("QuietMode.activate"); } elseif (timeIs("09:59")) { callMethod("QuietMode.deactivate"); }; // Активизируем режим Экономии if (timeIs("22:01")) { callMethod("EconomMode.activate"); } elseif (timeIs("05:01")) { callMethod("EconomMode.deactivate"); }; $homeStatus=date('H:i'); if (getGlobal("NobodyHomeMode.active")) { $homeStatus.=" Дома никого."; } else { $homeStatus.=" Дома кто-то есть."; }; $homeStatus.=' '.getGlobal("Security.stateDetails"); $homeStatus.=' '.getGlobal("System.stateDetails"); $homeStatus.=' '.getGlobal("Communication.stateDetails"); setGlobal("HomeStatus",$homeStatus);
Class properties:
Class methods:
Class properties:
Class objects:
Class properties:
Class methods:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
if ($this->getProperty('network') == 'wifi') { $this->setProperty("NetworkPic", 'fa fa-wifi'); } else { $this->setProperty("NetworkPic", 'fa fa-podcast'); }
@include_once(ROOT . 'languages/devices_' . SETTINGS_SITE_LANGUAGE . '.php'); @include_once(ROOT . 'languages/devices_default' . '.php'); $ot = $this->object_title; $updatedTime = $this->getProperty('CoordinatesUpdatedTimestamp'); $passed = time() - $updatedTime; $newTimeout=0; if ($passed<10) { $newTimeout = 10; $this->setProperty('updatedText',LANG_DEVICES_PASSED_NOW); } elseif ($passed<60) { $newTimeout = 10; $this->setProperty('updatedText',$passed.' '.LANG_DEVICES_PASSED_SECONDS_AGO); } elseif ($passed<60*60) { $newTimeout = 60; $this->setProperty('updatedText',round($passed/60).' '.LANG_DEVICES_PASSED_MINUTES_AGO); /* } elseif ($passed<12*60*60) { $newTimeout = 60 * 60; $this->setProperty('updatedText',round($passed/60/60).' '.LANG_DEVICES_PASSED_HOURS_AGO); */ } elseif ($passed<20*60*60) { //just time $newTimeout = 60 * 60; $this->setProperty('updatedText',date('H:i',$updatedTime)); } else { //time and date $this->setProperty('updatedText',date('Y-m-d H:i',$updatedTime));// } if ($newTimeout > 0) { setTimeOut($ot.'_updateTime','callMethod("'.$ot.'.setUpdatedText");',$newTimeout); }
$charg=$this->getProperty('Charging'); $level=$this->getProperty('BattLevel'); if ($charg==1) { $this->setProperty("BattPic",'fa fa-plug'); $this->setProperty("BattColor", '#7CFC00'); } else { if ($level > 88 && $level <= 100) { $this->setProperty("battPic",'fa fa-battery-full'); $this->setProperty("BattColor", '#7CFC00'); } else if ($level > 62 && $level <= 88) { $this->setProperty("battPic",'fa fa-battery-three-quarters'); $this->setProperty("BattColor", '#7CFC00'); } else if ($level > 37 && $level <= 62) { $this->setProperty("battPic",'fa fa-battery-half'); $this->setProperty("BattColor", '#FF8C00'); } else if ($level > 12 && $level <= 37) { $this->setProperty("battPic",'fa fa-battery-quarter'); $this->setProperty("BattColor", '#800000'); } else if ($level < 12) { $this->setProperty("battPic",'fa fa-battery-empty'); $this->setProperty("BattColor", '#800000'); } }
$this->setProperty('atHome',0); $this->setProperty('seenAt',"В пути"); $this->setProperty('CoordinatesUpdated',getGlobal("timeNow")); //Получаем список пользователей $objects=getObjectsByClass("Users"); foreach($objects as $obj) { $users[]=$obj['TITLE']; }; //Включаем режим "Никого нет дома" если никого нет $uah = 0; foreach($users as $user) { $uah=$uah+getGlobal("$user.atHome"); }; if (($uah == 0) && (!getGlobal("NobodyHomeMode.active"))) { say("Все жители ушли.",1); callMethod("NobodyHomeMode.activate"); }; //Ставим на охрану если никого нет //if ((getGlobal("NobodyHomeMode.active")) && (!getGlobal("SecurityArmedMode.active"))) { // say("Нужно защитить дом.",1); // callMethod("SecurityArmedMode.activate"); //}; //Экономим если никого нет if ((getGlobal("NobodyHomeMode.active")) && (!getGlobal("EconomMode.active"))) { say("Можно немного сэкономить.",1); callMethod("EconomMode.activate"); };
$this->setProperty('atHome',1); $this->setProperty('seenAt',"Дома"); $this->setProperty('CoordinatesUpdated',getGlobal("timeNow")); //Получаем список пользователей $objects=getObjectsByClass("Users"); foreach($objects as $obj) { $users[]=$obj['TITLE']; }; //Выключаем режим "Никого нет дома" если был включен if (getGlobal("NobodyHomeMode.active")) { // say("Жители вернулись.",1); callMethod("NobodyHomeMode.deactivate"); }; //Снимаем с охраны если она включена if (getGlobal("SecurityArmedMode.active")) { // say("Снимаю с охраны.",1); callMethod("SecurityArmedMode.deactivate"); }; //Выключаем экономию если включена if (getGlobal("EconomMode.active")) { // say("Хватит экономить.",1); callMethod("EconomMode.deactivate"); };
Class objects:
, Украина
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Public agreement
SmartLiving