[asterisk-users] Blacklisting Toll-Free etc.

Trevor Peirce tpeirce at digitalcon.ca
Sat Aug 18 15:14:21 CDT 2007


voiplist wrote:
> I have always been able to block toll-free numbers by catching them
> with a line similar to this for each DID I have on my system:
>
> exten => 5554441212/_888NXXXXXX,n,Playback(GoAway)
>
> Where 15554441212 is one of the DIDs that rings into our Asterisk box.
>
> The problem with this approach that I have to create a line like this
> for every pattern I want to block multiplied by every DID on my
> system, this gets old.
>   
Yup, try something like this -

[macro-blocktollfree]
exten => s,1,GotoIf($["${MACRO_EXTEN:3}" = "800"]?goaway)
exten => s,n,GotoIf($["${MACRO_EXTEN:3}" = "888"]?goaway)
(etc...)
exten => s,n,MacroExit
exten => s,n(goaway),Playback(goaway)

Then, if this will always be your first priority, you can include it 
globally with something like

exten => _NXXNXXXXXX,1,Macro(blocktollfree)

Just make sure all other exten => lines start at priority 2 so you don't 
have a conflict.

HTH,
Trevor

-- 
Does your Canadian VoIP service need CRTC-compliant 9-1-1 services?  Please
visit http://www.digitalcon.ca/voip9-1-1/ to find out more!




More information about the asterisk-users mailing list