Can someone please explain what I am doing wrong here? I only want the extensions listed in long-users to be able to access the longdistance context. If I do this, I get a congestion tone no matter what I dial. If I add a [default] context and include => longdistance, then the local callers can call the long distance number fine, which is not what I want, but I still want long-users to be able to call locally and I need long and local users to be able to call each other, and inbound calls need to be able to go to local and long users as well. I tried reading the handbook, but even though they say that you can restrict based on context, it never shows an example of how. [local-users] exten => 8478414198,1,Dial(SIP/8478414198) exten => 8478414198,2,Hangup [long-users] exten => 8478414199,1,Dial(SIP/8478414199) exten => 8478414199,2,Hangup [local] exten => _XXXXXX,1,Dial(SIP/${EXTEN}@VGW) exten => _XXXXXX,2,Congestion include => local-users [long-distance] exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@VGW) exten => _1NXXNXXXXXX,2,Congestion include => local include => long-users
> -----Original Message----- > From: Steve Dolloff [mailto:sdolloff@noc.dls.net] > Sent: Friday, October 24, 2003 12:13 PM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] Context restrictions > > > Can someone please explain what I am doing wrong here? I > only want the > extensions listed in long-users to be able to access the longdistance > context. > > If I do this, I get a congestion tone no matter what I dial. > If I add a > [default] context and include => longdistance, then the local callers > can call the long distance number fine, which is not what I > want, but I > still want long-users to be able to call locally and I need long and > local users to be able to call each other, and inbound calls > need to be > able to go to local and long users as well. > > I tried reading the handbook, but even though they say that you can > restrict based on context, it never shows an example of how. > > [local-users] > exten => 8478414198,1,Dial(SIP/8478414198) > exten => 8478414198,2,Hangup > > [long-users] > exten => 8478414199,1,Dial(SIP/8478414199) > exten => 8478414199,2,Hangup > > [local] > exten => _XXXXXX,1,Dial(SIP/${EXTEN}@VGW) > exten => _XXXXXX,2,Congestion > > include => local-users > > [long-distance] > > exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@VGW) > exten => _1NXXNXXXXXX,2,Congestion > > include => local > include => long-users >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. Hope this helps... Randy Johnson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20031024/e48e07d9/attachment.htm
That's not how it works. You specify the context of an extension in zapata.conf, sip.conf, or whatever other channel.confs you use. The context you specify there is for calls coming into the Asterisk server from that channel or device. See my .sig for a URL for some simplified example configs that may be easier to understand the the default ones the come with Asterisk. On Fri, 2003-10-24 at 11:12, Steve Dolloff wrote:> Can someone please explain what I am doing wrong here? I only want the > extensions listed in long-users to be able to access the longdistance > context.-- Sample configs, scripts, more : http://www.fnords.org/~eric/asterisk/ BTEL Consulting 504-899-1387 or 850-484-4545 or 877-677-9643
> Can someone please explain what I am doing wrong here? I only want the > extensions listed in long-users to be able to access the longdistance > context. >[local-users]> exten => 8478414198,1,Dial(SIP/8478414198) > exten => 8478414198,2,Hangup > > [long-users] > exten => 8478414199,1,Dial(SIP/8478414199) > exten => 8478414199,2,Hangup > > [local] > exten => _XXXXXX,1,Dial(SIP/${EXTEN}@VGW) > exten => _XXXXXX,2,Congestion > > include => local-users > > [long-distance] > > exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@VGW) > exten => _1NXXNXXXXXX,2,Congestion > > include => local > include => long-users >Just went thru this myself...... try it this way..... [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/${EXTEN}@VGW) exten => _XXXXXX,2,Congestion [long-distance] exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@VGW) 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 I've dug around and there is really some very creative extension.conf files out there, wish there was some single place we could collect them so we could look at more examples.
Hiya!> Can someone please explain what I am doing wrong here? I only want the > extensions listed in long-users to be able to access the longdistance > context.Connect to this (I have also been hit several times by nasty context business): Is there anyway to get debug info about a current user's (channel's) context, maybe like "show channel context" or "sip show context"? Any other methods for context (access right) debugging? For example It took me a while to understand what IAX forwarding does to contexts, first I thought that a SIP user transported through IAX would also need a "login" (registration) on the receiving * ... One more question: What are agents, and what are they good for? Help and Wiki don't reveal much... I am starting to think we'd really need to get an overview of the * features and have that documented (without all the details, just to get the big picture which makes a start a lot (!) easier). Cheers, Philipp
Maybe Matching Threads
- [PATCH v2 1/9] drm: Do delayed switcheroo in drm_lastclose()
- [PATCH v2 1/9] drm: Do delayed switcheroo in drm_lastclose()
- Newbie extensions.conf I need to include [SMS] context.
- [PATCH v2 1/9] drm: Do delayed switcheroo in drm_lastclose()
- AAH out bound routing problem