[SOLVED]:Hang up if telemarketing music at the start of call

General discussions about Asterisk.

Moderators: Moderator, Support

[SOLVED]:Hang up if telemarketing music at the start of call

Postby meneses » Wed Jun 03, 2015 5:35 am

Hello.

My company is being harassed by telemarketers and I want to block those calls but this company calls from different numbers almost everytime which prevents me from using a 'blacklist'. The only thing in common with all the calls is that a music ad is played as soon as the're picked up.

So I thought about recording (at least) the start of the calls and compare it to a stored sample, if they're the same, hangup, otherwise let the call flow.

Do you guys have any thought on this? Ever heard of somethihng similar or ever entirely different that I can use? keeping in mind I use both SIP an PRI trunking with the telco.

Thank you!

System info:
CentOS 5.5
asterisk 1.8
dahdi 2.6.1
libpri 1.14.15
Last edited by meneses on Mon Jun 22, 2015 5:03 am, edited 1 time in total.
meneses
Oldsterisk
 
Posts: 72
Joined: Fri Jul 25, 2008 7:26 am

Re: Hang up if telemarketing music at the start of call

Postby meneses » Mon Jun 22, 2015 5:02 am

After a while I ended up figuring out something that worked, although with a different approach.

I used the AMD aplication to analyse the audio pattern and determine if it's a machine or a human instead of comparing the start of a call with a pre-recorded sample.

The following script checks the AMDCAUSE variable set by AMD app and then hangs up if the values are "LONGGREETING-1500-1500" or "MAXWORDS-3-3".

Code: Select all
[machine-killer]
exten => s,1,NoOp(## ISAAC ASIMOV'S LAWS DO NOT APPLY ##)
exten => s,n,Answer()
exten => s,n,AMD()
exten => s,n,NoOp(AMDSTATUS=${AMDSTATUS}${AMDKSTATUS})
exten => s,n,NoOp(AMDCAUSE=${AMDCAUSE})
exten => s,n,ExecIf($["${AMDCAUSE}" == "LONGGREETING-1500-1500" || "${AMDCAUSE}" == "MAXWORDS-3-3"]?HangUp())
exten => s,n,Return()


I realise this script can be improved, so do it if you need 8)

This blog post had the solution for my need, hope it can useful to someone else:
https://tatianno.wordpress.com/2014/11/26/bloqueando-chamadas-a-cobrar-em-gateways-sip-fxo/
meneses
Oldsterisk
 
Posts: 72
Joined: Fri Jul 25, 2008 7:26 am


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 1 guest