Anti spam asterisk contact center [Anti Spam Asterisk]

This post show you how to anti spam from other to contact center using Asterisk core.

I Open the issue

Spam in call center is big issue but alite bit bussiness man care about and ignore from the begining when startup the system. Although Asterisk core have feature call “black list” but this just doing something called slove the problem when get issue not the solution stop it from the begining.

So, how we have the system can learn, filter, block some phone number have strange calls in to our contact center, transfer that call to a massage that you are not allow dial in because you call to ours too much. And we will optimize system, optimize human resource and agent who are working will not get stress.

II guiding build an application for Anti-Spam Asterisk

  1. Content

we have alot of experience on VoIP and Contact center, will show you how to build an application for this

This app will colect information from phone customer and count it interval time for sure.

what check list need to be look on spam?

example we have customer phone called 0933119056 dialin to the contact center with more than 10 calls per 5 minutes. So we need block this call for a time.

2. Building an application

+ Create new table

CREATE TABLE `asteriskcdrdb`.`antispam` (


`phone` VARCHAR(20) NULL,

`datetime` DATETIME NULL,

PRIMARY KEY (`id`));

+ We use AGI to build an app

#!/usr/bin/php -q




* @author Chau Ngoc Huynnh | Realtime Solutions

* @Email

* @copyright 2016




$agi = new AGI();



/*Defined for connection*/







/*Defined for detect spam*/

$phone=$argv[1]; // This is phone callin ours call center

$count_call =10; // This varible defined for max callin allow interval time

$interval_time=5;// This tell SQL check for max call in this time (Minutes))



Copy of anti-spam21

Copy of anti-spam22


3. put in to your asterisk configuring

example you need check from what you are looking for anti spam

exten => _.,1,agi(Anti-Spam.php, ${CALLERID(number)})


Contact me: Mr Huynh.


Skype: chaungochuynh15

Hotline: (+84) 08 730 33888 | (+84) 0933119056


Leave a Reply