No domain needed in my case since our NEC is connected via ISDN.
I don’t know if it will work with sip proxy but here is a snippet of my dialplan and pjsip.conf
We are kinda of doing the same thing, users from the NEC are calling outside with Asterisk 13.4 as a relay.
Dialplan will have a context for calls coming from the NEC and making outgoing calls…
NEC -------> Mediatrix------->ASterisk------->Mediatrix------>PSTN
[FROM_NEC_PBX]
exten => _NXXNXXXXXX,1,NoOp()
same => n,Dial(PJSIP/${EXTEN}@PRI_2_OUT,40,I)
same => n,Hangup()
This is for the trunk in pjsip.conf…
[transport-udp]
type = transport
protocol = udp
bind = xxx.xxx.xxx.xx
;This is the ISDN trunk to PSTN
;slot ISDN 2 mediatrix 3532 PRI 2 pour sortir
[PRI_2_OUT]
type = aor
contact = sip:xxx.xxx.xxx.xx:5060
;qualify_frequency = 60
[PRI_2_OUT]
type = identify
endpoint = PRI_2_OUT
[PRI_2_OUT]
type = auth
username = PBXTrunk
password = mypassword
[PRI_2_OUT]
transport=transport-udp
type = endpoint
context = TO_PRI_2
dtmf_mode = info
disallow = all
allow = ulaw
ice_support = no
direct_media = no
tos_audio = 0xB8
cos_audio = 6
auth = PRI_2_OUT
outbound_auth = PRI_2_OUT
aors = PRI_2_OUT
100rel = yes
fax_detect = yes
t38_udptl = yes
t38_udptl_maxdatagram = 400
disable_direct_media_on_nat = yes
callerid_privacy = allowed_not_screened
language = fr
tone_zone = us
;This is the ISDN trunk connected to Asterisk
;slot 3 ISDN mediatrix 3632 To NEC 2000
[2KTrunk]
type = aor
contact = sip:xxx.xxx.xxx.xx:5061
;qualify_frequency = 60
[2KTrunk]
type = identify
endpoint = 2KTrunk
match = xxx.xxx.xxx.xx
[2KTrunk]
type = auth
username = 2KTrunk
password = mypassword
[2KTrunk]
transport=transport-udp
type = endpoint
context = FROM_NEC_PBX
dtmf_mode = info
disallow = all
allow = ulaw
ice_support = no
direct_media = no
use_avpf = no
tos_audio = 0xB8
cos_audio = 6
auth = 2KTrunk
outbound_auth = 2KTrunk
aors = 2KTrunk
language = fr
tone_zone = us