Example #1
0
             $display = sprintf(Aastra_get_label('Night Mode (%d)', $language), $index);
         }
     } else {
         $display = '';
     }
     $object->addEntry($status_index, $display);
     break;
     # Key label
 # Key label
 case 'label':
     # Retrieve key
     $data = Aastra_get_user_context($user, 'daynight');
     $key = $data['key'][$index];
     # Update key label
     require_once 'AastraIPPhoneConfiguration.class.php';
     $object = new AastraIPPhoneConfiguration();
     if ($status == 1) {
         $object->addEntry($key . ' label', Aastra_get_label('Day Mode', $language));
     } else {
         $object->addEntry($key . ' label', Aastra_get_label('Night Mode', $language));
     }
     break;
     # LED (bug 6739i bug workaround)
 # LED (bug 6739i bug workaround)
 case 'led':
     # Retrieve key
     $data = Aastra_get_user_context($user, 'daynight');
     $key = $data['key'][$index];
     # Change LED if supported
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
Example #2
0
            }
        }
        break;
        # Configuration
    # Configuration
    case 'configuration':
        # Read MAC.cfg
        $array_temp = Aastra_readCFGfile(AASTRA_TFTP_DIRECTORY . '/' . $header['mac'] . '.cfg', '#', ':');
        $array_temp['']['sip line1 password'] = preg_replace('/"/', '', $array_temp['']['sip line1 password']);
        if (isset($array_temp['']['action uri registered'])) {
            $array_reg = array('action uri registered' => $array_temp['']['action uri registered']);
            unset($array_temp['']['action uri registered']);
            $array_temp[''] = array_merge($array_reg, $array_temp['']);
        }
        # Configuration XML object
        $object = new AastraIPPhoneConfiguration();
        # Send the partial configuration
        $index = 1;
        # Bug 3.2.1 send all the configuration twice
        $page = intval(($page - 1) / 2) + 1;
        foreach ($array_temp[''] as $key => $value) {
            if ($index >= ($page - 1) * AASTRA_MAXCONFIGURATIONS + 1 and $index <= $page * AASTRA_MAXCONFIGURATIONS) {
                $object->addEntry($key, preg_replace('/"/', '', $value));
            }
            $index++;
        }
        break;
}
# Display XML Object
$object->output();
exit;
Example #3
0
     $input->setFieldParameter('password');
     $input->setFieldSelection('2');
     $input->addSoftkey('10', 'Exit', 'SoftKey:Exit');
     $input->output();
     break;
 case 'execute':
     require_once 'AastraIPPhoneExecute.class.php';
     $execute = new AastraIPPhoneExecute();
     $execute->setTriggerDestroyOnExit();
     $execute->addEntry('Led: softkey1=on');
     $execute->addEntry('Dial:7001', 'no');
     $execute->output();
     break;
 case 'configuration':
     require_once 'AastraIPPhoneConfiguration.class.php';
     $configuration = new AastraIPPhoneConfiguration();
     $configuration->addEntry('softkey1 label', 'Test');
     $configuration->addEntry('softkey1 type', 'xml');
     $configuration->setTriggerDestroyOnExit();
     $configuration->output();
     break;
 case 'formattedtextscreen':
     require_once 'AastraIPPhoneFormattedTextScreen.class.php';
     $ftext = new AastraIPPhoneFormattedTextScreen();
     $ftext->setDestroyOnExit();
     $ftext->addLine('Formatted Screen', 'double', 'center', 'red');
     $ftext->setScrollStart();
     $ftext->addLine('Scrolled text1');
     $ftext->addLine('Scrolled text2');
     $ftext->addLine('Scrolled text3');
     $ftext->addLine('Scrolled text4');
Example #4
0
             $object->AddEntry('Command: ClearCallersList');
             $object->AddEntry('Command: ClearDirectory');
             $object->AddEntry('Command: ClearRedialList');
         }
         # Perform the logout
         $object->addEntry('Dial:logout');
     }
     break;
     # Dynamic configuration
 # Dynamic configuration
 case 'configuration':
     # Save config
     $array_config = Aastra_get_user_context($user, 'logout');
     # Configuration XML object
     require_once 'AastraIPPhoneConfiguration.class.php';
     $object = new AastraIPPhoneConfiguration();
     # Send the partial configuration
     $index = 1;
     # Bug 3.2.1 send all the configuration twice
     $page = intval(($page - 1) / 2) + 1;
     foreach ($array_config as $key => $value) {
         if ($index >= ($page - 1) * AASTRA_MAXCONFIGURATIONS + 1 and $index <= $page * AASTRA_MAXCONFIGURATIONS) {
             $object->addEntry($key, $value);
         }
         $index++;
     }
     break;
     # Logout
 # Logout
 case 'logout':
 case 'forced_logout':
Example #5
0
     $object = new AastraIPPhoneExecute();
     foreach ($temp[0] as $value) {
         $object->AddEntry('Led: ' . $value . '=off');
     }
     $object->AddEntry('');
     break;
     # UPDATE CONFIGURATION
 # UPDATE CONFIGURATION
 case 'configuration':
     # Retrieve session
     $array = Aastra_read_session('key');
     $temp = unserialize(base64_decode($array['keys']));
     # Update configuration
     if (count($temp[1]) != 0) {
         require_once 'AastraIPPhoneConfiguration.class.php';
         $object = new AastraIPPhoneConfiguration();
         foreach ($temp[1] as $value) {
             $object->addEntry($value['param'], $value['value']);
         }
     } else {
         require_once 'AastraIPPhoneExecute.class.php';
         $object = new AastraIPPhoneExecute();
         $object->AddEntry('');
     }
     break;
     # UPDATE MSG
 # UPDATE MSG
 case 'msg':
     # Retrieve session
     $array = Aastra_read_session('key');
     $temp = unserialize(base64_decode($array['keys']));