You are suffering from a disease called CSOM( i.e. chronic suppurative otitis media
) In this disease people get a perforation in the ear drum, so they get recurrent infection and discharge from the ear.
to get a permanet treatment for this problem you have to undergo a surgery called tympanoplasty
,where after clearing the disease the perforated ear drum is repaired with a graft.