[Asterisk-Users] Call routing based upon callerID

adrian serafini adrian at wombit.com
Tue Mar 30 09:26:12 MST 2004


Hello,

There is an agi script for this, but I use goto's in the extensions.conf.  Its
not terribly efficient, but it gets the job done.
I tried the blacklist but it only payed attention to the callerid.  The number
was completely ignored.  I could only put in one "WIRELESS CALLER", and there
are a lot.. so I googled, irc'd and moved on...

[globals]
MYFAMILY=4139999999 || 4139999999 || 6179999999        ;the 9's are real
numbers in mine
GIRLFAM=4159999999       ;the ||  =  or
GIRLWORK=65099999XX || 415999999X   ;the 9's should be real again, X's are
wild
BROTHERWORK=4159999XXX
CELL=14159999999

[macro-callfwd]
exten => s,1,SetCallerID(${FWDCID})        ;this no workey yet
exten => s,2,SetCIDName(${FOO}})
exten => s,3,Dial(IAX2/MynufonName at NuFone/${ARG1},8,tr) ;call me
exten => s,4,Hangup


[incoming]
exten => s,1,Wait(0)
exten => s,2,GotoIf($[${CALLERIDNUM} = ${FOO}]?9:3)         ;necessary
exten => s,3,GotoIf($[${CALLERIDNUM} = ${TESTVAR}]?103:4)   ; test variable
exten => s,4,GotoIf($[${CALLERIDNUM} = ${MYFRIENDS}]?103:5)
exten => s,5,GotoIf($[${CALLERIDNUM} = ${MYFAMILY}]?103:6)
exten => s,6,GotoIf($[${CALLERIDNUM} = ${GIRLFAM}]?103:7)
exten => s,7,GotoIf($[${CALLERIDNUM} = ${BROTHERWORK}]?103:8)
exten => s,8,GotoIf($[${CALLERIDNUM} = ${GIRLWORK}]?103:9)
exten => s,9,Dial(Zap/g2,20,tr)  ;either I don't know the caller, or its a
business call
exten => s,10,Macro(callfwd,${CELL},10,tr)  ;one fxo so forward them to cell
across the net
exten => s,11,Answer
exten => s,12,Playback(business/showmemoney) ; custom voicemail
exten => s,13,VoiceMail2(s494)
exten => s,14,Hangup
exten => s,103,Dial(Zap/g2,20,tr) ; I should use a distinctive ring
exten => s,104,Dial(IAX2/MynufoneName at NuFone/${CELL},10,tr) ; different syntax
than the macro
exten => s,105,Answer                                         ; same outcome
as the macro
exten => s,106,Playback(personal/ola)
exten => s,107,Voicemail2(s344)
exten => s,108,Hangup


Hope I helped, It took me a while.
Adrian




More information about the asterisk-users mailing list