On 7/18/06, Jerry Bonner <[EMAIL PROTECTED]> 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/[EMAIL PROTECTED]
 
I believe this should help you.
Good luck,
 
bp
_______________________________________________
--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

Reply via email to