3 * @author Jan Altensen (Stricted)
4 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
5 * @copyright 2015 Jan Altensen (Stricted)
9 * get phone book entrys
13 public function getPhoneBookEntrys () {
14 $data = $this->getData('PhoneBook');
15 $data = $this->getValues($data);
17 if (isset($data['addbookentry'])) {
18 return $data['addbookentry'];
26 * add Phone Book Entry
29 * @param string $firstname
30 * @param string $private
32 * @param string $mobile
37 public function addPhoneBookEntry ($name, $firstname, $private, $work, $mobile, $id = -1) {
40 $path = 'data/PhoneBook.json';
41 $fields = array('csrf_token' => $this->token
,
44 'phonebook_name' => $name,
45 'phonebook_vorname' => $firstname,
46 'phonebook_number_p' => $private,
47 'phonebook_number_a' => $work,
48 'phonebook_number_m' => $mobile
51 $data = $this->sentRequest($path, $fields, true);
52 $data = $this->getValues($data['body']);
54 if ($data['status'] == 'ok') {
58 throw new RouterException('can not add/edit Phone Book Entry');
63 * edit Phone Book Entry
67 * @param string $firstname
68 * @param string $private
70 * @param string $mobile
74 public function changePhoneBookEntry ($id, $name, $firstname, $private, $work, $mobile) {
75 return $this->addPhoneBookEntry($name, $firstname, $private, $work, $private, $id);
79 * delete Phone Book Entry
85 public function deletePhoneBookEntry ($id) {
88 $path = 'data/PhoneBook.json';
89 $fields = array('csrf_token' => $this->token
,
91 'deleteEntry' => 'delete'
94 $data = $this->sentRequest($path, $fields, true);
95 $data = $this->getValues($data['body']);
97 if ($data['status'] == 'ok') {
101 throw new RouterException('can not delete Phone Book Entry');
106 * get the Missed Calls from router
110 public function getMissedCalls() {
111 $data = $this->getData('PhoneCalls');
112 $data = $this->getValues($data);
114 if (isset($data['addmissedcalls'])) {
115 return $data['addmissedcalls'];
123 * get the Taken Calls from router
127 public function getTakenCalls() {
128 $data = $this->getData('PhoneCalls');
129 $data = $this->getValues($data);
131 if (isset($data['addtakencalls'])) {
132 return $data['addtakencalls'];
140 * get the Dialed Calls from router
144 public function getDialedCalls() {
145 $data = $this->getData('PhoneCalls');
146 $data = $this->getValues($data);
148 if (isset($data['adddialedcalls'])) {
149 return $data['adddialedcalls'];