Example #1
0
         }
         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
 if ($AA_FREEPBX_MODE == '1' and $AA_PRESENCE_STATE) {
     if (Aastra_manage_presence_Asterisk($extension, 'status') == AA_PRESENCE_DISCONNECTED) {
         Aastra_manage_presence_Asterisk($extension, 'set', 'status', AA_PRESENCE_AVAILABLE);
         $away = Aastra_manage_presence_Asterisk($extension, 'action');
         switch ($away['action'][AA_PRESENCE_DISCONNECTED]) {
             case AA_PRESENCE_ACT_FM:
                 Aastra_manage_followme_Asterisk($extension, 'disable');
                 break;
             case AA_PRESENCE_ACT_CFWD:
                 Aastra_manage_cf_Asterisk($extension, 'cancel');
                 break;
         }
     }
 }
Example #2
0
 # Logout
 case 'logout':
 case 'forced_logout':
     # Update config file
     if ($action == 'logout') {
         Aastra_update_HDconfig_file(AASTRA_PATH_CACHE . 'startup_asterisk.cfg', $user);
     }
     # Remove from Parking list
     Aastra_remove_parking_Asterisk($user);
     # Remove from VM List
     $count = !Aastra_is_ledcontrol_supported();
     Aastra_remove_vmail_Asterisk('', $user, $count);
     # Retrieve Caller ID
     $callerid = Aastra_get_callerid_Asterisk($user);
     # Send an email
     Aastra_send_HDmail($header, $callerid . ' ' . $user, 'LOGOUT', $AA_EMAIL, $AA_SENDER);
     # Compute what to do
     $test = False;
     if ($header['model'] == 'Aastra6739i') {
         if (Aastra_test_phone_version('3.2.0.', 1, $header) == 0) {
             $test = True;
         }
     } else {
         if (Aastra_is_dynamic_sip_supported()) {
             $test = True;
         }
     }
     # Depending on Dynamic SIP support
     if ($test) {
         # Get new configuration
         $array_mac = Aastra_readCFGfile(AASTRA_TFTP_DIRECTORY . '/' . $header['mac'] . '.cfg', '#', ':');