[asterisk-users] block certain numbers

Salaheddine Elharit salah.elharit200 at gmail.com
Mon Jun 17 04:47:53 CDT 2013


hello

 if you have just some numbers to  block you can use the below code in your
dial plan

exten => 5xx,1,NoOp(Caller-ID: ${CALLERID(all)})
exten => 5xx,n,GotoIf($["${CALLERID(num)}"="0661xxxxxx" ]?3:4)
exten => 5xx,n,hangup
exten => 5xx,n,Dial(SIP/223, 30)


2013/6/17 A J Stiles <asterisk_list at earthshod.co.uk>

> 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.
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130617/a62f1435/attachment.htm>


More information about the asterisk-users mailing list