From: Stricted Date: Sun, 28 Jun 2015 06:41:25 +0000 (+0200) Subject: add getDialedCalls X-Git-Tag: 1.0.0~17 X-Git-Url: https://git.stricted.de/?p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git;a=commitdiff_plain;h=abf641bba623c973fbf2db7d52eb8776fc151304 add getDialedCalls --- 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();