What could be happening?

since 35 weeks I've had sharp painful contraction often. I've had long periods of times, hours, of contractions and since 38 weeks I'm now almost 39 i haven't even felt a contraction. It's rare now if I feel cramping, I've been more active, plenty of walks. heart burn has increased, and I'm lucky if I get two hours of sleep at night.