Unable to register 3cx trunk side with new Asterisk side

I am attempting to create a registration/account-based trunk between a V20 3CX server and an Asterisk 20.6.0 server for sending dial codes to Bogen intercoms. I have been at it for a few days and have been unable to get registration between servers to work, although the user/pass has been verified to be correct. I am pretty close, but I keep getting an AOR error on the Asterisk side, which does not make sense since it is part of the configuration. 3CX randomly assigns internal extension numbers and, in this case, has assigned 10001, which I cannot change. Included are the Asterisk pjsip.conf config and sip logs, followed by the corresponding 3CX log for the same event. Thoughts?

Asterisk pjsip config:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[acdc-mn-3cx]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
aors=acdc-mn-3cx
outbound_auth=acdc-mn-3cx-auth
direct_media=no
transport=transport-udp

[acdc-mn-3cx]
type=aor
max_contacts=1
contact=sip:3CXPublicIP:5060 ; Specify the 3CX IP and port

[acdc-mn-3cx-auth]
type=auth
username=XXXXXXXXXX
password=8characterpassword

[acdc-mn-3cx]
type=registration
outbound_auth=acdc-mn-3cx-auth
server_uri=sip:3CXPublicIP
client_uri=sip:XXXXXXXXXX@3CXPublicIP
retry_interval=60

[acdc-mn-3cx-identify]
type=identify
endpoint=acdc-mn-3cx
match=3CXPublicIP ; Ensure this matches the IP of the 3CX server

Asterisk sip logs:

Asterisk logs:

<— Received SIP request (531 bytes) from UDP:3CXPublicIP:5060 —>
REGISTER sip:AsteriskPublicIP:5060 SIP/2.0
Via: SIP/2.0/UDP 3CXPrivateIP:5060;branch=z9hG4bK-524287-1—3141823a9e039042;rport
Max-Forwards: 70
Contact: sip:XXXXXXXXXX@3CXPublicIP:5060;rinstance=d031dcd948805cf0
To: sip:XXXXXXXXXX@AsteriskPublicIP:5060
From: sip:XXXXXXXXXX@AsteriskPublicIP:5060;tag=3ebe5b4f
Call-ID: EER8e17aas6ud2KUnp8cGg…
CSeq: 1 REGISTER
Expires: 180
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE
Supported: replaces, timer
Content-Length: 0

<— Transmitting SIP response (397 bytes) to UDP:3CXPublicIP:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 3CXPrivateIP:5060;rport=5060;received=3CXPublicIP;branch=z9hG4bK-524287-1—3141823a9e039042
Call-ID: EER8e17aas6ud2KUnp8cGg…
From: sip:XXXXXXXXXX@AsteriskPublicIP;tag=3ebe5b4f
To: sip:XXXXXXXXXX@AsteriskPublicIP;tag=z9hG4bK-524287-1—3141823a9e039042
CSeq: 1 REGISTER
Server: Asterisk PBX 20.6.0~dfsg+~cs6.13.40431414-2build5
Content-Length: 0

[Nov 12 11:50:18] WARNING[11827]: res_pjsip_registrar.c:1166 find_registrar_aor: AOR ‘’ not found for endpoint ‘acdc-mn-3cx’ (3CXPublicIP:5060)
<— Received SIP request (531 bytes) from UDP:3CXPublicIP:5060 —>
REGISTER sip:AsteriskPublicIP:5060 SIP/2.0
Via: SIP/2.0/UDP 3CXPrivateIP:5060;branch=z9hG4bK-524287-1—8ef5ca74e80c1a62;rport
Max-Forwards: 70
Contact: sip:XXXXXXXXXX@3CXPublicIP:5060;rinstance=929f588669ff87ea
To: sip:XXXXXXXXXX@AsteriskPublicIP:5060
From: sip:XXXXXXXXXX@AsteriskPublicIP:5060;tag=e87c9235
Call-ID: EZGODk-dz35fo4E1x7UIAA…
CSeq: 1 REGISTER
Expires: 180
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE
Supported: replaces, timer
Content-Length: 0

