Hello all, I inherited an Asterisk 1.2 machine and I have a question about the order of operations. I want to give people the ability to dial specifics and block others. For example, lets say NYC [allowed] exten => _1212555., 1,Authenticate(pins||3,j) exten => _1212555., 2,Dial(SIP/${EXTEN)@mycarrier) exten => 102,Hangup exten => _1212.,s,Goto(denied,s,1) [denied] exten => s,1,Playback(num-outside-area) exten => s,2,Hangup What I would like to do it allow a specific and deny the rest. Mind you the allowed will be everything EXCEPT what is allowed. My question is, will the above work? Please don't comment on upgrading, this is an inherited system which I cannot update. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120924/ab82f419/attachment.htm>
On Monday 24 September 2012, Asterisk Newb wrote:> Hello all, > > I inherited an Asterisk 1.2 machine and I have a question about the order > of operations. > > I want to give people the ability to dial specifics and block others. For > example, lets say NYC > > [allowed] > exten => _1212555., 1,Authenticate(pins||3,j) > exten => _1212555., 2,Dial(SIP/${EXTEN)@mycarrier) > exten => 102,Hangup > > exten => _1212.,s,Goto(denied,s,1) > > [denied] > exten => s,1,Playback(num-outside-area) > exten => s,2,Hangup > > What I would like to do it allow a specific and deny the rest. Mind you the > allowed will be everything EXCEPT what is allowed. My question is, will the > above work? Please don't comment on upgrading, this is an inherited system > which I cannot update.Asterisk always tests against the most specific (= hardest-to-match) wildcarded extensions first, regardless of the actual order in the dialplan. Since _1212555. is harder to match than _1212., the former will be tested first. -- AJS Answers come *after* questions.
On Mon, Sep 24, 2012 at 12:43 PM, A J Stiles <asterisk_list at earthshod.co.uk>wrote:> > > Asterisk always tests against the most specific (= hardest-to-match) > wildcarded extensions first, regardless of the actual order in the > dialplan. > Since _1212555. is harder to match than _1212., the former will be tested > first. > > -- > AJS > >So then the proper way would be [allowed] exten => _1212321.,s,Goto(denied,s,1) exten => _1212333.,s,Goto(denied,s,1) exten => _1212456.,s,Goto(denied,s,1) exten => _1212555., 1,Authenticate(pins||3,j) exten => _1212555., 2,Dial(SIP/${EXTEN)@mycarrier) exten => 102,Hangup [denied] exten => s,1,Playback(num-outside-area) exten => s,2,Hangup ? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120924/03a5a8de/attachment.htm>