There is a function that does this. He wants to know how to load ASTDB from the CLI.
<function name="BLACKLIST" language="en_US">
<synopsis>
Check if the callerid is on the blacklist.
</synopsis>
<syntax />
<description>
<para>Uses astdb to check if the Caller*ID is in family <literal>blacklist</literal>.
Returns <literal>1</literal> or <literal>0</literal>.</para>
</description>
<see-also>
<ref type="function">DB</ref>
</see-also>
</function>