Please add an option entitled, “End calls via End Call soft key only”.
Place this checkbox under the Settings / Call Features menu.
Only the End Call soft key will terminate a call. This means that pressing headset will switch to Headset, pressing speaker will always switch the call to Speaker, picking up the handset switches to Handset, returning the handset switches to Speaker. Only pressing the End Call soft key will terminate a call.