<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>RE: [Asterisk-Users] Context restrictions</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Steve Dolloff [<A HREF="mailto:sdolloff@noc.dls.net">mailto:sdolloff@noc.dls.net</A>] </FONT>
<BR><FONT SIZE=2>> Sent: Friday, October 24, 2003 12:13 PM</FONT>
<BR><FONT SIZE=2>> To: asterisk-users@lists.digium.com</FONT>
<BR><FONT SIZE=2>> Subject: [Asterisk-Users] Context restrictions</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Can someone please explain what I am doing wrong here? I </FONT>
<BR><FONT SIZE=2>> only want the</FONT>
<BR><FONT SIZE=2>> extensions listed in long-users to be able to access the longdistance</FONT>
<BR><FONT SIZE=2>> context.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> If I do this, I get a congestion tone no matter what I dial. </FONT>
<BR><FONT SIZE=2>> If I add a</FONT>
<BR><FONT SIZE=2>> [default] context and include => longdistance, then the local callers</FONT>
<BR><FONT SIZE=2>> can call the long distance number fine, which is not what I </FONT>
<BR><FONT SIZE=2>> want, but I</FONT>
<BR><FONT SIZE=2>> still want long-users to be able to call locally and I need long and</FONT>
<BR><FONT SIZE=2>> local users to be able to call each other, and inbound calls </FONT>
<BR><FONT SIZE=2>> need to be</FONT>
<BR><FONT SIZE=2>> able to go to local and long users as well.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I tried reading the handbook, but even though they say that you can</FONT>
<BR><FONT SIZE=2>> restrict based on context, it never shows an example of how.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> [local-users]</FONT>
<BR><FONT SIZE=2>> exten => 8478414198,1,Dial(SIP/8478414198)</FONT>
<BR><FONT SIZE=2>> exten => 8478414198,2,Hangup</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> [long-users]</FONT>
<BR><FONT SIZE=2>> exten => 8478414199,1,Dial(SIP/8478414199)</FONT>
<BR><FONT SIZE=2>> exten => 8478414199,2,Hangup</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> [local]</FONT>
<BR><FONT SIZE=2>> exten => _XXXXXX,1,Dial(SIP/${EXTEN}@VGW)</FONT>
<BR><FONT SIZE=2>> exten => _XXXXXX,2,Congestion</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> include => local-users</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> [long-distance]</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@VGW)</FONT>
<BR><FONT SIZE=2>> exten => _1NXXNXXXXXX,2,Congestion</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> include => local</FONT>
<BR><FONT SIZE=2>> include => long-users</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
<P><FONT SIZE=2>I believe you need to go the other way--include the pattern match for the local trunk into [local-users] and the match for long distance into [long-users]. I'm assuming the extensions "start out" in the [local-users] or [long-distance] context based on zapata.conf, sip.conf, etc.</FONT></P>
<P><FONT SIZE=2>Hope this helps...</FONT>
</P>
<P><FONT SIZE=2>Randy Johnson</FONT>
</P>
</BODY>
</HTML>