Posted: Mon May 25, 2009 8:35 pm Post subject: [asterisk-users] howto store local exchange prefixes ?
The local telco is now going 10 digit dialing even for local (free)
calls which used to be 7 digit. For a while no problem, everyone will
continue to dial 7 digits, and I'll add the area code. But pretty soon
everyone will become used to 10 digits.
There are about 40 3 digit local exchanges. I'd like to store the
exchanges in a database, and use the dialplan to check them. I can
figure that out.
I've looked at the Berkeley DB. That works pretty well, if the exchanges
are all stored. But it looks like the exchanges have to be entered 1 by
1 from the CLI. And can only be reviewed, corrected, or deleted from the
CLI. I haven't found any simple frontend for the DB.
I'd also consider sqlite3, but from the sqlite3 .conf.sample, it's only
for CDR. In any event, I couldn't find a simple frontend. I'd prefer not
to go into mysql etc for such a simple project.
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Posted: Mon May 25, 2009 8:55 pm Post subject: [asterisk-users] howto store local exchange prefixes ?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
sean darcy wrote:
Quote:
I've looked at the Berkeley DB. That works pretty well, if the exchanges
are all stored. But it looks like the exchanges have to be entered 1 by
1 from the CLI. And can only be reviewed, corrected, or deleted from the
CLI. I haven't found any simple frontend for the DB.
I do this be writing a dialplan which adds those entries. The first
entry checks to see if the DB has been initialized and if so, skips to
the lookup. Otherwise it loads each into the database before the
lookup. It's very easy to write a quick script to generate the dialplan
code.
Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Posted: Mon May 25, 2009 9:03 pm Post subject: [asterisk-users] howto store local exchange prefixes ?
sean darcy wrote:
Quote:
The local telco is now going 10 digit dialing even for local (free)
calls which used to be 7 digit. For a while no problem, everyone will
continue to dial 7 digits, and I'll add the area code. But pretty soon
everyone will become used to 10 digits.
Lucky you.
Other states require 11 digits for all calls, regardless, and yet others
require 10 digit for local and 11 digit for toll, they way the NANP was
SUPPOSED to evolve, until the inmates took over the asylum and each
state ( in the US ) PUC sets the numbering plan and splits vs overlays.
John Novack
Quote:
There are about 40 3 digit local exchanges. I'd like to store the
exchanges in a database, and use the dialplan to check them. I can
figure that out.
I've looked at the Berkeley DB. That works pretty well, if the exchanges
are all stored. But it looks like the exchanges have to be entered 1 by
1 from the CLI. And can only be reviewed, corrected, or deleted from the
CLI. I haven't found any simple frontend for the DB.
I'd also consider sqlite3, but from the sqlite3 .conf.sample, it's only
for CDR. In any event, I couldn't find a simple frontend. I'd prefer not
to go into mysql etc for such a simple project.
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
sean darcy wrote:
> The local telco is now going 10 digit dialing even for local (free)
> calls which used to be 7 digit. For a while no problem, everyone will
> continue to dial 7 digits, and I'll add the area code. But pretty soon
> everyone will become used to 10 digits.
>
>
Lucky you.
Other states require 11 digits for all calls, regardless, and yet others
require 10 digit for local and 11 digit for toll, they way the NANP was
SUPPOSED to evolve, until the inmates took over the asylum and each
state ( in the US ) PUC sets the numbering plan and splits vs overlays.
John Novack
> There are about 40 3 digit local exchanges. I'd like to store the
> exchanges in a database, and use the dialplan to check them. I can
> figure that out.
>
Very lucky, we have 700 prefixes to check that are 10 digits on one some our trunks and 11 on others, and some that don't care either way!
Right now I have a script that parses the prefixes and creates the dial plan in an #include file. Since the prefixes don't change the frequently, it seems to work. Assume that everything is 11 digits, then using a dialing macro, find an open trunk and strip the '1' if needed. Now my users never have to dial a 11, but it works if they do.
I would welcome some ideas for a more elegant solution!
So if cell phones never require 11 digits...
The company line about NANP and consistancy:
"We don't care.We don't have to.We're the phone company."-Jonathan
Posted: Tue May 26, 2009 12:46 am Post subject: [asterisk-users] howto store local exchange prefixes ?
Barry L. Kline wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
sean darcy wrote:
> I've looked at the Berkeley DB. That works pretty well, if the exchanges
> are all stored. But it looks like the exchanges have to be entered 1 by
> 1 from the CLI. And can only be reviewed, corrected, or deleted from the
> CLI. I haven't found any simple frontend for the DB.
I do this be writing a dialplan which adds those entries. The first
entry checks to see if the DB has been initialized and if so, skips to
the lookup. Otherwise it loads each into the database before the
lookup. It's very easy to write a quick script to generate the dialplan
code.
Barry
Maybe I've not explained this correctly. I know, or can look up, the 40+
local exchanges that are local. I can parse the dial EXTEN to determine
the exchange. I can check the exchange against a DB. I want to determine
which exchanges are "local". I do not want to store an exchange dialed
by a user.
How can I store a lot of 3 digit numbers which I then can check against
an EXTEN to determine a local number?
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Posted: Tue May 26, 2009 1:02 am Post subject: [asterisk-users] howto store local exchange prefixes ?
I created a mysql table and lookup script for this. One one server were we
could not use mysql, we created an array of exchanges and compared to those.
-----Original Message-----
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of sean darcy
Sent: Monday, May 25, 2009 9:40 PM
To: Asterisk Users List
Subject: Re: [asterisk-users] howto store local exchange prefixes ?
Barry L. Kline wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
sean darcy wrote:
> I've looked at the Berkeley DB. That works pretty well, if the
> exchanges are all stored. But it looks like the exchanges have to be
> entered 1 by
> 1 from the CLI. And can only be reviewed, corrected, or deleted from
> the CLI. I haven't found any simple frontend for the DB.
I do this be writing a dialplan which adds those entries. The first
entry checks to see if the DB has been initialized and if so, skips to
the lookup. Otherwise it loads each into the database before the
lookup. It's very easy to write a quick script to generate the
dialplan code.
Barry
Maybe I've not explained this correctly. I know, or can look up, the 40+
local exchanges that are local. I can parse the dial EXTEN to determine the
exchange. I can check the exchange against a DB. I want to determine which
exchanges are "local". I do not want to store an exchange dialed by a user.
How can I store a lot of 3 digit numbers which I then can check against an
EXTEN to determine a local number?
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Barry L. Kline wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sean darcy wrote:
>
>> I've looked at the Berkeley DB. That works pretty well, if the
>> exchanges
>> are all stored. But it looks like the exchanges have to be entered 1 by
>> 1 from the CLI. And can only be reviewed, corrected, or deleted from
>> the
>> CLI. I haven't found any simple frontend for the DB.
>
> I do this be writing a dialplan which adds those entries. The first
> entry checks to see if the DB has been initialized and if so, skips to
> the lookup. Otherwise it loads each into the database before the
> lookup. It's very easy to write a quick script to generate the dialplan
> code.
>
> Barry
Maybe I've not explained this correctly. I know, or can look up, the 40+
local exchanges that are local. I can parse the dial EXTEN to determine
the exchange. I can check the exchange against a DB. I want to determine
which exchanges are "local". I do not want to store an exchange dialed
by a user.
How can I store a lot of 3 digit numbers which I then can check against
an EXTEN to determine a local number?
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
____________________________________________________________
Receive Notifications of Incoming Messages
Easily monitor multiple email accounts & access them with a click.
Visit http://www.inbox.com/notifier and check it out!
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Jimmy
> -----Original Message-----
> From: seandarcy2@gmail.com
> Sent: Mon, 25 May 2009 21:39:30 -0400
> To: asterisk-users@lists.digium.com
> Subject: Re: [asterisk-users] howto store local exchange prefixes ?
>
> Barry L. Kline wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> sean darcy wrote:
>>
>>> I've looked at the Berkeley DB. That works pretty well, if the
>>> exchanges
>>> are all stored. But it looks like the exchanges have to be entered 1 by
>>> 1 from the CLI. And can only be reviewed, corrected, or deleted from
>>> the
>>> CLI. I haven't found any simple frontend for the DB.
>>
>> I do this be writing a dialplan which adds those entries. The first
>> entry checks to see if the DB has been initialized and if so, skips to
>> the lookup. Otherwise it loads each into the database before the
>> lookup. It's very easy to write a quick script to generate the dialplan
>> code.
>>
>> Barry
>
> Maybe I've not explained this correctly. I know, or can look up, the 40+
> local exchanges that are local. I can parse the dial EXTEN to determine
> the exchange. I can check the exchange against a DB. I want to determine
> which exchanges are "local". I do not want to store an exchange dialed
> by a user.
>
> How can I store a lot of 3 digit numbers which I then can check against
> an EXTEN to determine a local number?
in addition to localcallingguide, if your pstn connection is from at&t, you
can take a look at the script i made to grab only the "local" calls
(incurring no local-toll or long distance charges) which are"band a" and
"band b."
Posted: Tue May 26, 2009 1:02 pm Post subject: [asterisk-users] howto store local exchange prefixes ?
Now that I've slogged through everyone else's reply and got to the original
post, here's an idea. You seem to have the dialplan part worked out; why
not do a simple HTML interface to do the Berkley maint using asterisk -rx to
do the CLI reads/pokes? With asterisk -rx you can automate 90+ percent of
CLI functions.
-----Original Message-----
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of sean darcy
Sent: Monday, May 25, 2009 4:29 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] howto store local exchange prefixes ?
The local telco is now going 10 digit dialing even for local (free)
calls which used to be 7 digit. For a while no problem, everyone will
continue to dial 7 digits, and I'll add the area code. But pretty soon
everyone will become used to 10 digits.
There are about 40 3 digit local exchanges. I'd like to store the
exchanges in a database, and use the dialplan to check them. I can
figure that out.
I've looked at the Berkeley DB. That works pretty well, if the exchanges
are all stored. But it looks like the exchanges have to be entered 1 by
1 from the CLI. And can only be reviewed, corrected, or deleted from the
CLI. I haven't found any simple frontend for the DB.
I'd also consider sqlite3, but from the sqlite3 .conf.sample, it's only
for CDR. In any event, I couldn't find a simple frontend. I'd prefer not
to go into mysql etc for such a simple project.
sean
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Posted: Tue May 26, 2009 1:31 pm Post subject: [asterisk-users] howto store local exchange prefixes ?
sean darcy wrote:
Quote:
Maybe I've not explained this correctly. I know, or can look up, the 40+
local exchanges that are local. I can parse the dial EXTEN to determine
the exchange. I can check the exchange against a DB. I want to determine
which exchanges are "local". I do not want to store an exchange dialed
by a user.
I didn't explain myself very well.
My Asterisk system sits between the PSTN and a legacy PBX. Asterisk
answers the call and among other things, prompts for an extension
number. I needed to know if the extension entered is valid before
sending the call on to the old PBX. I simply have a lookup subroutine
to validate the extension.
My code for looking up the validity of their entry is:
The lookup, which will initialize the AsteriskDB if necessary, is:
;
; This subroutine's purpose is to check the validity of an extension.
;
; Parameters:
; ARG1 = Extension to check
; Returns:
; FOUND or NOTFOUND
;
[validate-extension]
exten => s,1,Verbose(1,Checking validity of extension ${ARG1});
;
; Let's check to ensure that the database is loaded. We'll do
; that by looking for extension 399, the Iwatsu master phone.
;
exten => s,n,GotoIf(${DB_EXISTS(${DB_IWATSU_EXTENSIONS}/399)}?search:load)
exten => s,n(load),DBdeltree(${DB_IWATSU_EXTENSIONS}); Clear all
existing entries
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/120)='Rikki')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/121)='Terri')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/122)='CorpConf')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/123)='Linda')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/124)='Kim')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/125)='Nancy B')
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/126)='Wayne')
...
;
; Extension 399 is the master extension for the Iwatsu
; and should always show up. It is used for testing
; the validity of the database in the dialplan.
;
exten => s,n,Set(DB(${DB_IWATSU_EXTENSIONS}/399)='MASTER')
;
; Search here
;
exten =>
s,n(search),GotoIf(${DB_EXISTS(${DB_IWATSU_EXTENSIONS}/${ARG1})}?found:notfound)
exten => s,n(found),Return(FOUND);
exten => s,n(notfound),Return(NOTFOUND);
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum