Question : Asterisk 1.4 assigning outbound routes based on extension

Is there a way possible with Asterisk as well as Trixbox CE to configure an extension to be mapped/use a specific outbound route?

I.e.
extension 200 when dialing 17175551234 will use trunk A
extension 300 when dialing 17175551234 will use trunk B

I know i can set outbound dialing parameters, i.e. dial a 9 prefer for trunk A and an 8 for trunk be, but for my situation, it's a lot easier to be able to assign by the extension.
 

Answer : Asterisk 1.4 assigning outbound routes based on extension

Yes. You can do this as long as you can put the extensions in different groups.

I only know how to do this the asterisk way. If you need it done the Trixbox way, you'll need to wait for a Trixbox expert.

Let's say you have 6 extensions: 101, 102, 103, 104, 105, and 106. Let's also say that you want 101-103 to dial out using trunk A, and 104-106 to dial out using trunk B. The answer is to put them each in their own contexts:

Thus, your extensions.conf will look something like this:

[use-trunk-a]
exten => _NXXNXXXXXX,1,Dial(${TRUNKA}/${EXTEN})

[use-trunk-b]
exten => _NXXNXXXXXX,1,Dial(${TRUNKB}/${EXTEN})

Your sip.conf will look something like this:

[101]
type=friend
context=use-trunk-a
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no

[102]
type=friend
context=use-trunk-a
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no

[103]
type=friend
context=use-trunk-a
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no

[104]
type=friend
context=use-trunk-b
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no

[105]
type=friend
context=use-trunk-b
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no

[106]
type=friend
context=use-trunk-b
secret=blahpoly
host=dynamic
dtmfmode=rfc2833
username=polly
disallow=all
allow=ulaw
progressinband=no
Random Solutions  
 
programming4us programming4us