Chuck Bunn
2005-Nov-18 10:00 UTC
[Asterisk-Users] Context restrictions for long distance access, examples not clear?
Hi, I am trying to limit access to long distance in my dial plan but I am really confused by the examples I am seeing (perhaps I am misunderstanding how context work). The following example was given in a previous posting. [extensions] exten => 8478414198,1,Dial(SIP/8478414198) exten => 8478414198,2,Hangup exten => 8478414199,1,Dial(SIP/8478414199) exten => 8478414199,2,Hangup [local] exten => _XXXXXX,1,Dial(SIP/[EMAIL PROTECTED]) exten => _XXXXXX,2,Congestion [long-distance] exten => _1NXXNXXXXXX,1,Dial(SIP/[EMAIL PROTECTED]) exten => _1NXXNXXXXXX,2,Congestion [local-users] exten => 8478414198,1,Dial(SIP/8478414198) exten => 8478414198,2,Hangup include => local include => extensions [long-users] exten => 8478414199,1,Dial(SIP/8478414199) exten => 8478414199,2,Hangup include => local include => long-distance include => extensions What I do not understand is how this restricts access. Since the context 'extensions' is included in both would that not give all users access to local and long distance??? Or is there some sort of order of entry thing with context??? I supposed that zapata.conf would include a reference to extensions - that would be the only reason for having the extension context... Also since the extensions appear under local-users and long-users followed by the include 'extensions' wouldn't this generate an error since the extension already exist (ie in local users has the extension 8478414198 with a priority of 1 and the include statement means that another extension 8478414198 with a priority of 1 in the same context 'local-users')???? Thanks
Jonathan k. Creasy
2005-Nov-18 11:09 UTC
[Asterisk-Users] Context restrictions for long distance access, examples not clear?
What context are your phones in? (context= in sip or iax config) If your phones are in the local-users context, they will be able to dial numbers found in local-users, extensions and local. If your phones are in the long-users context, they will be able to dial numbers in long-users, local, long-distance and extensions. Extensions in a context are handled in the order they are listed. In this case, I would remove the entries which are also in extensions from the local-users and long-users extensions. -Jonathan> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Chuck Bunn > Sent: Friday, November 18, 2005 12:00 PM > To: Asterisk - Users > Subject: [Asterisk-Users] Context restrictions for long distance > access,examples not clear? > > Hi, > > I am trying to limit access to long distance in my dial plan but I am > really confused by the examples I am seeing (perhaps I am > misunderstanding how context work). The following example was given ina> previous posting. > > [extensions] > exten => 8478414198,1,Dial(SIP/8478414198) > exten => 8478414198,2,Hangup > exten => 8478414199,1,Dial(SIP/8478414199) > exten => 8478414199,2,Hangup > > > [local] > exten => _XXXXXX,1,Dial(SIP/[EMAIL PROTECTED]) > exten => _XXXXXX,2,Congestion > > > [long-distance] > exten => _1NXXNXXXXXX,1,Dial(SIP/[EMAIL PROTECTED]) > exten => _1NXXNXXXXXX,2,Congestion > > > [local-users] > exten => 8478414198,1,Dial(SIP/8478414198) > exten => 8478414198,2,Hangup > include => local > include => extensions > > > [long-users] > exten => 8478414199,1,Dial(SIP/8478414199) > exten => 8478414199,2,Hangup > include => local > include => long-distance > include => extensions > > > What I do not understand is how this restricts access. Since thecontext> 'extensions' is included in both would that not give all users accessto> local and long distance??? Or is there some sort of order of entrything> with context??? I supposed that zapata.conf would include a referenceto> extensions - that would be the only reason for having the extension > context... Also since the extensions appear under local-users and > long-users followed by the include 'extensions' wouldn't this generate > an error since the extension already exist (ie in local users has the > extension 8478414198 with a priority of 1 and the include statement > means that another extension 8478414198 with a priority of 1 in thesame> context 'local-users')???? > > Thanks > > _______________________________________________ > --Bandwidth and Colocation sponsored by Easynews.com -- > > Asterisk-Users mailing list > Asterisk-Users@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