[Asterisk-Users] OT?: International number parsing
Damon Estep
damon at suburbanbroadband.net
Fri Jan 27 16:32:47 MST 2006
Agreed, that is what I plan to do, but do you know if the numbering
plans are such that a countrycode+citycode+"portion of a local number"
could ever be mistaken for a different country/city combination?
Since international numbers vary in length, and country and city codes
vary in length, there is no way to be sure unless the numbering plan is
such that no combination of citycode plus the start of the local number
could ever be mistaken for a different city code in the same country.
Likewise, there has to be assurance that no combination of
countrycode+start of city code could be mistaken for another country
code.
D
________________________________
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Script
Head
Sent: Friday, January 27, 2006 3:47 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] OT?: International number parsing
What you're trying to accomplish can be easily done with an SQL query.
You need to create a table of all the prefixes (international
dial+country code+city/carrier) and join by that prefix.
On 1/27/06, Damon Estep <damon at suburbanbroadband.net> wrote:
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?
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060127/b6a3806a/attachment.htm
More information about the asterisk-users
mailing list