示例#1
0
         $object->setTitle($array_rss[99]['title']);
         # Display topics
         foreach ($array_rss as $key => $value) {
             if ($key != '99') {
                 $object->addEntry($value['title'], $value['uri'] . '&user='******'1', Aastra_get_label('Select', $language), 'SoftKey:Select');
             $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER);
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         }
     } else {
         # Display first item
         $object = new AastraIPPhoneExecute();
         $object->addEntry($XML_SERVER . '&zip=' . $zip . '&index=1');
     }
 } else {
     # shift $index
     $index--;
     # Display article
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     if (Aastra_is_wrap_title_supported()) {
         $object->setTitleWrap();
     }
     # Title
     if (Aastra_phone_type() == 5) {
         $object->setTitle($array_rss[$index]['title']);
     } else {
示例#2
0
     $object->setText(Aastra_get_label('No directory configured. Please contact your administrator.', $language));
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 1);
             $object->addIcon(1, 'Icon:CircleRed');
         }
     }
     break;
     # Just one
 # Just one
 case '1':
     # Straight to the directory
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     $object->addEntry($ARRAY_CONFIG[$first_source]['uri']);
     break;
     # More than one
 # More than one
 default:
     # Display selection
     require_once 'AastraIPPhoneTextMenu.class.php';
     $object = new AastraIPPhoneTextMenu();
     $object->setDestroyOnExit();
     $object->setTitle(Aastra_get_label('Directory Selection', $language));
     foreach ($ARRAY_CONFIG as $source => $value) {
         $object->addEntry($value['label'], $value['uri'] . '&back=1');
     }
     # Softkeys
     if ($nb_softkeys) {
示例#3
0
         }
         # 3.2.1 bug double all the configuration messages
         $last = $last * 2;
         # 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) {
示例#4
0
                $object->addEntry(Aastra_get_label('Confirm Calls: Yes', $language), $XML_SERVER . '&action=change_grpconf');
            } else {
                $object->addEntry(Aastra_get_label('Confirm Calls: No', $language), $XML_SERVER . '&action=change_grpconf');
            }
            $object->addEntry(sprintf(Aastra_get_label('%s phone number(s)', $language), count($array_fm['grplist'])), $XML_SERVER . '&action=change_grplist');
            # Softkeys
            if ($nb_softkeys) {
                if ($nb_softkeys == 6) {
                    $object->addSoftkey('1', Aastra_get_label('Change', $language), 'SoftKey:Select');
                    $object->addSoftkey('2', Aastra_get_label('My Numbers', $language), $XML_SERVER . '&action=info');
                    $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                } else {
                    $object->addSoftkey('1', Aastra_get_label('My Numbers', $language), $XML_SERVER . '&action=info');
                    $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                }
            }
        }
        break;
        # Default
    # Default
    default:
        # Debug
        Aastra_debug('Unexpected action:' . $action);
        require_once 'AastraIPPhoneExecute.class.php';
        $object = new AastraIPPhoneExecute();
        $object->addEntry('');
        break;
}
# Display answer
$object->output();
exit;
示例#5
0
     # Send notification
     Aastra_send_SIP_notify_Asterisk('aastra-xml', array($user));
     # Do nothing
     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
示例#6
0
 case 'roll':
     # Score to be entered
     $yahtzee['set'] = False;
     # Roll the dices
     for ($i = 0; $i < 5; $i++) {
         if (!$yahtzee['dice'][$i]['hold']) {
             $yahtzee['dice'][$i]['value'] = rand(1, 6);
         }
     }
     # One extra roll
     $yahtzee['roll']++;
     # End of the game
     if ($yahtzee['round'] == 13 and $yahtzee['roll'] == 3) {
         $index = last_score($yahtzee);
         $score = compute_score($yahtzee, $index);
         $object2 = new AastraIPPhoneExecute();
         $object2->addEntry($XML_SERVER . '&action=set2&value=' . $index . '&score=' . $score);
         $object2->output();
         exit;
     }
     break;
     # Hold/Release
 # Hold/Release
 case 'hold':
     if ($yahtzee['dice'][$value]['hold']) {
         $yahtzee['dice'][$value]['hold'] = False;
     } else {
         $yahtzee['dice'][$value]['hold'] = True;
     }
     break;
     # Set the score
