You seem to be suffering from temporo Mandibular joint dysfunction secondary to dental problems. Usually this can cause sudden pain in the ear, headache etc. You should consult a maxillofacial surgeon to for. Confirmation of diagnosis
Next Steps
Consult nearby ENT specialist and maxillofacial surgeon for confirmation of diagnosis and appropriate treatment if required