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

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