[Asterisk-Users] Using Blacklist
Dorian Gray
asterisk at tintar.com
Mon May 24 15:17:09 MST 2004
the following has been working well for me, and I think it does similar
to what you want...
[macro-blackdrop]
exten => s,1,Playback(giggle1)
; something is terribly wrong...!
exten => s,2,Playback(tt-somethingwrong)
; oh, it's those damnable weasels again...!
exten => s,3,Playback(tt-weasels)
exten => s,4,Playback(goodbye)
exten => s,5,Hangup
[inbound-analog]
exten => s,1,SetMusicOnHold,random
exten => s,2,Zapateller(answer|nocallerid)
exten => s,3,NoOp
exten => s,4,PrivacyManager
exten => s,5,LookupCIDName
exten => s,6,LookupBlacklist
exten => s,7,Background(pls-wait-connect-call)
exten => s,8,Dial(${PHONE1}&${PHONES1},20,Ttm)
exten => s,9,Answer
exten => s,10,Wait(1)
exten => s,11,Macro(vmessage,${PHONE1VM})
exten => s,105,Macro(blackdrop)
exten => s,107,Macro(blackdrop)
hm maybe I should move lookupcidname after lookupblacklist and save a
few cycles ^_^
Steven E. Frazier wrote:
> I am attempting to write in incoming context for calls.
>
> 1. If the caller id is given and it is not black listed it will Playback a
> greeting and then right the phone or go to voicemail under busy or
> unavailable conditions
> 2. If no caller id is given, then Privacy Manager will ask for the number.
> I am testing 6145551212 to see if the black list will work
> 3. If a caller id is given, and it is blacklisted (in the blacklist db) I
> would like for it to go to Playback/black-list-blocked message
>
>
>
>
> The db shows:
>
> asterisk*CLI> database show blacklist
> /blacklist/<1010987/18887975686number> : 1
>
> /blacklist/<name/number> : 1
>
> /blacklist/unlisted/6145551212 : 1
>
> asterisk*CLI>
>
>
> exten => 2129,1,Wait(1)
> exten => 2129,2,Zapateller(answer|nocallerid)
> exten => 2129,3,NoOp
> exten => 2129,4,PrivacyManager
> exten => 2129,5,LookupBlacklist
> exten => 2129,6,Dial(Zap/4,5,Ttr)
> exten => 2129,7,Answer
> exten => 2129,8,Wait(1)
> exten => 2129,9,Playback(personal/hello)
> exten => 2129,10,Playback(personal/i-am-not-in-at-the-moment)
> exten => 2129,11,VoiceMail2(u${EXTEN})
> exten => 2129,12,Hangup
> exten => 2129,102,VoiceMail2(b${EXTEN}) ; Busy Voicemail if extension is
> busy
> exten => 2129,106,Playback,personal/black-list-blocked
> exten => 2129,108,Wait(2)
> exten => 2129,110,Hangup
>
> When I dial my test extension of 2129, I get:
>
>
> asterisk*CLI>
> -- Starting simple switch on 'Zap/7-1'
> -- Disabling Caller*ID on Zap/7-1
> -- Executing Wait("Zap/7-1", "1") in new stack
> -- Executing Zapateller("Zap/7-1", "answer|nocallerid") in new stack
> -- Executing NoOp("Zap/7-1", "") in new stack
> -- Executing PrivacyManager("Zap/7-1", "") in new stack
> == Parsing '/etc/asterisk/privacy.conf': == Parsing
> '/etc/asterisk/privacy.conf': Found
> -- Playing 'privacy-unident' (language 'en')
> -- Playing 'privacy-prompt' (language 'en')
> -- Playing 'privacy-thankyou' (language 'en')
> -- Changed Caller*ID to "Privacy Manager" <6145551212>
> -- Executing LookupBlacklist("Zap/7-1", "") in new stack
> -- Executing Dial("Zap/7-1", "Zap/4|5|Ttr") in new stack
> -- Called 4
> -- Zap/4-1 is ringing
> -- Zap/4-1 is ringing
> -- Nobody picked up in 5000 ms
> -- Hungup 'Zap/4-1'
> -- Executing Answer("Zap/7-1", "") in new stack
> -- Executing Wait("Zap/7-1", "1") in new stack
> -- Executing Playback("Zap/7-1", "personal/hello") in new stack
> -- Playing 'personal/hello' (language 'en')
> -- Executing Playback("Zap/7-1", "personal/i-am-not-in-at-the-moment")
> in new stack
> -- Playing 'personal/i-am-not-in-at-the-moment' (language 'en')
> -- Executing VoiceMail2("Zap/7-1", "u2129") in new stack
> -- Playing 'vm-theperson' (language 'en')
> -- Playing 'digits/2' (language 'en')
> -- Playing 'digits/1' (language 'en')
> -- Playing 'digits/2' (language 'en')
> -- Playing 'digits/9' (language 'en')
> -- Playing 'vm-isunavail' (language 'en')
> -- Playing 'vm-intro' (language 'en')
> -- Playing 'beep' (language 'en')
> -- Recording the message
>
> It goes to the unavailable voice mail box.
>
> According to the documentation and my understanding:
>
>
> LookupBlacklist: Looks up the Caller*ID number on the active channel in the
> Asterisk database (family 'blacklist'). If the number is found, and if there
> exists a priority n + 101, where 'n' is the priority of the current
> instance, then the channel will be setup to continue at that priority level.
> Otherwise, it returns 0. Does nothing if no Caller*ID was received on the
> channel.
> Example: database put blacklist <name/number> 1
>
>
> Could someone tell me what I am doing wrong that it won't go to Priority 106
> and Playback black-list-blocked.
>
> Would someone share their context that is using blacklist to show me how
> they are doing it?
>
> Thanks.
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
More information about the asterisk-users
mailing list