That’s exactly the point. This is not limited to Telegram. Even Android’s native SIP client (integrated into the stock Phone app) suffers from this bug! The only workaround is using a headset.
Please vote for this bug in the bug tracker to give it more attention.