Jerry Bonner
2006-Jul-18 10:08 UTC
[asterisk-users] extensions.conf 4 digit dialing question
Hi all, Does anyone have any tips on how I would accomplish a plan where if a user dials 4 digits, then prefix 6 digits, then if there is a local extension configured for that number dial it, otherwise send it out another sip gateway ( my pstn gateway)? Perhaps more specifically, are there any construtcs that would "dial extension if exists"? Because I want to make sure I dial a sip extension before routing it out to the pstn. ~jerry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060718/903fdadc/attachment.htm
Bruce Reeves
2006-Jul-18 10:24 UTC
[asterisk-users] extensions.conf 4 digit dialing question
I think asterisk will take care of this for you. Asterisk will take the most complete match in a pattern match. For example if you have a local extension 1234567890 and a pattern match _XXXXXXXXXX then Asterisk will match the 1234567890 to the exact match if it exist, if not then it will got the closest pattern it can find. Does that make sense or help? On 7/18/06, Jerry Bonner <Jerry.Bonner@cptelecom.net> wrote:> > Hi all, > > > > Does anyone have any tips on how I would accomplish a plan where if a user > dials 4 digits, then prefix 6 digits, then if there is a local extension > configured for that number dial it, otherwise send it out another sip > gateway ( my pstn gateway)? > > > > Perhaps more specifically, are there any construtcs that would "dial > extension if exists"? Because I want to make sure I dial a sip extension > before routing it out to the pstn. > > > > ~jerry > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > >-- Bruce Nortex Networks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060718/d414f913/attachment.htm
William Piper
2006-Jul-18 20:39 UTC
[asterisk-users] extensions.conf 4 digit dialing question
On 7/18/06, Jerry Bonner <Jerry.Bonner@cptelecom.net> wrote:> > Hi all, > > Does anyone have any tips on how I would accomplish a plan where if a user > dials 4 digits, then prefix 6 digits, then if there is a local extension > configured for that number dial it, otherwise send it out another sip > gateway ( my pstn gateway)? > > Perhaps more specifically, are there any construtcs that would "dial > extension if exists"? Because I want to make sure I dial a sip extension > before routing it out to the pstn. > > ~jerry >I believe that something like this will do what you are looking for: [4digitContext] exten => XXXX,1,goto(checkdids,123456${EXTEN},1) ;Change 1-6 with whatever the prefix [checkdids] ;this will try to find a match in 'mydids' before sending out to 'dialout' include => mydids include => dialout [mydids] ;this is the context that houses your DID's. exten => _8135551212,1,Dial,SIP/whatever exten => _9195551212,1,Dial,SIP/whatever2 [dialout] ;This will prefix a '1' to the number and make the call. exten => _XXXXXXXXXX.,1,Dial,SIP/1${EXTEN}@carrier I believe this should help you. Good luck, bp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060718/dc6b5a0c/attachment.htm