I am setting up an Asterisk VoIP server (using FreePBX) and I need to identify all numbers that end with a particular pattern.
This is required for routing purposes, that is, to find out whether they come from an outbound trunk or an internal phone.
For example, local number 777777 may appear as 777777, 01222777777, 441222777777, 00441222777777, or +441222777777.
A few searches didn't help me to figure it out. How can it be done?