From f94e171efe98f27679f36961f352cfe7359190ec Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 26 Jul 2015 18:37:14 +0200 Subject: [PATCH] add getPhoneBookEntrys --- SpeedportHybrid.class.php | 17 +++++++++++++++++ tests/phonebookentrys.php | 4 ++++ tests/reconnect.php | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tests/phonebookentrys.php diff --git a/SpeedportHybrid.class.php b/SpeedportHybrid.class.php index 758385e..ad3c171 100644 --- a/SpeedportHybrid.class.php +++ b/SpeedportHybrid.class.php @@ -241,6 +241,23 @@ class SpeedportHybrid { } } + /** + * get phone book entrys + * + * @return array + */ + public function getPhoneBookEntrys () { + $data = $this->getData('PhoneBook'); + $data = $this->getValues($data); + + if (isset($data['addbookentry'])) { + return $data['addbookentry']; + } + else { + return array(); + } + } + /** * get uptime based on online (connection) time * diff --git a/tests/phonebookentrys.php b/tests/phonebookentrys.php new file mode 100644 index 0000000..7d2dc9f --- /dev/null +++ b/tests/phonebookentrys.php @@ -0,0 +1,4 @@ +getPhoneBookEntrys()); +$sp->logout(); diff --git a/tests/reconnect.php b/tests/reconnect.php index 3934d37..9080228 100644 --- a/tests/reconnect.php +++ b/tests/reconnect.php @@ -1,6 +1,6 @@ changeConnectionStatus('offline')); +print_r($sp->changeDSLStatus('offline')); print_r($sp->reconnectLte()); -print_r($sp->changeConnectionStatus('online')); +print_r($sp->changeDSLStatus('online')); $sp->logout(); -- 2.20.1