Help cant use earphones or ext. speakers

every time i plug in earphones or extention speakers, my phone redirects to my contact history and starts dialing the last number called. the only way i can get it to stop is to pull out the plug and return to the previous page. anyone else have this problem .?