[Asterisk-Users] OT?: International number parsing

Script Head scripthead at gmail.com
Fri Jan 27 15:47:10 MST 2006


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/c388a180/attachment.htm


More information about the asterisk-users mailing list