Filter for specific Events
This commit is contained in:
parent
6f6eb88ebb
commit
4fce9a4565
|
|
@ -127,6 +127,13 @@
|
||||||
//loop through the switch events
|
//loop through the switch events
|
||||||
$cmd = "event json ALL";
|
$cmd = "event json ALL";
|
||||||
$result = $socket->request($cmd);
|
$result = $socket->request($cmd);
|
||||||
|
if ($debug) { print_r($result); }
|
||||||
|
|
||||||
|
//filter for specific events
|
||||||
|
$cmd = "filter Event-Name CUSTOM";
|
||||||
|
$result = $socket->request($cmd);
|
||||||
|
if ($debug) { print_r($result); }
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
//check pending unblock requests
|
//check pending unblock requests
|
||||||
|
|
@ -148,8 +155,12 @@
|
||||||
if ($socket->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
|
if ($socket->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
|
||||||
$cmd = "event json ALL";
|
$cmd = "event json ALL";
|
||||||
$result = $socket->request($cmd);
|
$result = $socket->request($cmd);
|
||||||
echo "Re-connected to event socket\n";
|
if ($debug) { print_r($result); }
|
||||||
|
|
||||||
|
$cmd = "filter Event-Name CUSTOM";
|
||||||
|
$result = $socket->request($cmd);
|
||||||
|
if ($debug) { print_r($result); }
|
||||||
|
echo "Re-connected to event socket\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//sleep and then attempt to reconnect
|
//sleep and then attempt to reconnect
|
||||||
|
|
@ -168,7 +179,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug info
|
//debug info
|
||||||
//view_array($json_array, false);
|
if ($debug) {
|
||||||
|
print_r($json_array);
|
||||||
|
}
|
||||||
|
|
||||||
//registration failed - block IP address unless they are registered,
|
//registration failed - block IP address unless they are registered,
|
||||||
if (is_array($json_array) && $json_array['Event-Subclass'] == 'sofia::register_failure') {
|
if (is_array($json_array) && $json_array['Event-Subclass'] == 'sofia::register_failure') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue