break;
        default:
            play_sound('sorry-cant-let-you-do-that');
            exit;
            break;
    }
    # Depending on action
    switch ($action) {
        case 'play':
            # Play message
            play_sound($file);
            break;
        case 'record':
            # Play intro
            play_sound($play);
            # Record message
            $agi->record_file($file, 'wav', '#', -1, '', TRUE, 2);
            # Convert file
            $create_wav49 = `/usr/bin/sox {$file}.wav -c 1 -r 8000 -g -t wav {$file}.WAV`;
            # Message saved
            play_sound('auth-thankyou&vm-msgsaved');
            break;
        default:
            play_sound('sorry-cant-let-you-do-that');
            exit;
            break;
    }
} else {
    # Play error message
    play_sound('sorry-cant-let-you-do-that');
}