示例#7
0
                    }
                    if ($menu_page2 != $last) {
                        $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 + 1));
                    }
                    $object->addSoftkey('3', Aastra_get_label('Details', $language), $XML_SERVER . '&menu_action=details&menu_page2=' . $menu_page2);
                    $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_page=' . $menu_page);
                    $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                } else {
                    $object->addSoftkey('1', Aastra_get_label('Add', $language), 'SoftKey:Select');
                    if ($menu_page2 != 1) {
                        $object->addSoftkey('3', Aastra_get_label('Previous Page', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 - 1));
                    }
                    if ($menu_page2 != $last) {
                        $object->addSoftkey('8', Aastra_get_label('Next Page', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . ($menu_page2 + 1));
                    }
                    $object->addSoftkey('6', Aastra_get_label('Details', $language), $XML_SERVER . '&menu_action=details&menu_page2=' . $menu_page2);
                    $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_page=' . $menu_page);
                    $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                    $object->setCancelAction('9', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_page=' . $menu_page);
                }
            }
        } else {
            # Display list
            $object = new AastraIPPhoneExecute();
            $object->addEntry($XML_SERVER . '&menu_action=list');
        }
        break;
}
# Display object
$object->output();
exit;
示例#8
0
                 }
                 if ($page != 1) {
                     $object->addSoftkey('8', Aastra_get_label('Previous', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page - 1));
                 }
                 if ($page != $last) {
                     $object->addSoftkey('9', Aastra_get_label('Next', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page + 1));
                 }
                 $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             }
         } else {
             if ($page != $last) {
                 $object->addEntry(Aastra_get_label('Next Page', $language), $XML_SERVER . '&index=' . ($index + 1) . '&page=' . ($page + 1));
             }
         }
     } else {
         $object = new AastraIPPhoneExecute();
         $object->addEntry($XML_SERVER . '&index=' . ($index + 1) . '&rank=1');
     }
 } else {
     # shift $rank
     $rank--;
     # Display article
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     if (Aastra_is_wrap_title_supported()) {
         $object->setTitleWrap();
     }
     if (Aastra_number_softkeys_supported() < 7) {
         $object->setTitle($array_rss[$rank]['title']);
     } else {
         if (count($array_rss) > 1) {
示例#9
0
     }
     break;
     # Modify current setting
 # Modify current setting
 case 'cancel':
 case 'cancel2':
 case 'set':
     # Set call forward
     if ($action != 'cancel2') {
         $cf = Aastra_manage_cf_Asterisk($user, $action, $value);
     } else {
         $cf = Aastra_manage_cf_Asterisk($user, 'cancel', $value);
     }
     # Prepare display update
     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 {
示例#10
0
     $input->addField('string');
     $input->setFieldSelection('1');
     $input->setFieldPrompt('Username:'******'user');
     $input->setFieldSelection('1');
     $input->addField('number');
     $input->setFieldPassword('yes');
     $input->setFieldPrompt('Password:'******'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';
 # Change sort value
 case 'set_sort':
     # Save value
     if ($ARRAY_USER['sort'] == 'first') {
         $ARRAY_USER['sort'] = 'last';
     } else {
         $ARRAY_USER['sort'] = 'first';
     }
     if ($asterisk) {
         Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'contacts', $ARRAY_USER);
     } else {
         Aastra_save_user_context($user, 'contacts', $ARRAY_USER);
     }
     # Call back
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     $object->addEntry($XML_SERVER . '&action=settings&index=2');
     break;
     # Search
 # Search
 case 'search':
     # Make the LDAP query
     $result = query_ldap($lookup, $firstname, $lastname, $source);
     $hits = count($result);
     # How many matches
     if ($hits == 0) {
         # No match
         display_message(Aastra_get_label('No match found', $LANGUAGE), Aastra_get_label('Please modify your search.', $LANGUAGE), $XML_SERVER . '?lastname=' . $lastname . '&firstname=' . $firstname . '&lookup=' . $lookup);
     } else {
         # Display Results
         require_once 'AastraIPPhoneScrollableDirectory.class.php';
示例#12
0
#############################################################################
# PHP customization for includes and warnings
#############################################################################
$os = strtolower(PHP_OS);
if (strpos($os, "win") === false) {
    ini_set('include_path', ini_get('include_path') . ':include:../include');
} else {
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Main code
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$origin = Aastra_getvar_safe('origin');
# Trace
Aastra_trace_call('directory_asterisk', 'user='******'1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Launch application
require_once 'AastraIPPhoneExecute.class.php';
$object = new AastraIPPhoneExecute();
$object->addEntry($XML_SERVER_PATH . 'directory_' . Aastra_phone_type() . '.php?user='******'&origin=' . $origin);
# Output XML object
$object->output();
exit;
示例#13
0
                        }
                    } else {
                        $object->addSoftkey('10', Aastra_get_label('More', $language), 'SoftKey:Exit');
                    }
                }
                # Common parameters
                $object->setDestroyOnExit();
                $object->setTimeout('4');
                $found = True;
            }
        }
        # No match whatsoever
        if (!$found) {
            require_once 'AastraIPPhoneExecute.class.php';
            $object = new AastraIPPhoneExecute();
            $object->addEntry('');
        }
        break;
        # Cancel
    # Cancel
    case 'cancel':
        # Send 2 goodbyes to hangup the call
        require_once 'AastraIPPhoneExecute.class.php';
        $object = new AastraIPPhoneExecute();
        $object->setTriggerDestroyOnExit();
        $object->addEntry('Key:Goodbye');
        break;
}
# Display output
$object->output();
exit;
示例#14
0
    $park = Aastra_check_park_Asterisk($user, $number);
    # Display orbit
    if ($park != '') {
        # Display current status
        require_once 'AastraIPPhoneStatus.class.php';
        $object = new AastraIPPhoneStatus();
        $object->setSession('Park');
        $object->setBeep();
        if (Aastra_size_display_line() > 16) {
            $object->addEntry('1', sprintf(Aastra_get_label('Call Parked at %s', $language), $park), 'alert', 5);
        } else {
            $object->addEntry('1', sprintf(Aastra_get_label('Parked at %s', $language), $park), 'alert', 5);
        }
        # Bug 3.2.1
        if (Aastra_test_phone_version('3.2.1.', '1') == 0) {
            sleep(4);
        }
        # End of search
        $found = 1;
    }
}
# No match whatsoever
if ($found == 0) {
    require_once 'AastraIPPhoneExecute.class.php';
    $object = new AastraIPPhoneExecute();
    $object->addEntry('');
}
# Display XML object
# Trace
Aastra_trace_call('onhook_asterisk', $object->generate());
$object->output();
示例#15
0
 case 'play_greetings':
 case 'rec_greetings':
     # Action
     if ($action == 'play_greetings') {
         $action = 'play';
     } else {
         $action = 'record';
     }
     # Retrieve context
     $context = $action . '-' . $msg . '-vm';
     # Save session
     $array = array('uri_incoming' => $XML_SERVER . '&action=disp_greetings&msg=' . $msg . '&cause=' . $action, 'uri_onhook' => $XML_SERVER . '&action=options');
     Aastra_save_session('vmail', '600', $array, $ext);
     # Return empty object
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     $object->addEntry('');
     $object->output(True);
     # Launch the call
     $vmail_options = Aastra_get_user_context($ext, 'vmail-options');
     if ($vmail_options['auto_answer'] == '') {
         $vmail_options['auto_answer'] = '1';
         Aastra_save_user_context($ext, 'vmail-options', $vmail_options);
     }
     if ($vmail_options['auto_answer'] == '1') {
         Aastra_originate_Asterisk('SIP/' . Aastra_get_userdevice_Asterisk($ext), 's', $context, 1, '', 'VoiceMail <9999>', array('_USER='******'__SIPADDHEADER=Alert-Info: \\;info=alert-autoanswer'));
     } else {
         Aastra_originate_Asterisk('SIP/' . Aastra_get_userdevice_Asterisk($ext), 's', $context, 1, '', 'VoiceMail <9999>', '_USER=' . Aastra_get_userdevice_Asterisk($user));
     }
     break;
     # Display greetings
