[asterisk-users] Block Spam Calls
Doug Lytle
support at drdos.info
Fri Dec 13 14:32:56 CST 2019
On 12/13/19 11:48 AM, Julian Beach wrote:
> Hello Doug,
>
> Friday, December 13, 2019, 11:03:37 AM, you wrote:
>
>>> This is exactly what I do - “press 1 for a human”
>>> Works great
>> I do this as well, but I also do a database lookup to see if the number
>> is on our speeddial list and if so, pass the call directly on without
>> the IVR prompts.
For those that would like to see my code:
exten => 517xxxxxxx,1,Answer()
same => n,Gosub(check_blacklist,s,1)
same => n,Gosub(get_callerid,s,1)
same => n,Gosub(check_for_direct,s,1)
same => n,Set(CHANNEL(musicclass)=music)
same => n,Gosub(extension_timeouts,s,1)
same => n,Dial(SIP/3501,${timeout.timeout},TtKk)
same => n,NoOP(Dial Status: ${DIALSTATUS})
same => n,NoOP(Hangup Cause: ${HANGUPCAUSE})
same => n,Gosub(s-${DIALSTATUS},s,1)
[check_for_direct]
;**********************************************************************
;* Check if there is a match of the inbound call to the speed dial list
;* If not, make then go through the IVR menu
;*******************************************
exten =>
s,1,Set(ARRAY(speed.phone,speed.name)=${ODBC_MENU_DIRECT(drdos,${CALLERID(number)})})
;********************************************************
;* If the contents of speed.phone is blank, assume that it
;* is not programmed and force the call to use the IVR to
;* prove they are not an automated call.
;********************************************************
same => n,GotoIf($["${speed.phone}" != "" ]?3:ivr_menu,s,1)
same => n,NoOP(${speed.name} is on the approved list)
same => n,Return()
same => n,Hangup()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20191213/a1f7c86d/attachment.html>
More information about the asterisk-users
mailing list