[Asterisk-doc] Simple tweaks and customisations: LookupCIDName

Jim Van Meggelen jim at vanmeggelen.ca
Wed Mar 9 09:41:46 CST 2005


Randy!

This is a great recipe for the cookbook!

Admit it, you want to write!

The cookbook needs an editor!


--
Jim Van Meggelen
jim at vanmeggelen.ca


asterisk-doc-bounces at lists.digium.com wrote:
> Simple tweaks and customisations
> 
> Asterisk has a useful feature if you subscribe to callerID or use it
> internally at your installation. A one-line call to the application
> LookupCIDName will set any name you want to be associates with an
> incoming number for display on phones and workstation
> callerid popups.
> Sometimes the names sent by the phone company are not
> specific enough.
> If your local install has a lot of user extensions, "Support: Bernie"
> is better than "2002".
> 
> Using the feature is simple. Early in a dialplan extension that
> processes incoming calls, you just add this line:
> 
>   exten => s,6,LookupCIDName
> 
> This will look up the number in the asterisk database and if a key is
> found in the cidname family, it will place that value into
> ${CALLERIDNAME} replacing what was there before, if anything, during
> this extension execution. 
> 
>  From the CLI, type database show cidname for the full list or
> 
>   database show cidname/0102030405
> 
> A few simple shell scripts can help you get the list started and
> maintain it: 
> 
> To add a name to a number create a command called "cidset":
> 
> /usr/sbin/asterisk -rx "database put cidname $1 \"$2\""
> 
> ./cidset 0102030405 "His Majesty the Boss"
> Updated database successfully
> 
> To show a name associated with a number, or the whole list,
> we'll create
> "cidshow":
> 
> if [ ! "$1" = "" ]; then
> /usr/sbin/asterisk -rx "database show cidname/$1"
> else
> /usr/sbin/asterisk -rx "database show cidname"
> fi
> 
> ./cidshow 0102030405
> /cidname/0102030405                               : His
> Majesty the Boss
> 
> If you already have a list of phone correspondants in
> electronic form,
> you can see how simple it would be to insert it into the asterisk db
> with a simple script. 
> 
> rr
> _______________________________________________
> Asterisk-Doc mailing list
> Asterisk-Doc at lists.digium.com
> http://lists.digium.com/mailman/listinfo/> asterisk-doc


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 08/03/2005
 



More information about the Asterisk-Doc mailing list