No commercial module helps with this. You could use Dynamic Routes and branch call flow based on area code. To get the area code from the caller ID of a North American number, you would use the Asterisk function like this:
The problem with this approach is that there are many area codes, and you would have to enumerate each in the dynamic route. To do this efficiently you would need an AGI or API that returned the correct destination based on the area code.
In the North America Numbering Plan the NPA is part of the geographic location. The NXX is the Rate Center. The XXXX is the user. 313 NPA means Wayne County Michigan while 734 is both Wayne and Washtenaw county as it was the NPA for the latter and expanded to an overlay in the former.
It should work anywhere in the world, but be aware that US cell phone numbers will return only the state, land lines return the original office from which it was assigned, given number portability it just ‘best effort’
I use what the script returns to do a DBget on an asteriskdb family relating that data to endpoint, sometimes the city is useful, sometimes just the state. You can adjust the script to just extract any two digit state from a land line
That would depend on what argv was +1NXXNXXXXXX or 1NXXNXXXXXX or NXXNXXXXXX would return the NANP ones, +33.X or 01133.* the French and +44.* or 01144.* the UK ones, , the number must however match what is ‘possible’ and ‘valid’ in that locale, so 011441207778888 would return a null as would 13231501244
The library can do a lot more than this snippet uses, like TimeZone