示例#16
0
 $profile = Aastra_get_startup_profile_Asterisk($user);
 if (file_exists($profile . '-device-user.prf')) {
     # Store language if needed
     if ($lang != '') {
         $data['language'] = $lang;
         $data['code'] = $cl;
         $array_wl = array('fr' => 'French', 'it' => 'Italian', 'es' => 'Spanish', 'en' => 'English', 'de' => 'German', 'pt' => 'Portuguese');
         if ($array_wl[substr($lang, 0, 2)] != '') {
             $data['clear'] = $array_wl[substr($lang, 0, 2)];
         } else {
             $data['clear'] = '';
         }
         Aastra_save_user_context($device, 'language', $data);
     }
     # Trigger a sync on the phone
     $object = new AastraIPPhoneExecute();
     $object->setTriggerDestroyOnExit();
     $object->addEntry('Dial:loguser' . $user);
 } 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));
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         }
     }
示例#17
0
     # Softkeys
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey(4, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
             $object->addSoftkey(6, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftkey(6, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
             $object->addSoftkey(10, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         }
     }
 } else {
     # Only one and autopick
     if ($count == 1 and $autopick == '1') {
         # Dial the orbit
         require_once 'AastraIPPhoneExecute.class.php';
         $object = new AastraIPPhoneExecute();
         if (Aastra_is_dialuri_supported()) {
             $object->addEntry('Dial:' . $park[0][0]);
         } else {
             $object->addEntry($XML_SERVER . '&action=dial&value=' . $park[0][0]);
         }
     } else {
         # Display the queue
         require_once 'AastraIPPhoneTextMenu.class.php';
         $object = new AastraIPPhoneTextMenu();
         $object->setDestroyOnExit();
         if (Aastra_is_style_textmenu_supported()) {
             $object->setStyle('none');
         }
         $object->setTitle(Aastra_get_label('Parked Calls', $language));
         if (Aastra_is_softkeys_supported()) {
示例#18
0
 $key = $data['key'];
 # Save DND status
 $data['last'] = $dnd;
 if ($dnd != $last) {
     Aastra_save_user_context($user, 'dnd', $data);
 }
 # Update needed?
 if ($action == 'check' and $dnd == $last) {
     $update = 0;
 }
 if ($action == 'register' and $dnd == 0) {
     $update = 0;
 }
 # Prepare display update
 require_once 'AastraIPPhoneExecute.class.php';
 $object = new AastraIPPhoneExecute();
 if ($update == 1) {
     # Change msg status
     $object->addEntry($XML_SERVER . '&action=msg&status=' . $dnd);
     # Change LED if supported
     if ($key != '' and Aastra_is_ledcontrol_supported()) {
         if ($dnd == 1) {
             $object->addEntry('Led: ' . $key . '=on');
         } else {
             $object->addEntry('Led: ' . $key . '=off');
         }
     }
 } else {
     # Do nothing
     $object->addEntry('');
 }
示例#19
0
    # Error
    case 'error':
        # New text screen
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setDestroyOnExit();
        $object->setTitle($err_title);
        $object->setText($err_text);
        if ($nb_softkeys) {
            $object->addSoftkey($err_key[0], $err_key[1], $err_key[2]);
        } else {
            if ($err_key[2] != 'SoftKey:Exit') {
                $object->setDoneAction($err_key[2]);
            }
        }
        break;
        # Launch
    # Launch
    case 'launch':
        # Launch application
        require_once 'AastraIPPhoneExecute.class.php';
        $object = new AastraIPPhoneExecute();
        $object->addEntry($XML_SERVER_PATH . 'vmail_' . Aastra_phone_type() . '.php?ext=' . $ext . '&user=' . $user);
        break;
}
# Output XML object
$object->output();
exit;
?>

示例#20
0
     $object->addEntry($array_config['action uri startup']);
     # Clear the critical keys
     Aastra_save_user_context($user, 'cfwd', NULL);
     Aastra_save_user_context($user, 'dnd', NULL);
     Aastra_save_user_context($user, 'daynight', NULL);
     Aastra_save_user_context($user, 'away', NULL);
     Aastra_save_user_context($user, 'agent', NULL);
     Aastra_save_user_context($user, 'follow', NULL);
     Aastra_save_user_context($user, 'parking', NULL);
     Aastra_save_user_context($user, 'vmail', NULL);
 } else {
     # Erase mac.cfg
     Aastra_delete_mac($header['mac']);
     # Reboot needed
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     # Bug 673i
     if ($header['model'] != 'Aastra6739i') {
         $object->addEntry($XML_SERVER . '&action=display');
     } else {
         $object->setTriggerDestroyOnExit();
     }
     if (Aastra_is_local_reset_supported() and $header['model'] != 'Aastra6739i') {
         $object->addEntry('Command: ClearCallersList');
         $object->addEntry('Command: ClearDirectory');
         $object->addEntry('Command: ClearRedialList');
         $object->addEntry('Command: ClearLocal');
     } else {
         if (Aastra_is_fastreboot_supported()) {
             $object->AddEntry('Command: FastReboot');
         } else {
示例#21
0
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     $object->setTitle(Aastra_get_label('List Updated', $language));
     $position = $speed + 1;
     $object->setText(sprintf(Aastra_get_label('%s stored in speed dial list at position %d.', $language), $conf_speed[$speed]['name'], $position));
     # Softkey
     $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER . '&action=' . $orig_s . '&lookup=' . $lookup . '&page=' . $page . '&selection=' . $selection, 1);
     $object->addIcon(1, 'Icon:CircleRed');
     $object->setCancelAction($XML_SERVER . '&action=' . $orig_s . '&lookup=' . $lookup . '&page=' . $page . '&selection=' . $selection);
     break;
     # Dial/Intercom
 # Dial/Intercom
 case 'dial':
 case 'intercom':
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     if ($action == 'intercom') {
         $object->addEntry('Dial:' . Aastra_get_intercom_config_Asterisk() . $selection);
     } else {
         $object->addEntry('Dial:' . $selection);
     }
     break;
     # Display status
 # Display status
 case 'zoom':
     # Retrieve user status
     $away = Aastra_manage_presence_Asterisk($selection, 'get', 'status');
     # Labels for status
     $status_text = Aastra_status_config_Asterisk();
     # Check notification
     if ($away['status'] != AA_PRESENCE_AVAILABLE) {
示例#22
0
         } else {
             $object->addSoftkey('9', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=input_prefs2&state=' . $state);
             $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         }
     }
     # Cancel action
     $object->setCancelAction($XML_SERVER . '&action=input_prefs2&state=' . $state);
     break;
     # Record Temp message
 # Record Temp message
 case 'rec_msg':
     # Get current status
     $away = Aastra_manage_presence_Asterisk($user, 'get');
     # Next step
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     # Test if phone can dial
     if (!Aastra_is_dialuri_supported()) {
         # No display change
         $object->addEntry('');
         $object->output(True);
         # Disable DND if needed
         $dnd = Aastra_manage_dnd_Asterisk($user, 'get');
         if ($away['action'][$away['status']] == AA_PRESENCE_ACT_DND or $dnd == 1) {
             $dnd = 1;
             Aastra_manage_dnd_Asterisk($user, 'disable');
         }
         # Disable Follow-me if needed
         $follow = Aastra_manage_followme_Asterisk($user, 'get_status');
         if ($away['action'][$away['status']] == AA_PRESENCE_ACT_FM or $follow == 1) {
             $follow = 1;
示例#23
0
     $object->setType('number');
     $object->setPrompt(Aastra_get_label('Number to dial', $language));
     $object->setParameter('paused');
     $object->setURL($XML_SERVER . '&action=dial&msg=' . $msg . '&cause=' . $cause);
     $object->setDefault($cause);
     # Common Softkeys
     $object->addSoftkey('1', Aastra_get_label('Backspace', $language), 'SoftKey:BackSpace');
     $object->addSoftkey('5', Aastra_get_label('Dial', $language), 'SoftKey:Submit');
     $object->addSoftkey('6', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=detail&msg=' . $msg);
     break;
     # Dial
 # Dial
 case 'dial':
     # PhoneExecute
     require_once 'AastraIPPhoneExecute.class.php';
     $object = new AastraIPPhoneExecute();
     # Number not valid?
     if (strlen($paused) < 1 || preg_match('/[^0-9]/', $paused)) {
         $object->setBeep();
         $object->addEntry($XML_SERVER . '&action=callback&msg=' . $msg . '&cause=' . $cause);
     } else {
         $object->addEntry('Dial:' . $paused);
     }
     break;
     # Forward
 # Forward
 case 'forward':
 case 'forward2':
 case 'dselect':
 case 'reverse':
     # Retrieve directory
示例#24
0
function sync_apps($user, $action)
{
    global $XML_SERVER_PATH;
    global $AA_AUTOLOGOUT;
    global $AA_AUTOLOGOUT_MSG;
    global $AA_FREEPBX_MODE;
    # Get phone information
    $header = Aastra_decode_HTTP_header();
    # Retrieve feature keys
    $cfwd = Aastra_get_user_context($user, 'cfwd');
    $dnd = Aastra_get_user_context($user, 'dnd');
    $away = Aastra_get_user_context($user, 'away');
    $agent = Aastra_get_user_context($user, 'agent');
    $parking = Aastra_get_user_context($user, 'parking');
    $vmail = Aastra_get_user_context($user, 'vmail');
    $follow = Aastra_get_user_context($user, 'follow');
    $logout = Aastra_get_user_context($user, 'autologout');
    # Update DND, CFWD, DAYNIGHT, PRESENCE, AGENT, PARKING, VMAIL and FOLLOW-ME
    require_once 'AastraIPPhoneExecute.class.php';
    $object = new AastraIPPhoneExecute();
    if ($cfwd['key'] != '' or $header['mac'] == 'Aastra51i') {
        $object->addEntry($XML_SERVER_PATH . 'cfwd.php?action=' . $action . '&user='******'key'] != '' or $header['mac'] == 'Aastra51i') {
        $object->addEntry($XML_SERVER_PATH . 'dnd.php?action=' . $action . '&user='******'daynight.php?action=' . $action . '&user='******'key'] != '' or $header['mac'] == 'Aastra51i') {
        $object->addEntry($XML_SERVER_PATH . 'away.php?action=' . $action . '&user='******'key'] != '' or $header['mac'] == 'Aastra51i') {
        $object->addEntry($XML_SERVER_PATH . 'agent.php?action=' . $action . '&agent=' . $user);
    }
    if ($follow['key'] != '' or $header['mac'] == 'Aastra51i') {
        $object->addEntry($XML_SERVER_PATH . 'follow.php?action=' . $action . '&user='******'1' and Aastra_is_sip_notify_supported() and $AA_AUTOLOGOUT and $AA_AUTOLOGOUT_MSG) {
        $object->addEntry($XML_SERVER_PATH . 'logout.php?action=' . $action . '&user='******'register' and Aastra_is_ledcontrol_supported()) {
        if ($parking['key'] != '') {
            $status = Aastra_get_user_context('parking', 'status');
            if ($status == '') {
                $status = 'off';
            }
            $object->addEntry('Led: ' . $parking['key'] . '=' . $status);
        }
        $status = Aastra_get_user_context('vmail', 'user');
        foreach ($vmail as $box => $key) {
            $object->addEntry('Led: ' . $key['key'] . '=' . $status[$box]['status']);
        }
    }
    $object->addEntry('');
    # Return object
    return $object;
}