[Asterisk-Users] country/city codes

Jay Milk jay at skimmilk.net
Thu Mar 3 18:22:54 MST 2005


The way I did this is to simply build a tree in the database in the
shape of...

4  -  2 -> Sweden
   -  4 -> UK
   -  9 -> Germany

1  - 8  -  0  -  0  -> US TollFree
              -  9  -> Dominican Republic

Etc.  I just traverse the tree until I get to a node, and I store the
rate with that as well while I'm at it.

Working on the beta here -- http://voiprates.us/rateengine

Suggestions are welcome -- if anyone has additional rate-sheets (CSV or
HTML), I can incorporate them.

> -----Original Message-----
> From: Nir Simionovich [mailto:nirs at dimitel.com] 
> Sent: Thursday, March 03, 2005 11:27 AM
> To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> Subject: RE: [Asterisk-Users] country/city codes
> 
> 
> Very simple, lets take Israel and Palesatnian authority. 
> Israel's country code is 972, mobile area codes are 2 digits, 
> local area codes are 1 digit, 
> and there is a special area code, which is a subset of a 1 
> digit area code, which is East Jerusalem, which uses the 
> following 9722201 and 9722202 and 
> a couple more which have different billing.
> 
> In the above case, your formula would fail, as it will simply 
> pick up the entire 9722 as a single area code, where in fact 
> it's more than one. Where in fact, it should have picked up 
> 972+2+201. 
> 
> Oh, just to show the importance, calls to 97223xxxxx are 
> usually charged at 3c a minute, calls to 9722201 are charged 
> at 15c a minute. 
> 
> See the difference? Math doesn't solve everything.
> 
> Nir S
> 
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of 
> Matthew Boehm
> Sent: Thursday, March 03, 2005 6:55 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [Asterisk-Users] country/city codes
> 
> Care to give an example of where it fails? We've been using 
> it for 6 months, no problems.
> 
> -Matthew
> 
> ----- Original Message ----- 
> From: "Bob Goddard" <asterisk at bgcomp.co.uk>
> To: "Asterisk Users Mailing List - Non-Commercial Discussion" 
> <asterisk-users at lists.digium.com>
> Sent: Thursday, March 03, 2005 10:40 AM
> Subject: Re: [Asterisk-Users] country/city codes
> 
> 
> > On Thursday 03 March 2005 15:28, Matthew Boehm wrote:
> > > Yet another example of someone who couldn't take 2 min to google:
> > >
> > > 
> http://lists.digium.com/pipermail/asterisk-dev/2004-May/004151.html
> >
> > It's not foolproof.
> >
> > > ----- Original Message -----
> > > From: "Nir Simionovich" <nirs at dimitel.com>
> > > To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" 
> > > <asterisk-users at lists.digium.com>
> > > Sent: Thursday, March 03, 2005 8:46 AM
> > > Subject: RE: [Asterisk-Users] country/city codes
> > >
> > > > To my knowledge, there is no such formula. However, you 
> can obtain 
> > > > a database of the entire ITU E164 numbering plan at 
> > > > http://www.numberingplans.com 
> <http://www.numberingplans.com/> , 
> > > > which have an updated database of all that information.
> > > >
> > > >
> > > >
> > > > Nir S
> > > >
> > > >
> > > >
> > > >   _____
> > > >
> > > > From: asterisk-users-bounces at lists.digium.com
> > > > [mailto:asterisk-users-bounces at lists.digium.com] On 
> Behalf Of VoIP
> > >
> > > Services
> > >
> > > > Sent: Thursday, March 03, 2005 4:25 PM
> > > > To: asterisk-users at lists.digium.com
> > > > Subject: [Asterisk-Users] country/city codes
> > > >
> > > >
> > > >
> > > > Some country codes are three digits long.  Some are two.
> > > >
> > > > e.g. UK 44 , Bermuda 441
> > > >
> > > > Does anyone know a formula for determining which part 
> of a dialled
> number
> > >
> > > is
> > >
> > > > the country code and city code ?
> > [.. Why the hell can people not delete the signatures? ...] 
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com 
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com 
> http://lists.digium.com/mailman/listinfo/aster> isk-users
> To 
> UNSUBSCRIBE or update options visit:
>    
http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






More information about the asterisk-users mailing list