From: Stricted Date: Sun, 28 Jun 2015 06:37:48 +0000 (+0200) Subject: add getMissedCalls X-Git-Tag: 1.0.0~19 X-Git-Url: https://git.stricted.de/?p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git;a=commitdiff_plain;h=a35e3e67ef4f11757bed8545bef5745b150da2ef add getMissedCalls --- diff --git a/speedport.class.php b/speedport.class.php index d54dd21..fe2b8ae 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -201,6 +201,24 @@ class speedport { return explode("\n", $data['body']); } + /** + * get the Missed Calls from router + * + * @return array + */ + public function getMissedCalls() { + $path = 'data/Syslog.json'; + $fields = array('exporttype' => '1'); + $cookie = 'challengev='.$this->challenge.'; '.$this->session; + $data = $this->sentRequest($path, $fields, $cookie); + + if (empty($data['body'])) { + throw new Exception('unable to get syslog data'); + } + + return explode("\n", $data['body']); + } + /** * sends the request to router * diff --git a/tests/missedcalls.php b/tests/missedcalls.php new file mode 100644 index 0000000..6aedb33 --- /dev/null +++ b/tests/missedcalls.php @@ -0,0 +1,4 @@ +getMissedCalls()); +$sp->logout();