add getDialedCalls
authorStricted <info@stricted.de>
Sun, 28 Jun 2015 06:41:25 +0000 (08:41 +0200)
committerStricted <info@stricted.de>
Sun, 28 Jun 2015 06:41:25 +0000 (08:41 +0200)
speedport.class.php
tests/dialedcalls.php [new file with mode: 0644]

index 6facff61ed6f354621f698eec1e9f4866adb8d6b..17155c0718205ea807c2e6f59d80fd035f51bd53 100644 (file)
@@ -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 (file)
index 0000000..59cb1e5
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+require_once('config.php');
+print_r($sp->getDialedCalls());
+$sp->logout();