Exemple #1
0
         # Get Current value
         $fm = Aastra_manage_followme_Asterisk($user, 'get_all');
         # Move up the element
         $temp = $fm['grplist'][$selection - 1];
         $fm['grplist'][$selection - 1] = $fm['grplist'][$selection];
         $fm['grplist'][$selection] = $temp;
         Aastra_manage_followme_Asterisk($user, 'set_grplist', $fm['grplist']);
     }
     break;
     # Move Down
 # Move Down
 case 'down_grplist':
     # Back to the input screen
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     $object->AddEntry($XML_SERVER . '&action=change_grplist&selection=' . ($selection + 1));
     # Get Current value
     $fm = Aastra_manage_followme_Asterisk($user, 'get_all');
     # Check index
     if ($selection == count($fm['grplist']) - 1) {
         $object->setBeep();
     } else {
         # Move down the element
         $temp = $fm['grplist'][$selection];
         $fm['grplist'][$selection] = $fm['grplist'][$selection + 1];
         $fm['grplist'][$selection + 1] = $temp;
         Aastra_manage_followme_Asterisk($user, 'set_grplist', $fm['grplist']);
     }
     break;
     # Update idle screen message status
 # Update idle screen message status
         # Prepare the requests for the configuration
         $object = new AastraIPPhoneExecute();
         $object->setTriggerDestroyOnExit();
         for ($i = 1; $i <= $last; $i++) {
             $object->addEntry($XML_SERVER . '&extension=' . $extension . '&action=configuration&page=' . $i);
         }
         # Special case for 6739i before 3.2.1
         if ($header['model'] == 'Aastra6739i' and !Aastra_test_phone_version('3.2.1,', 1)) {
             $object->addEntry($XML_SERVER_PATH . '/sync.php?action=register&user='******'&action=display');
         if (Aastra_is_fastreboot_supported()) {
             $object->AddEntry('Command: FastReboot');
         } else {
             $object->AddEntry('Command: Reset');
         }
     }
 } else {
     # Display error as a TextScreen
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     $object->setTitle(Aastra_get_label('Configuration error', $language));
     $object->setText(Aastra_get_label('Configuration file cannot be generated. Please contact your administrator.', $language));
     # Softkeys
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
Exemple #3
0
         $update = 0;
     }
     if ($action == 'register' and $status == AA_PRESENCE_AVAILABLE) {
         $update = 0;
     }
     # Prepare display update
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     # Status update
     if ($update == 1) {
         $object->addEntry($XML_SERVER . '&action=msg&state=' . $status);
         $object->setBeep();
         if ($key != '') {
             if (Aastra_is_ledcontrol_supported()) {
                 if ($status == AA_PRESENCE_AVAILABLE) {
                     $object->AddEntry('Led: ' . $key . '=off');
                 } else {
                     $object->AddEntry('Led: ' . $key . '=on');
                 }
             }
         }
     }
     # Add do nothing if necessary
     if ($update == 0) {
         # Do nothing
         $object->addEntry('');
     }
     break;
     # Save new presence status
 # Save new presence status
 case 'set_change':
Exemple #4
0
 require_once 'AastraIPPhoneExecute.class.php';
 $object = new AastraIPPhoneExecute();
 # Sync LED and idle screen
 $object->addEntry($XML_SERVER . '&action=check');
 $data = Aastra_get_user_context($user, 'cfwd');
 $last = $data['last'];
 $key = $data['key'];
 $data['last'] = $cf;
 if ($cf != $last) {
     Aastra_save_user_context($user, 'cfwd', $data);
     $object->setBeep();
     $object->addEntry($XML_SERVER . '&action=msg&value=' . $cf);
     if ($key != '') {
         if (Aastra_is_ledcontrol_supported()) {
             if ($cf == '') {
                 $object->AddEntry('Led: ' . $key . '=off');
             } else {
                 $object->AddEntry('Led: ' . $key . '=on');
             }
         }
     }
 }
 # Send a SIP Notification if mode is device and user
 if (!$AA_FREEPBX_USEDEVSTATE and $AA_FREEPBX_MODE == '2') {
     Aastra_propagate_changes_Asterisk($user, Aastra_get_userdevice_Asterisk($user), array('cfwd'));
 }
 # Display status screen
 if ($mode != '1' and $action != 'cancel2') {
     $object->AddEntry($XML_SERVER);
 }
 break;
Exemple #5
0
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     $object->addEntry('');
     break;
     # DEFAULT
 # DEFAULT
 case 'main':
 default:
     # IF update needed
     if ($update == 1) {
         # Process the update
         require_once 'AastraIPPhoneExecute.class.php';
         $object = new AastraIPPhoneExecute();
         # Update LED if needed
         if (Aastra_is_ledcontrol_supported()) {
             $object->AddEntry($XML_SERVER . '&action=led');
         }
         # Update status messages if needed
         $object->AddEntry($XML_SERVER . '&action=msg');
         # Update configuration
         $object->AddEntry($XML_SERVER . '&action=configuration');
         # Back to the main menu
         $object->AddEntry($XML_SERVER . '&default=' . $default . '&type=' . $type . '&page=' . $page . '&set=' . $set);
         # Notify the phone if needed
         if ($update_notify) {
             $object->AddEntry($XML_SERVER . '&action=notify');
         }
         # Workaround for 6739i
         if ($header['model'] == 'Aastra6739i') {
             $object->AddEntry($XML_SERVER_PATH . 'sync.php?user='******'&action=register');
         }
Exemple #6
0
     $object->addEntry($XML_SERVER . '?user='******'&action=check2');
 }
 if ($user != $last_user) {
     # Clear display
     if (Aastra_is_local_reset_supported()) {
         $object->addEntry('Command: ClearCallersList');
         $object->addEntry('Command: ClearDirectory');
         $object->addEntry('Command: ClearRedialList');
     }
     $object->addEntry($XML_SERVER . '?action=purge_msg');
 }
 if ($user == '') {
     if (Aastra_is_ledcontrol_supported()) {
         $cfwd = Aastra_get_user_context($device, 'cfwd');
         if ($cfwd['key'] != '') {
             $object->AddEntry('Led: ' . $cfwd['key'] . '=off');
         }
         $dnd = Aastra_get_user_context($device, 'dnd');
         if ($dnd['key'] != '') {
             $object->AddEntry('Led: ' . $dnd['key'] . '=off');
         }
         $daynight = Aastra_get_user_context($device, 'daynight');
         foreach ($daynight['key'] as $value) {
             $object->AddEntry('Led: ' . $value . '=off');
         }
         $away = Aastra_get_user_context($device, 'away');
         if ($away['key'] != '') {
             $object->AddEntry('Led: ' . $away['key'] . '=off');
         }
         $agent = Aastra_get_user_context($device, 'agent');
         if ($agent['key'] != '') {