Check file for dialable area codes

Hi,

How can I check a file in which I’ve added list of dial-able area codes before dialing the number?

Scenario is

I have multiple providers, some are giving me flat rate, for other rate vary according to area. I want asterisk to check for area codes from file (in which I have added a list of area codes whose cost per minute is less then X cents), if area code is there it should dial otherwise goto second dial option.

I don’t know your file format but you can use FILE function to read the content and then perform some operations in dialplan to see if area code exists in it or not

For a large number of codes, you would want to load them into a database. For a smallish number, the most efficient way would probably be to encode them into a dialplan subroutine.

1 Like