[Asterisk-Users] OT?: International number parsing

Damon Estep damon at suburbanbroadband.net
Fri Jan 27 08:06:56 MST 2006


Can anyone shed some light on "rules" that might make the task of
parsing the country code and city codes from a dialed number in the
CDRs?

I know that there is almost never a case where a concatenated country
and city code could overlap with another country code, but what about
city codes and local numbers? Is it possible for a concatenated city
code and local number to match another city code in the same country?

I already have the table of country and city codes built.

Are there holes in this theory;

1. Starting after the international dialing code, find the longest match
for country code.
2. Starting after the country code from step 1, find the longest match
for city code within that countries table of city codes.
3. The rest is the local number.

Are there known exceptions?

Am I reinventing the wheel rather than finding the right already
existing resource?





More information about the asterisk-users mailing list