You seem to be suffering from temporo Mandibular joint dysfunction secondary to dental problems. Usually it will resolve with treatment such as soft diet, painkillers, hot compresses etc. You may need to consult a dentist also
Next Steps
Consult nearby maxillofacial surgeon for confirmation of diagnosis and appropriate treatment if required