[asterisk-users] Noob Question
Steve Murphy
murf at parsetree.com
Mon Mar 12 09:08:27 MST 2007
On Sun, 2007-03-11 at 22:29 -0800, Yuan LIU wrote:
> >From: "Thomas Patterson" <thomas at wabb.ath.cx>
> >Date: Mon, 12 Mar 2007 19:03:12 +1300
> >
> >I have setup my Asterisk server to have 3 outbound routes
> >
> >1 being for local calls
> >2 being for toll calls
> >3 being international call
> >
> >What I am wanting to do is automaticly setup if you dial a local number it
> >goes out on the local interface
> >
> >If you dial a toll call it will go out on the tall provider.
> >
> >Now for the 3 option I want it to pick up the slack of the other eg if I
> >have not put the dialing prefix in it will default to this trunk
>
> Just match your local numbering plan. Don't know your country's, but in
> North America (NANP), you can do
>
> [general]
> NANP = NXXNXXXXXX; "10-digit phone number starting with area code"
> NA_LOCAL = NXXXXXX; a North American local #
>
> [outgoing]
> exten => _${NA_LOCAL},1,NoOp(Got local number ${EXTEN})
> exten => _${NA_LOCAL},n,Dial(Zap/g1/${EXTEN}); G1 is for local
> exten => _${NANP),1,Goto(1${EXTEN}); for the lazy people
> exten => _1${NANP},1,NoOp(Got toll number ${EXTEN})
> exten => _1${NANP},n,Dial(Zap/g2/${EXTEN}); G2 is for toll
> exten => _X.,1,NoOp(Likely international number ${EXTEN})
> exten => _X.,1,Dial(Zap/g3/${EXTEN}); G3 is for international
>
> Of course the real thing is a bit more complicated, if you want to count for
> "local toll" and toll-free numbers, etc.
Small corrections: [general] should be [globals]; and in the last line,
exten => _X.,1,Dial(Zap/g3/${EXTEN}); G3 is for international
should be
exten => _X.,2,Dial(Zap/g3/${EXTEN}); G3 is for international
or
exten => _X.,n,Dial(Zap/g3/${EXTEN}); G3 is for international
because that last line will be silently dropped because it conflicts in
priority with the line previous to it.
murf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3239 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070312/2f94d613/smime.bin
More information about the asterisk-users
mailing list