Our kids have awful coughing fits when they're draining from their sinuses badly. Right now, we believe our daughter has another ear infection (she had tubes last year and has already had 4 ear infections this year) - she's draining badly from her nose, and is having a tough time with coughing. This is usually how we know it's time to go to the pediatrician. She has a well-baby visit on Wednesday, and we're expecting to be told to go to the ENT.
I'd advise against cough medicine. In the past few years, the American Academy of Pediatricians revamped their policies on cough medicine for children under the age of 6 (basically, not to give it to them unless prescribed by the physician) because of overdosage.
Here's what the AAP says about cough. I'd recommend having another look at the pediatrician to see if it could be allergies, asthma, reflux, etc.
Good luck:
http://www.healthychildren.org/english/search/pages/resul...