Hi LondonJim,
Since your calls are ending when your EarPods are connected, check to see if the middle button is working correctly. This button allows you to answer and end calls. Find the steps below and in the article Use EarPods with iPhone - Apple Support:
"Manage calls using your EarPods
- Answer an incoming call: Press the center button.
- End the current call: Press the center button.
- Switch to an incoming or on-hold call, and put the current call on hold: Press the center button. Press again to switch back to the first call."
If that button seems to be damaged or pressed in, this may be why it's ending the calls. Try cleaning it if needed. You can also test this behavior out by using these EarPods with another device while on a call. That'll help isolate the behavior to either the EarPods or your iPhone.
It's also a good idea to restart your iPhone, and ensure the software is updated.
Hope that helps!