For anyone interested, here's a chunk of code on my system...with a brief 
explaination...

The house is at extension 600.  This processes it before passing it to the 
house ring group 601 which rings various phones around the house, a combination 
of analog and sip sets
.
The main business line is at extension 501 (this bypasses the ivr at 500).

Both house and business systems (home office) receiving their respective 
incoming calls off the incoming Mediatrix 1204 box and sip lines.  If the 
business line is busy outgoing, it will use the house line so some clients pick 
up the house line on their call return.

My callerid lookup routine prefaces my business clients with a B: so the phone 
redirects them to the business line regardless of how they come in .  The 
callerid lookup also checks a number of database for cnam info which if failing 
that, checks 800notes for a listing there, and parses out complaints, 
telemarketers, telephone surveyers, collection agencies, and other junk 
listings.  It prefaces the caller id then with a code to handle here.  It 
passes the info provided by Bell inside the "[]" delimiter so if there's 
nothing found, and a blank [] is found in the callerid string, the call is 
treated as no caller id.  I've a script that loads asterisk with my outlook 
data periodically too so I have a reasonably up to date list of clients numbers 
and names.

Extension 609 is a sip extension that simply has the house outgoing vm message, 
but drop the message into the office message box.
Extension 699 is a single line on the digital sets in the office and basement 
so they don't wake the family nor interrupt us at dinner.

You can see there's a couple of companies too that since they provide their 
caller id info, it doesn't get lookups on 800notes hence misses the 
telemarketing flag.  They've been added explicitly as a result.

The O and P codes are errors in caller id info coming in from the Mediatrix 
box.  They get handled like no caller id type calls.

Any call that doesn't have any type of caller id info (or blocked) gets treated 
to the likely deadbox treatment.

You'll see that it also dumps all 800, 866, 877, 888, etc calls to the likely 
dead box too since I have yet to get one of those who I really wanted to 
interrupt what I'm doing to get.

This works well for me and has cut the dinner interruptions down to nil.  The 
only one who doesn't like it my brother in law who uses a blocked caller id 
cell phone.  Alas, if he'd dial the business line, then punch in the house 
extension, he'd get through anyhow...but you can't teach an old dog new tricks.

To answer the original question, this type of script could easily capture names 
and go to different IVR's too instead of extensions.

Hope this explanation helps and you can use this or something like it.

Good luck
Dave


*********************


; house based calls

exten => 600,1,NoOp("********* Start incoming house call ***************

; drop callerid leading 1 if applicable
exten => 600,n,GotoIf($[${LEN(${CALLERID(num)})}<11]?start)
exten => 600,n,GotoIf($[${LEN(${CALLERID(num)})}>11]?start)
exten => 600,n,Set(CALLERID(num)=${CALLERID(num):1})


; check callerid info against various databases
exten => 600,n(start),NoOp("*************Pre Lookup CID Info*********")
exten => 600,n,NoOp("${CALLERID(num)})
exten => 600,n,NoOp("${CALLERID(name)})
exten => 600,n,Gosub(cidlookup,cidlookup_1,1)
exten => 600,n,NoOp("Post Lookup CID Info")
exten => 600,n,NoOp("${CALLERID(num)})
exten => 600,n,NoOp("${CALLERID(name)})

exten => 600,n,NoOp("*****************************************")

; check incoming home calls for routing via Asteridex...if listed, route 
accordingly

; Business Redirect

exten => 600,n,NoOp("B:")
exten => 600,n,GotoIf($["${CALLERID(name):0:2}" = "B:"]?busbox)
exten => 600,n,NoOp("Blocked CallerID")
exten => 600,n,GotoIf($["${CALLERID(name):0:2}" = "[]"]?likelydeadbox)
exten => 600,n,NoOp("Telemarker")
exten => 600,n,GotoIf($["${CALLERID(name):0:4}" = "Tele"]?deadbox)
exten => 600,n,NoOp("Charity")
exten => 600,n,GotoIf($["${CALLERID(name):0:10}" = "Non-profit"]?deadbox)
exten => 600,n,NoOp("Collection")
exten => 600,n,GotoIf($["${CALLERID(name):0:7}" = "Collect"]?likelydeadbox)
exten => 600,n,NoOp("Recycling Matters")
exten => 600,n,GotoIf($["${CALLERID(name):1:12}" = "RECYCLINGMAT"]?deadbox)
exten => 600,n,NoOp("Sears Clean Air")
exten => 600,n,GotoIf($["${CALLERID(name):1:11}" = "SEARS CLEAN"]?deadbox)
exten => 600,n,NoOp("Complaint")
exten => 600,n,GotoIf($["${CALLERID(name):0:9}" = "Complaint"]?likelydeadbox)
exten => 600,n,NoOp("No Match")


; checking incoming home calls for 800,866,877,888 and dump to deadbox
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "800"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "866"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "877"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "888"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:3}" = "900"]?deadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:1}" = "P"]?likelydeadbox)
exten => 600,n,GotoIf($["${CALLERID(num):0:1}" = "O"]?likelydeadbox)

; if unknown - send zaptel then give 10 sec pause then pass call to get rid of 
automated machines
;exten => 600,n,GotoIf($["${CALLERID(name)}"<>"Unk"]?notblacklisted)
;exten => s,n,Wait(1)
;exten => s,n,Zapateller()
;exten => s,n,Zapateller()
;exten => s,n,Playback(pls-wait-connect-call)
;exten => s,n,Wait(10)

; pass call normally
exten => 600,n(notblacklisted),Goto(ext-group,601,1)
exten => 600,n,Hangup

; busbox handling
exten => 600,n(busbox),Goto(ext-group,501,1)
exten => 600,n,Hangup

; likelydeadbox handling
exten => 600,n(likelydeadbox),Goto(ext-group,699,1)
exten => 600,n,Hangup

; deadbox handling
exten => 600,n(deadbox),Macro(exten-vm,609,609)
exten => 600,n,Hangup
**************************

Reply via email to