I have done a test on APIBAN to see if I can replace Fail2Ban and the short answer is as of December 2021 is NO. But watch the video and I think you will use APIBAN to secure your SIP Server from today.
Here is the link to my python script that used to find IP addresses.It's not a clean code but it works :)
You can use it by "cat filename | ./Find-IP-in-File.py
Here is the table that I'm using to store IP addresses: