I’m working on an asterisk 1.4.16.2 and freepbx machine. The goal is to have multiple phone numbers on a single pbx, instead of a pbx for each number. The problem is with outgoing calls. I have set up custom contexts for each extension, but it always seems to use the first trunk instead of the one which should be associated with that extension. Below is one of the extensions, along with the context and outbound trunk list.
[220]
type=friend
secret=****
record_out=Adhoc
record_in=Adhoc
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=220@default
host=dynamic
dtmfmode=rfc2833
disallow=
dial=SIP/220
context=custom_mms
canreinvite=no
callgroup=
callerid=device <220>
allow=
accountcode=
call-limit=50
[custom_dce] ; 201-209
include => parkedcalls
include => from-internal
include => ext-fax
include => from-internal-additional
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
exten => _NXX,DIAL(SIP/DCE_out/${EXTEN}|120|W)
exten => _NXXXXXX,DIAL(SIP/DCE_out/${EXTEN}|120|W)
exten => _1NXXNXXXXXX,DIAL(SIP/DCE_out/${EXTEN}|120|W)
[custom_foster] ; 210-219
include => parkedcalls
include => from-internal
include => ext-fax
include => from-internal-additional
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
exten => _NXX,DIAL(SIP/Foster_out/${EXTEN}|120|W)
exten => _NXXXXXX,DIAL(SIP/Foster_out/${EXTEN}|120|W)
exten => _1NXXNXXXXXX,DIAL(SIP/Foster_out/${EXTEN}|120|W)
[custom_mms] ; 220-229
include => parkedcalls
include => from-internal
include => ext-fax
include => from-internal-additional
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
exten => _NXX,DIAL(SIP/MMS_out/${EXTEN}|120|W)
exten => _NXXXXXX,DIAL(SIP/MMS_out/${EXTEN}|120|W)
exten => _1NXXNXXXXXX,DIAL(SIP/MMS_out/${EXTEN}|120|W)
[DCE_out]
username=****
type=peer
insecure=very
host=xxxx
fromuser=****
fromdomain=xxxx
canreinvite=no
call-limit=50
[Foster_out]
username=****
type=peer
insecure=very
host=xxxx
fromuser=****
fromdomain=xxxx
canreinvite=no
call-limit=50
[MMS_out]
username=****
type=peer
insecure=very
host=xxxx
fromuser=****
fromdomain=xxxx
canreinvite=no
call-limit=50
Am I missing something in there? Or how can I figure out why it always seems to use DCE_out regardless of which extension is doing the calling.