From 15260eebf34ac18f1a11824f108e6621ad5e4ed5 Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 28 Jun 2015 08:39:26 +0200 Subject: [PATCH] add getTakenCalls --- speedport.class.php | 18 ++++++++++++++++++ tests/takencalls.php | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 tests/takencalls.php diff --git a/speedport.class.php b/speedport.class.php index fe2b8ae..6facff6 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -219,6 +219,24 @@ class speedport { return explode("\n", $data['body']); } + /** + * get the Taken Calls from router + * + * @return array + */ + public function getTakenCalls() { + $path = 'data/Syslog.json'; + $fields = array('exporttype' => '2'); + $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/takencalls.php b/tests/takencalls.php new file mode 100644 index 0000000..747a7c5 --- /dev/null +++ b/tests/takencalls.php @@ -0,0 +1,4 @@ +getTakenCalls()); +$sp->logout(); -- 2.20.1