When are you sure you are in labor?

I am 37 weeks pregnant and about teo days ago went to the bathroom and then immediately got some extremely painful cramping accompanied with contractions that were coming less than a minute apart. I was screaming and crying due to the level of pain. This went on for 45 minutes. I called my doctor and he said if it continued for more than 30 minutes to go to the hospital. Once my husband and I began to head out the pains quickly subsided. How do I know for sure when to head out? I thought the pain came gradually and got stronger at a gradual pace. Any advise?