At this age, such paroxysmal coughing spells are concerning for pertussis (whooping cough), especially in infants under 3 months. While mild viral infections can cause cough with mucus, the described sudden prolonged coughing fits with post-tussive vomiting or regurgitation require urgent evaluation.
Next Steps
My advice is Your baby should be evaluated urgently by a pediatrician, even though medication is started, due to the risk of complications in young infants.