[asterisk-users] Redirect call based on CLI???
D Tucny
d at tucny.com
Sat Feb 27 14:00:08 CST 2010
Or, alternatively using the 's' priority...
exten => 845,1,Verbose(3, Incoming call from ${CALLERID(all)}) ; this will
be priority 1
exten => 845/12345678,n,Goto(blacklist) ; the n will make this priority 2
exten => 845/23456789,s,Goto(blacklist) ; the s will make this also priority
2
exten => 845/34567890,s,Goto(blacklist) ; again, priority 2
exten => 845/09876543,s,Goto(whitelist) ; and again
exten => 845/98765432,s,Goto(whitelist) ; and again
exten => 845/87654321,s,Goto(whitelist) ; and again
exten => 845,s,Verbose(3, CLI (${CALLERID(num)}) is neither blacklisted or
whitelisted) ; last s, so last priority 2, this time with no pattern
exten => 845,n,Dial(SIP/somewhere,180) ; this will be priority 3
exten => 845,n,Hangup() ; priority 4
exten => 845,n(blacklist),Verbose(3, CLI (${CALLERID(num)}) is blacklisted)
; priority 5
exten => 845,n,Hangup(21) ; priority 6, cause code 21 = rejected
exten => 845,n(whitelist),Verbose(3, CLI (${CALLERID(num)}) is whitelisted)
; priority 7
exten => 845,n,Dial(SIP/somewhereelse,180) ; priority 8
exten => 845,n,Hangup() ; priority 9
You can see the priorities from the asterisk cli by doing a 'dialplan show
<context>'
d
On 26 February 2010 01:33, Mark Hulber <asterisk.admin at hulber.com> wrote:
> Since you are using 'n' notation, you might not have your statements
> aligned. You can label your statements as below:
>
> exten => s,n,Answer
> exten => s,n,GotoIf($["${CALLERID(name)}" != "UNAVAILABLE"]?ans)
> exten => s,n,Set(CALLERID(name)=${CALLERID(number)})
> exten => s,n(ans),NoOp
>
>
> ; Banned
> exten => s/708857500X,ans+1,Goto(banned,1) ;
> exten => s/9044898017,ans+1,Goto(banned,1) ;
> exten => s/8883222785,ans+1,Goto(banned,1) ;
>
> ; Specifically routed
>
> exten => s/9165553456,ans+1,Goto(markivr,1) ; Allowed
> exten => s/19165553456,ans+1,Goto(markivr,1) ; Allowed
>
> ; Default
> exten => s,ans+1,Goto(mainmenu,s,1)
>
> On 2/25/2010 10:11 AM, Brian wrote:
> > On Thu, 2010-02-25 at 03:00 -0800, Kyle Kienapfel wrote:
> >
> >>
> http://www.voip-info.org/tiki-index.php?page=Asterisk%20config%20extensions.conf
> >> Has example
> >> exten => s,1,Answer
> >> exten => s/9184238080,2,Set(CALLERID(name)=EVIL BASTARD)
> >> exten => s,2,Set(CALLERID(name)=Good Person)
> >> exten => s,3,Dial(SIP/goodperson)
> >>
> >> for white list
> >>
> >> exten => s/123123123,1,Dial(SIP/phoneA)
> >> exten => s/456456456,1,Dial(SIP/phoneA)
> >> exten => s,1,Dial(SIP/phoneB)
> >>
> >>
> >>
> > Thanks Kyle.
> >
> > I tried the example given but I could not get this to work - basically
> > if I dial it from any phone that does not match 0800800800 (for
> > illustration) it hangs up the channel with an error.
> >
> > exten => 845/0800800800,n,Set(CALLERID(name)=EVIL BASTARD)
> > -->-- Auto fallthrough, channel 'SIP/1000-00000017' status is 'UNKNOWN'
> >
> > I'm struggling to work out the logic here of a non-match, but this was
> > not caught by i or s in error, so I'm probably missing some brain
> > connection here.
> >
> > However, I've managed to do what I want using gotoif statements matching
> > caller id - but I'd be interested to work out how the above is meant to
> > branch on a non-match.
> >
> >
> >
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100228/adeaf1d2/attachment.htm
More information about the asterisk-users
mailing list