예제 #1
0
 # Create mac.cfg
 if (create_mac($header['mac'], $extension, $username, $secret, $callerid, $header['model'], $profile, $tz_name, $tz_code, $cl, $lang)) {
     # If override
     if ($action == 'override') {
         # Send a SIP notify
         if (Aastra_is_user_registered_Asterisk($extension)) {
             if (Aastra_is_dynamic_sip_supported($ext_array[$extension]) or $ext_array[$extension]['model'] == 'Aastra8000i') {
                 $notify_type = 'aastra-xml';
                 $notify = Aastra_get_user_context($extension, 'notify');
                 $notify['forced_logout'] = '1';
                 Aastra_save_user_context($extension, 'notify', $notify);
             } else {
                 Aastra_delete_mac($ext_array[$extension]['mac']);
                 $notify_type = 'aastra-check-cfg';
             }
             Aastra_send_SIP_notify_Asterisk($notify_type, array($extension));
         } else {
             if ($ext_array[$extension]['model'] != 'Aastra8000i') {
                 Aastra_delete_mac($ext_array[$extension]['mac']);
             }
         }
         # Send an email
         Aastra_send_HDmail($ext_array[$extension], $callerid, 'FORCED LOGOUT', $AA_EMAIL, $AA_SENDER);
     }
     # Update config file
     Aastra_update_HDconfig_file(AASTRA_PATH_CACHE . 'startup_asterisk.cfg', $extension, $header);
     # Save signature
     Aastra_store_signature($extension);
     # Send an email
     Aastra_send_HDmail($header, $callerid . ' ' . $extension, 'LOGIN', $AA_EMAIL, $AA_SENDER);
     # Set status to Available
예제 #2
0
function Aastra_propagate_daynight_Asterisk($device, $index)
{
    global $ASTERISK_LOCATION;
    # Get the list of devices
    $sip_array = Aastra_readINIfile($ASTERISK_LOCATION . 'sip_additional.conf', ';', '=');
    foreach ($sip_array as $key => $value) {
        if ($value['callerid'] != '') {
            $array_device[] = $key;
        }
    }
    # Remove current device
    $array_device = array_flip($array_device);
    unset($array_device[$device]);
    unset($array_device['']);
    $array_device = array_flip($array_device);
    # Remove the devices without the application
    foreach ($array_device as $key => $value) {
        if (!Aastra_is_daynight_notify_allowed_Asterisk(Aastra_get_userdevice_Asterisk($value), $index)) {
            unset($array_device[$key]);
        } else {
            $data = Aastra_get_user_context($value, 'notify');
            $data['daynight'] = '1';
            Aastra_save_user_context($value, 'notify', $data);
        }
    }
    # Send Notification
    Aastra_send_SIP_notify_Asterisk('aastra-xml', $array_device);
}
예제 #3
0
                 $object->addEntry(Aastra_get_label('Remove Key', $language), $XML_SERVER . '&action=delete&type=' . $type . '&selection=' . $selection . '&page=' . $page);
                 break;
         }
         # Move down
         if ($array_key[$selection]['key'] < $array_key[$selection]['max']) {
             $object->addEntry(Aastra_get_label('Move Down', $language), $XML_SERVER . '&action=down&type=' . $type . '&selection=' . $selection);
         }
     }
     # Back
     $object->addEntry(Aastra_get_label('Back', $language), $XML_SERVER . '&action=main&type=' . $type . '&default=' . $selection . '&page=' . $page);
     break;
     # Notification
 # Notification
 case 'notify':
     # 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