[asterisk-users] block certain numbers

A J Stiles asterisk_list at earthshod.co.uk
Mon Jun 17 04:15:06 CDT 2013


On Monday 17 June 2013, binary dreamer wrote:
> Hi.
> 
> 
> i would like to manually create a list of numbers to block.
> these numbers are from spammers (advertizers).
> is there an easy way to send these particular numbers to busy or even drop
> the call?

Yes!  Dead easy.

Use an external script, written in your favourite language, to look up the 
number in some sort of database and return failure  (exit 1)  if it finds it 
there, or success  (exit 0)  if not.  Call this with System() in dialplan.  If 
the System() call succeeds  (meaning the number was not found in the 
database),  Asterisk will move onto the next priority; if it fails  (meaning 
the number was in the database)  then it will move on by an extra 100.

Alternatively, you can read the value of ${SYSTEMSTATUS} to get the exit code.

-- 
AJS

Answers come *after* questions.



More information about the asterisk-users mailing list