From abf641bba623c973fbf2db7d52eb8776fc151304 Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 28 Jun 2015 08:41:25 +0200 Subject: [PATCH] add getDialedCalls --- speedport.class.php | 22 ++++++++++++++++++++-- tests/dialedcalls.php | 4 ++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/dialedcalls.php diff --git a/speedport.class.php b/speedport.class.php index 6facff6..17155c0 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -207,7 +207,7 @@ class speedport { * @return array */ public function getMissedCalls() { - $path = 'data/Syslog.json'; + $path = 'data/ExportMissedCalls.json'; $fields = array('exporttype' => '1'); $cookie = 'challengev='.$this->challenge.'; '.$this->session; $data = $this->sentRequest($path, $fields, $cookie); @@ -225,7 +225,7 @@ class speedport { * @return array */ public function getTakenCalls() { - $path = 'data/Syslog.json'; + $path = 'data/ExportTakenCalls.json'; $fields = array('exporttype' => '2'); $cookie = 'challengev='.$this->challenge.'; '.$this->session; $data = $this->sentRequest($path, $fields, $cookie); @@ -237,6 +237,24 @@ class speedport { return explode("\n", $data['body']); } + /** + * get the Dialed Calls from router + * + * @return array + */ + public function getDialedCalls() { + $path = 'data/ExportDialedCalls.json'; + $fields = array('exporttype' => '3'); + $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/dialedcalls.php b/tests/dialedcalls.php new file mode 100644 index 0000000..59cb1e5 --- /dev/null +++ b/tests/dialedcalls.php @@ -0,0 +1,4 @@ +getDialedCalls()); +$sp->logout(); -- 2.20.1