[asterisk-dev] forking calls from friends
Steven Critchfield
critch at basesys.com
Mon Aug 28 07:50:21 MST 2006
On Mon, 2006-08-28 at 07:56 -0600, Bromont - wrote:
> Hello all...
>
> I had been looking for a way to isolate calls from my daughter's
> friends. I wanted something similar in function to lookupblacklist,
> where I can lookup the number in the database and send those calls to
> my daughter's extension and voicemail. I decided to copy
> app_lookupblacklist.c as app_lookupfriendlist.c and changed the
> "blacklist" variables to "friendlist" variables. After a compile and
> some additions to the friendlist database key, everything works just
> like lookupblacklist. I'm just curious if there's a simpler way of
> doing this, or if app_lookupfriendlist would possibly be a welcome
> addition to the program distribution.... Thanks...
Sounds like while it saved you a lot of work to get your immediate goal
accomplished, it was built in a manner considered not very desirable.
Specifically, cut and paste code.
>From your description, it sounds like most of the code is exactly as it
was originally, but now in more than one location. A suggestion might be
to go back to the original blacklist app and see how you could have
refactored the code to be generalised and allow you to pass in an
additional value that determines if you want blacklisting or
whitelisting(friends). Maybe keep an eye forward for other options such
as grey listing. Maybe you could change lookupblacklist to just
lookuplist(blacklist), lookuplist(friend), lookuplist(questionable).
My opinion on this is that you then have made asterisk much more
flexable than by adding such a narrow feature that was mostly the same
code.
While I don't use the feature, I am sure a patch to implement the above,
plus a backwards compatible app registration that makes a
lookupblacklist() point to the lookuplist(blacklist) would be acceptable
provided you have sent in your disclaimer to Digium and you post your
patch to bugs.digium.com
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-dev
mailing list