How to add a number to blacklist

Hi,

I am trying to add the telephone numbers to the blacklist.

“To add a number to the blacklist, run the [color=#BFBF00]‘database put blacklist number 1’[/color] command from the Asterisk command-line interface.”

Can you please give me an example of the same ?

Regards

Deepak Bhatia

What exactly is your problem?

Hello,

We want to certain caller ids to not use our IVR. If the caller id is in the blacklist, then the IVR will simply hangup.

Regards

Deepak Bhatia

You will have to do some dialplan coding. To get values from AstDB, you can use this:

Set(Blacklist_Num=${DB(blasklist list in AstDB - whatever it is)})

Then you test the value:

GotoIf($[${ISNULL(${Blacklist_Num})}]?not_blacklisted:blacklisted)

I told you the hard part, you should know the rest :wink:

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>

Thanks for your reply but I would like to know how do we add the blacklist number with example from the asterisk cli.

‘database put blacklist number 1’