Exemplo n.º 1
0
                $num[$type] = preg_replace("/[^\\d]/", '', $value);
                $write = 1;
                $type = false;
            }
        }
    }
    if ($write == 1) {
        foreach ($cases as $case => $gnore2) {
            $ret = gs_callforward_set($user_name, 'internal', $case, 'std', $num['std'], $timeout);
            $ret = gs_callforward_set($user_name, 'internal', $case, 'var', $num['var'], $timeout);
            $ret = gs_callforward_activate($user_name, 'internal', $case, $internal_val[$case]);
        }
        foreach ($cases as $case => $gnore2) {
            $ret = gs_callforward_set($user_name, 'external', $case, 'std', $num['std'], $timeout);
            $ret = gs_callforward_set($user_name, 'external', $case, 'var', $num['var'], $timeout);
            $ret = gs_callforward_activate($user_name, 'external', $case, $external_val[$case]);
        }
        gs_vm_activate($user_name, 'internal', $vm['internal']);
        gs_vm_activate($user_name, 'external', $vm['external']);
    }
}
################################# SET FEATURE }
#################################### SELECT PROPERTIES {
if (($type == 'internal' || $type == 'external') && !isset($_REQUEST['key'])) {
    $mac = preg_replace('/[^\\dA-Z]/', '', strtoupper(trim(@$_REQUEST['m'])));
    ob_start();
    echo $callforward_doctype . "\n";
    $user_id_check = $db->executeGetOne('SELECT `user_id` FROM `phones` WHERE `mac_addr`=\'' . $db->escape($mac) . '\'');
    if ($user_id != $user_id_check) {
        _err('Not authorized');
    }
Exemplo n.º 2
0
         		$idx =(int)substr(@$_REQUEST[$src.'-'.$case],4);
         		$vmail_rec_num = $vm_rec_num_idx_table[$idx];
         		$num_vml = 'vm'. $_SESSION['sudo_user']['info']['ext'];
         		$_REQUEST[$src.'-'.$case] = 'vml';
         	} else if (@$_REQUEST[$src.'-'.$case] === 'vmln') {
         		$num_vml = 'vm*'. $_SESSION['sudo_user']['info']['ext'];
         		$_REQUEST[$src.'-'.$case] = 'vml';
         	} else {
         		$num_vml = 'vm' . $_SESSION['sudo_user']['info']['ext'];
         	}
         	$ret = gs_callforward_set( $_SESSION['sudo_user']['name'],
         		$src, $case, 'vml', $num_vml, $timeout, $vmail_rec_num );
         	if (isGsError($ret))
         		$warnings['vml'] = __('Fehler beim Setzen der AB-Nummer') .' ('. $ret->getMsg() .')';
         */
         $ret = gs_callforward_activate($_SESSION['sudo_user']['name'], $src, $case, @$_REQUEST[$src . '-' . $case]);
         if (isGsError($ret)) {
             $warnings['act'] = __('Fehler beim Aktivieren der Umleitungsnummer') . ' (' . $ret->getMsg() . ')';
         }
     }
 }
 /*
 $vm_internal = (bool)@$_REQUEST['vm-internal'];
 $vm_external = (bool)@$_REQUEST['vm-external'];
 $ret = gs_vm_activate( $_SESSION['sudo_user']['name'], 'internal', $vm_internal );
 if (isGsError($ret))
 	$warnings['vm_act_i'] = __('Fehler beim (De-)Aktivieren des Anrufbeantworters von intern') .' ('. $ret->getMsg() .')';
 $ret = gs_vm_activate( $_SESSION['sudo_user']['name'], 'external', $vm_external );
 if (isGsError($ret))
 	$warnings['vm_act_e'] = __('Fehler beim (De-)Aktivieren des Anrufbeantworters von extern') .' ('. $ret->getMsg() .')';
 */
Exemplo n.º 3
0
function setForward($userinfo, $source, $destination, $plist)
{
    $source = (int) $source;
    $destination = (int) $destination;
    switch ($source) {
        case 0:
            $gs_source = 'internal';
            $gs_case = 'always';
            $timeout = 0;
            break;
        case 1:
            $gs_source = 'internal';
            $gs_case = 'busy';
            $timeout = 0;
            break;
        case 2:
            $gs_source = 'internal';
            $gs_case = 'unavail';
            $timeout = $plist['timeout'];
            break;
        case 3:
            $gs_source = 'internal';
            $gs_case = 'offline';
            $timeout = 0;
            break;
        case 4:
            $gs_source = 'external';
            $gs_case = 'always';
            $timeout = 0;
            break;
        case 5:
            $gs_source = 'external';
            $gs_case = 'busy';
            $timeout = 0;
            break;
        case 5:
            $gs_source = 'external';
            $gs_case = 'unavail';
            $timeout = $plist['timeout'];
            break;
        case 7:
            $gs_source = 'external';
            $gs_case = 'offline';
            $timeout = 0;
            break;
        default:
            $gs_source = '';
            $gs_case = '';
            $timeout = 0;
    }
    switch ($destination) {
        case 1:
            $gs_type = 'std';
            $number = $plist['standardNumber'];
            break;
        case 2:
            $gs_type = 'var';
            $number = $plist['tempNumber'];
            break;
        case 3:
            $gs_type = 'vml';
            $number = 'vm' . $userinfo['ext'];
            break;
        case 4:
            $gs_type = 'vml';
            $number = 'vm*' . $userinfo['ext'];
        default:
            $gs_type = '';
            $number = $plist['standardNumber'];
    }
    gs_log(GS_LOG_NOTICE, 'setting call forward from ' . $gs_source . ' in case of ' . $gs_case . ' to ' . $gs_type . ' (number=' . $number . ', timeout=' . $timeout . ')');
    gs_callforward_set($userinfo['user'], $gs_source, $gs_case, $gs_type, $number, $timeout);
    if ($gs_type == '') {
        $gs_type = 'no';
    }
    gs_callforward_activate($userinfo['user'], $gs_source, $gs_case, $gs_type);
}
Exemplo n.º 4
0
        }
    } else {
        if ($active == $callforwards[$origin]['always']['active']) {
            if ($active == 'var' && $callforwards[$origin]['always']['number_var'] == $value) {
                $active = 'no';
            } else {
                if ($active != 'var') {
                    $active = 'no';
                }
            }
        }
    }
    if (strlen($origin) == 0) {
        $callforwards['internal']['always']['active'] = $active;
        $callforwards['external']['always']['active'] = $active;
    } else {
        $callforwards[$origin]['always']['active'] = $active;
    }
    if ($active == 'var') {
        gs_callforward_set($user['user'], 'internal', 'always', 'var', $value, $callforwards['internal']['always']['timeout']);
        gs_callforward_set($user['user'], 'external', 'always', 'var', $value, $callforwards['external']['always']['timeout']);
    }
    gs_callforward_activate($user['user'], 'internal', 'always', $callforwards['internal']['always']['active']);
    gs_callforward_activate($user['user'], 'external', 'always', $callforwards['external']['always']['active']);
    if ($active != 'no') {
        aastra_textscreen(htmlEnt(__('Rufumleitung')), htmlEnt(__('Rufumleitung aktiviert')), 3);
    } else {
        aastra_textscreen(htmlEnt(__('Rufumleitung')), htmlEnt(__('Rufumleitung deaktiviert')), 3);
    }
    gs_diversion_changed_ui($user['name']);
}