How to prevent iOS from declining or ending a call when pressing the power button
By default, pressing the power (side) button on an iPhone declines or stops the call. This can be disabled by going to "Settings" > "Accessibility" > "Touch" and enabling "Prevent Lock to End Call".