| 135 | | $object->asterisk_host = "localhost"; |
|---|
| 136 | | $object->asterisk_port = "5038"; |
|---|
| 137 | | $object->asterisk_login = "isymphony"; |
|---|
| 138 | | $object->asterisk_password = "ismanager*con"; |
|---|
| 139 | | |
|---|
| 140 | | if($object->update()) { |
|---|
| 141 | | isymphony_write_to_file($debugLogFile, "Updated location default\n"); |
|---|
| 142 | | } else { |
|---|
| 143 | | isymphony_write_to_file($errorLogFile, "(Update location)" . $ISERROR. "\n"); |
|---|
| | 137 | |
|---|
| | 138 | //Check if update needs to occur |
|---|
| | 139 | if(($object->asterisk_host != "localhost") || ($object->asterisk_port != "5038") || ($object->asterisk_login != "isymphony") || ($object->asterisk_password != "ismanager*con")) { |
|---|
| | 140 | |
|---|
| | 141 | $object->asterisk_host = "localhost"; |
|---|
| | 142 | $object->asterisk_port = "5038"; |
|---|
| | 143 | $object->asterisk_login = "isymphony"; |
|---|
| | 144 | $object->asterisk_password = "ismanager*con"; |
|---|
| | 145 | |
|---|
| | 146 | if($object->update()) { |
|---|
| | 147 | isymphony_write_to_file($debugLogFile, "Updated location default\n"); |
|---|
| | 148 | } else { |
|---|
| | 149 | isymphony_write_to_file($errorLogFile, "(Update location)" . $ISERROR. "\n"); |
|---|
| | 150 | } |
|---|
| 173 | | $object->originating_context = "from-internal"; |
|---|
| 174 | | $object->redirecting_context = "from-internal"; |
|---|
| 175 | | |
|---|
| 176 | | if($object->update()) { |
|---|
| 177 | | isymphony_write_to_file($debugLogFile, "Updated tenant default\n"); |
|---|
| 178 | | } else { |
|---|
| 179 | | isymphony_write_to_file($errorLogFile, "(Update tenant)" . $ISERROR. "\n"); |
|---|
| 180 | | } |
|---|
| | 180 | |
|---|
| | 181 | //Check if update needs to occur |
|---|
| | 182 | if(($object->originating_context != "from-internal") || ($object->redirecting_context != "from-internal")) { |
|---|
| | 183 | |
|---|
| | 184 | $object->originating_context = "from-internal"; |
|---|
| | 185 | $object->redirecting_context = "from-internal"; |
|---|
| | 186 | |
|---|
| | 187 | if($object->update()) { |
|---|
| | 188 | isymphony_write_to_file($debugLogFile, "Updated tenant default\n"); |
|---|
| | 189 | } else { |
|---|
| | 190 | isymphony_write_to_file($errorLogFile, "(Update tenant)" . $ISERROR. "\n"); |
|---|
| | 191 | } |
|---|
| | 192 | } |
|---|
| 258 | | $object->name = $extensionDispalyName; |
|---|
| 259 | | $object->voice_mail = $freePBXUser[0]; |
|---|
| 260 | | $object->peer = $freePBXDeviceInfo['dial']; |
|---|
| 261 | | |
|---|
| 262 | | if($object->update()) { |
|---|
| 263 | | isymphony_write_to_file($debugLogFile, "Updated extension {$freePBXUser[0]}\n"); |
|---|
| 264 | | } else { |
|---|
| 265 | | isymphony_write_to_file($errorLogFile, "(Update extension)" . $ISERROR. "\n"); |
|---|
| 266 | | } |
|---|
| | 270 | //Check if update needs to occur |
|---|
| | 271 | if(($object->name != $extensionDispalyName) || ($object->voice_mail != $freePBXUser[0]) || ($object->peer != $freePBXDeviceInfo['dial'])) { |
|---|
| | 272 | |
|---|
| | 273 | $object->name = $extensionDispalyName; |
|---|
| | 274 | $object->voice_mail = $freePBXUser[0]; |
|---|
| | 275 | $object->peer = $freePBXDeviceInfo['dial']; |
|---|
| | 276 | |
|---|
| | 277 | if($object->update()) { |
|---|
| | 278 | isymphony_write_to_file($debugLogFile, "Updated extension {$freePBXUser[0]}\n"); |
|---|
| | 279 | } else { |
|---|
| | 280 | isymphony_write_to_file($errorLogFile, "(Update extension)" . $ISERROR. "\n"); |
|---|
| | 281 | } |
|---|
| | 282 | } |
|---|
| 367 | | $object->name = $queueDispalyName; |
|---|
| 368 | | $object->queue_val = $freePBXQueue[0]; |
|---|
| 369 | | $object->extension_val = $freePBXQueue[0]; |
|---|
| 370 | | $object->context = "from-internal"; |
|---|
| 371 | | |
|---|
| 372 | | if($object->update()) { |
|---|
| 373 | | isymphony_write_to_file($debugLogFile, "Updated queue {$queueDispalyName}\n"); |
|---|
| 374 | | } else { |
|---|
| 375 | | isymphony_write_to_file($errorLogFile, "(Update queue)" . $ISERROR. "\n"); |
|---|
| 376 | | } |
|---|
| | 383 | //Check if update needs to occur |
|---|
| | 384 | if(($object->name != $queueDispalyName) || ($object->queue_val != $freePBXQueue[0]) || ($object->extension_val != $freePBXQueue[0]) || ($object->context != "from-internal")) { |
|---|
| | 385 | |
|---|
| | 386 | $object->name = $queueDispalyName; |
|---|
| | 387 | $object->queue_val = $freePBXQueue[0]; |
|---|
| | 388 | $object->extension_val = $freePBXQueue[0]; |
|---|
| | 389 | $object->context = "from-internal"; |
|---|
| | 390 | |
|---|
| | 391 | if($object->update()) { |
|---|
| | 392 | isymphony_write_to_file($debugLogFile, "Updated queue {$queueDispalyName}\n"); |
|---|
| | 393 | } else { |
|---|
| | 394 | isymphony_write_to_file($errorLogFile, "(Update queue)" . $ISERROR. "\n"); |
|---|
| | 395 | } |
|---|
| | 396 | } |
|---|
| 447 | | |
|---|
| 448 | | $object->name = $conferenceRoomsDispalyName; |
|---|
| 449 | | $object->predefined = "true"; |
|---|
| 450 | | $object->room_number = $freePBXConferenceRoom[0]; |
|---|
| 451 | | $object->extension_val = $freePBXConferenceRoom[0]; |
|---|
| 452 | | $object->context = "from-internal"; |
|---|
| 453 | | |
|---|
| 454 | | if($object->update()) { |
|---|
| 455 | | isymphony_write_to_file($debugLogFile, "Updated conference room {$conferenceRoomsDispalyName}\n"); |
|---|
| 456 | | } else { |
|---|
| 457 | | isymphony_write_to_file($errorLogFile, "(Update conference room)" . $ISERROR. "\n"); |
|---|
| | 467 | |
|---|
| | 468 | //Check if update needs to occur |
|---|
| | 469 | if(($object->name != $conferenceRoomsDispalyName) || ($object->predefined != "true") || ($object->room_number != $freePBXConferenceRoom[0]) || ($object->extension_val != $freePBXConferenceRoom[0]) || ($object->context != "from-internal")) { |
|---|
| | 470 | |
|---|
| | 471 | $object->name = $conferenceRoomsDispalyName; |
|---|
| | 472 | $object->predefined = "true"; |
|---|
| | 473 | $object->room_number = $freePBXConferenceRoom[0]; |
|---|
| | 474 | $object->extension_val = $freePBXConferenceRoom[0]; |
|---|
| | 475 | $object->context = "from-internal"; |
|---|
| | 476 | |
|---|
| | 477 | if($object->update()) { |
|---|
| | 478 | isymphony_write_to_file($debugLogFile, "Updated conference room {$conferenceRoomsDispalyName}\n"); |
|---|
| | 479 | } else { |
|---|
| | 480 | isymphony_write_to_file($errorLogFile, "(Update conference room)" . $ISERROR. "\n"); |
|---|
| | 481 | } |
|---|