How to avoid anonymous calls in asterisk?

we are getting anonymous/unknown calls, like 100,2022,101,etc…how to avoide these anonymous/unknown calls from asterisk???

It is not clear what you mean. Anonymous calls will have no number at all, except the called number.

Start by implementing

After that, you will need to provide specific details, including logs of the call, so that we can understand exactly what is happening and how far the calls are getting. In some environments it is impossible to block abusive calls entirely, but they still should not be able to initiate chargeable calls.

You should check also the option :

[quote];allowguest=no ; Allow or reject guest calls (default is yes)
; If your Asterisk is connected to the Internet
; and you have allowguest=yes
; you want to check which services you offer everyone[/quote]