Labor? Please help!

I'm 39 weeks and 6 days and its currently 3:50 am I've woken up to getting crampy pains and gone to the toilet twice within half an hour and realised that I was kinda bleeding? Not full on bright red blood but pinky orangey bits of blood and I guess I'm starting to get paranoid could I be in labor? Is my baby okay? The pains have been going on for the past hour or so and they are painful but not too painful? Sorry if this sounds stupid but I'm a FTM and quite worried.