That looks correct to me. Make sure you added the following to the correct incoming call section of your extensions.conf: exten => s,n,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
Its also possible that you may need to use a different portion of the CALLERID for your phone, see the available options here: http://www.voip-info.org/wiki/view/Asterisk+func+callerid
More information about text formats
re: I am still getting asterisks as the callerid for all the cal
That looks correct to me. Make sure you added the following to the correct incoming call section of your extensions.conf:
exten => s,n,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
Its also possible that you may need to use a different portion of the CALLERID for your phone, see the available options here: http://www.voip-info.org/wiki/view/Asterisk+func+callerid