If you need to validate current numbers:
- starting with 9 would be mobile
- 7 is nextel (another "type" of mobile)
- the rest would be fixed
If you need to handle history, it depends on the period you have stored, but in a generic way it would be:
- first digit > 5 is mobile
- first digit < 5 is fixed
- first digit = 5 can be fixed or mobile
This last scenario is due to the fact that, at a given moment, before the ninth digit deployment, the anatel released the use of the numbers initiated by 5 for the mobile network, and there were already fixed started by 5 (most of the scenarios in SP )