fail2ban crash the PBX

I found that when an extension is recorded and an authentication error occurs, FreePBX crashes!
Fail2ban service bans the ip that failed to authenticate itself.
Calls from the outside can not connect until they hang up and at that moment the telephone switchboard will ring.
While for calls between PBX extensions there is a significant delay.
How can i resolve this problem?