Will i still be able to call the extensions 2001, 2002, and 2003?
If so how can make it possible for the stations to call each other and at the same time be able to make outbound calls to our sip provider?
asterisk will always match the most SPECIFIC pattern there is. so, in your case, if someone dials 2001, it will use the exact match for 2001. if they dial 3001, then it would use the pattern match.
however, why not set your dialing rules to be a bit more specific? i’m assuming you’re using your sip provider for PSTN calls, so make a 7 and 10 digit pattern match like so:
exten => _NXXNXXXXXX,1,prefix(1) <- not sure if you still need this, depends on your provider
exten => _NXXNXXXXXX,2,dial(sip/provider)
exten => _NXXNXXXXXX,3,hangup
exten => _NXXXXXX,1,prefix(1) <- not sure if you still need this, depends on your provider
exten => _NXXXXXX,2,dial(sip/provider)
exten => _NXXXXXX,3,hangup
either way works, but do you really want to send ANYTHING other than what you have specifically defined to your provider? you could get in a world of hurt if someone starts dialing internationally…best way is to only allow what you want, instead of allowing everything…
[quote=“Flash05”]Thanks for the input. I might go for that route.
I believe starting the number/extension 0, 1, 8, and 9 must be avoided. Any good reason? Or its a telco practice?[/quote]
it was a requirement of older PBX’s, to designate that you were requesting an external line. so it’s more habit than anything else.
you can set up whatever rules you like. we use 9 for an outside line, but will be changing that in the coming months as it’s really not needed anymore with asterisk’s ability to pattern match just about anything.
and what fdragowski said would work fine as well, but you have to keep in mind that you can dial international or any other number sequence by using the “period” pattern match…that opens up your system for toll-fraud. on a home system, probably not a big deal.
i tried this but didnt work.
exten => _x.,1,prefix(1)
and also found this example but didnt work:
exten => _54XX,1,Prefix,1503749
exten => _150374954XX,2,Dial,Zap/1/BYEXTENSION digium.com/en/docs/asterisk_ … refix.html