Esempio n. 1
0
         Aastra_manage_cf_Asterisk($user, 'cancel', '');
     }
     # Launch the call
     $vmail_options = Aastra_get_user_context($user, '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('Local/' . Aastra_get_userdevice_Asterisk($user) . '@from-internal', 's', 'record-temp-vm', 1, '', Aastra_get_label('RecordTemporary', $language) . ' <0>', array('_USER='******'_ALERT_INFO=info=alert-autoanswer'));
     } else {
         Aastra_originate_Asterisk('Local/' . Aastra_get_userdevice_Asterisk($user) . '@from-internal', 's', 'record-temp-vm', 1, '', Aastra_get_label('RecordTemporary', $language) . ' <0>', array('_USER='******'enable');
     }
     if ($follow == 1) {
         Aastra_manage_followme_Asterisk($user, 'enable');
     }
     if ($cfwd != '') {
         Aastra_manage_cf_Asterisk($user, 'set', $cfwd);
     }
 } else {
     # Save session
     $array = array('uri_onhook' => $XML_SERVER, 'user' => $user, 'type' => 'temp', 'action' => 'record');
     Aastra_save_session('vmail', '600', $array, $user);
     # Dial special number
     $object->addEntry('Dial:vmail');
 }
 break;
Esempio n. 2
0
             }
         }
     }
     # 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('dnd'));
     }
     break;
     # Initial or recurrent check
 # Initial or recurrent check
 case 'check':
 case 'register':
     # Update needed
     $update = 1;
     # Get current DND status
     $dnd = Aastra_manage_dnd_Asterisk($user, 'get');
     # Get last DND status
     $data = Aastra_get_user_context($user, 'dnd');
     $last = $data['last'];
     $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;