I have an app where users registers and enters their mobile phone and other data. In order to verify that the user is valid, before i save it to my database, I send a sms to the user with a code. And after that they should enter the code in the form.
The problem is that my sms provider charges me if i try to send a sms even if the phone number is not valid.
How to prevent a DDoS attack on my app which will send try to send a sms every time (even if the number is not valid)?