Ejemplo n.º 1
0
            gs_log(GS_LOG_WARNING, 'Failed to mv call file "' . $filename . '" on ' . $user['host'] . ' to "' . $spoolfile . '"');
            die_error('Failed to mv call file on remote host.');
        }
    }
} else {
    include_once GS_DIR . 'inc/boi-soap/boi-api.php';
    $api = gs_host_get_api($user['host_id']);
    switch ($api) {
        case 'm01':
        case 'm02':
            if (!extension_loaded('soap')) {
                gs_log(GS_LOG_NOTICE, 'Failed to initiate call on foreign host (SoapClient not available).');
                die_error('Failed to initiate call on foreign host (SoapClient not available).');
            } else {
                include_once GS_DIR . 'inc/boi-soap/boi-soap.php';
                $ok = gs_boi_call_init($api, $user['host'], $user_code, $to_num_obj->norm, $from_num_effective_obj->norm, $cidnum, $clir, $prv);
                if (!$ok) {
                    gs_log(GS_LOG_NOTICE, 'Failed to initiate call on foreign host (SOAP error).');
                    die_error('Failed to initiate call on foreign host (SOAP error).');
                }
                gs_log(GS_LOG_DEBUG, "OK. Calling " . $to_num_obj->norm . " from " . $from_num_effective_obj->norm . " (user {$user_code}) on host " . $user['host'] . "...");
                die_ok("OK. Calling " . $to_num_obj->norm . " from " . $from_num_effective_obj->norm . " (user {$user_code}) on host " . $user['host'] . "...");
            }
            break;
        case '':
            # host does not provide any API
            gs_log(GS_LOG_WARNING, 'Failed initiate call on foreign host ' . $user['host'] . ' without any API');
            die_error('Failed initiate call on foreign host ' . $user['host'] . ' without any API');
            break;
        default:
            gs_log(GS_LOG_WARNING, 'Failed to initiate call on foreign host ' . $user['host'] . ' - invalid API "' . $api . '"');
Ejemplo n.º 2
0
    exit(1);
}
$user = @$argv[2];
if ($argc < 4) {
    echo "Arg 3 must be the number to call!\n";
    exit(1);
}
$to = @$argv[3];
if ($argc < 5) {
    echo "Arg 4 must be the number from where to call!\n";
    exit(1);
}
$from = @$argv[4];
if ($argc < 6) {
    echo "Arg 5 must be the caller-ID number!\n";
    exit(1);
}
$cidnum = @$argv[5];
if ($argc < 7) {
    echo "Arg 6 must be CLIR, 0 or 1!\n";
    exit(1);
}
$clir = @$argv[6];
if ($argc < 8) {
    echo "Arg 7 must be is_private, 0 or 1!\n";
    exit(1);
}
$is_private = @$argv[7];
$ret = gs_boi_call_init('m01', $host, $user, $to, $from, $cidnum, (bool) $clir, (bool) $is_private);
var_export($ret);
echo "\n";