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

index d54dd2140f17b1c5feeac6b24e5d588f74a6a269..fe2b8aebc6a70956273680a978d7187769728899 100644 (file)
@@ -201,6 +201,24 @@ class speedport {
                return explode("\n", $data['body']);
        }
        
+       /**
+        * get the Missed Calls from router
+        * 
+        * @return      array
+        */
+       public function getMissedCalls() {
+               $path = 'data/Syslog.json';
+               $fields = array('exporttype' => '1');
+               $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/missedcalls.php b/tests/missedcalls.php
new file mode 100644 (file)
index 0000000..6aedb33
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+require_once('config.php');
+print_r($sp->getMissedCalls());
+$sp->logout();