<— Transmitting SIP response (397 bytes) to UDP:3CXPublicIP:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 3CXPrivateIP:5060;rport=5060;received=3CXPublicIP;branch=z9hG4bK-524287-1—8ef5ca74e80c1a62
Call-ID: EZGODk-dz35fo4E1x7UIAA…
From: sip:XXXXXXXXXX@AsteriskPublicIP;tag=e87c9235
To: sip:XXXXXXXXXX@AsteriskPublicIP;tag=z9hG4bK-524287-1—8ef5ca74e80c1a62
CSeq: 1 REGISTER
Server: Asterisk PBX 20.6.0~dfsg+~cs6.13.40431414-2build5
Content-Length: 0

[Nov 12 11:53:49] WARNING[11837]: res_pjsip_registrar.c:1166 find_registrar_aor: AOR ‘’ not found for endpoint ‘acdc-mn-3cx’ (3CXPublicIP:5060)
<— Received SIP request (531 bytes) from UDP:3CXPublicIP:5060 —>
REGISTER sip:AsteriskPublicIP:5060 SIP/2.0
Via: SIP/2.0/UDP 3CXPrivateIP:5060;branch=z9hG4bK-524287-1—c73c4019d17b396b;rport
Max-Forwards: 70
Contact: sip:XXXXXXXXXX@3CXPublicIP:5060;rinstance=f3436ae32d3fac59
To: sip:XXXXXXXXXX@AsteriskPublicIP:5060
From: sip:XXXXXXXXXX@AsteriskPublicIP:5060;tag=d459c843
Call-ID: RO0uOVQf7NNEH3PTMB7TCw…
CSeq: 1 REGISTER
Expires: 180
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE
Supported: replaces, timer
Content-Length: 0

<— Transmitting SIP response (397 bytes) to UDP:3CXPublicIP:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 3CXPrivateIP:5060;rport=5060;received=3CXPublicIP;branch=z9hG4bK-524287-1—c73c4019d17b396b
Call-ID: RO0uOVQf7NNEH3PTMB7TCw…
From: sip:XXXXXXXXXX@AsteriskPublicIP;tag=d459c843
To: sip:XXXXXXXXXX@AsteriskPublicIP;tag=z9hG4bK-524287-1—c73c4019d17b396b
CSeq: 1 REGISTER
Server: Asterisk PBX 20.6.0~dfsg+~cs6.13.40431414-2build5
Content-Length: 0

[Nov 12 11:55:18] WARNING[11847]: res_pjsip_registrar.c:1166 find_registrar_aor: AOR ‘’ not found for endpoint ‘acdc-mn-3cx’ (3CXPublicIP:5060)
SC3CX-Asterisk*CLI>

3CX logs:

Call or Registration to AsteriskX has failed. sip:10001@AsteriskPublicIP:5060 replied: 401 Unauthorized; from IP:AsteriskPublicIP:5060

3cx matching log:

Call or Registration to AsteriskX has failed. sip:10001@AsteriskPublicIP:5060 replied: 401 Unauthorized; from IP:AsteriskPublicIP:5060

The name of the AOR needs to match what the remote side is registering to in the user portion of the To header. If it doesn’t match/the AOR doesn’t exist, then Asterisk will respond with a 404.

Of course, I’m probably wrong, since it is not working, but the AOR seems to be there. What I submitted was about the 15th pjsip config, but it is still the same issue.

Actually, let me ask this…

Are you expecting 3CX to REGISTER to Asterisk? The configuration right now has a static contact.

1 Like

3CX is where everything else happens. I just need the asterisk box to send calls to an extension with prepended dial codes. I am guessing that means the asterisk should register with the 3cx side.

There is a good chance that neither side needs to use registration. It makes no sense for both sides to use it, as, at least one, needs to know the other’s address already, so doesn’t need to be told using REGISTER. REGISTER is not a log on, it is telling a side with a known physical address, the physical address of another one whose physical address is not known in advance.

Thank you… That pointed me in the right direction. I moved from Register/Account to IP-based. I can call a 3CX extension now with the following: channel originate Local/9999@from-internal application Dial