[asterisk-users] bypass menu for certain numbers?

Anselm Martin Hoffmeister anselm at hoffmeister-online.de
Thu Jan 4 16:53:07 MST 2007


Am Donnerstag, den 04.01.2007, 17:47 -0500 schrieb Noah Miller:
> > Let's say you use the Asterisk DB() stuff for your caller ids, storing
> > them in a branch called "book" like
> > book/16175551234 "John Doe"
> > book/12125559876 "Jane Miller"
> >
> > Then you could go with a logic like
> >
> > exten => s,1,Set(CALLERID(name)=${DB(book/${CALLERID(num)})})
> > exten => s,2,GotoIf($["${CALLERID(name)}" = ""]?3:100)
> > exten => s,3,---your business customers go here---
> >
> > exten => s,100,--- friends go here ---
> 
> I don't think this would do what you want it to do.  I think you
> should leave the caller id name out of it, and just use numbers.
> Also, I don't think you really want to change the CALLERID of the
> channel at all, just use it to compare.    I like Tzafrir's
> ex-girlfriend method.

The positive thing about changing CALLERID(name) is that in case a name
is present it can be displayed on the phone.

Just curious: Is there any reason to *not* use CALLERID(name)?

Of course, you could compres lines 1 and 2 to something like
exten => s,1,GotoIf($["${DB(book/${CALLERID(num)})}" = ""]?3:100)
I would prefer storing the name, once retrieved from the database, to
later hand it over to the phone - so why not just putting it into the
appropriate variable?

> > I'd like to have it only
> > be one "goto" for direct dial, and one for the main menu instead of
> > having to manually input all those numbers, and add new ones when
> > required.
> 
> Whether you enter them into the dialplan with the ex-girlfriend
> method, put them in a DB, or put them in a goto statement, you're
> going to have to add the new numbers at least once.  I think it's the
> same amount of work to add new numbers using any method.  The
> ex-girlfriend method seems a little more in tune with the 1.4 style
> (non-jumping) dialplans.

One difference is at which time the actualisation takes place. As I
understand, changes in the database could be easily done through a
web-interface, script or whatever without any complex dialplan file
rewriting logic, with changes taking place immediately. Changes to the
dialplan need an "extensions reload"...

Besides, from an administrative point of view, putting a list into a
database / table probably makes the dialplan easier to read than having
dozens of lines only differing in the caller id part.

My asterisk dialplan for all my phone communication needs heavily relies
on database functions. Any callrouting (incoming SIP calls route to
which internal ids), call forwarding, voicemail delay/activation, call
groups, automated reminder calls - all that can be easily changed by
ssh'ing into the asterisk box, doing "asterisk -rx database set
something", voila.

Your mileage is certainly a different one, and I thankfully take ideas
for improvement.

Best regards,

Anselm



More information about the asterisk-users mailing list