This is probably a sinus
. Get a CT scan
done. You might be probably suffering from osteomyelitis
of orbital or facial bones as such long standing discharge occur due to a focal point of infection and the pus has made a tract towards the skin. This needs investigations and management.
There are different causes like trauma, infection, necrotic bones etc.
Proper oculoplastic consultation will help.