Thanks for posting your query.
Presence of right ear discharge
with pain suggests ear pathology for headache.
There may be also possibility of persistence of migraine
along with right ear pathology.
You should consult with ENT surgeon urgently and go for thorough check up.
Discharge may gets secondary bacterial infection and as it is close to brain then there is high possibility of spread of infection to brain.
You should go for complete antibiotic course along with decongestants for rapid relief.
Avoid putting ear buds and hair pins in ear.
Dr. Mayank Bhargava