No matching endpoint found - Request 'REGISTER' from remote extension

I am trying to register an endpoint from mobile over 4G. I am using pjsip and have enabled nat,
but I get this error while registering to the asterisk

res_pjsip/pjsip_distributor.c:659 log_failed_request: Request 'REGISTER' 
from '<sip:102@xx.xx.xx.xx>'  failed for 'xx.xx.xx.xx:5060'
(callid: 281700230-5060-1@BJC.BGI.C.CCG) - No matching endpoint found`

//xx.xx.xx.xx is my public ip address

Here is the pjsip.conf section for transport

[transport-udp-nat]
type=transport
protocol=udp
bind=0.0.0.0:5060
local_net=192.168.2.0/24
local_net=127.0.0.1/32
external_media_address=xx.xx.xx.xx
external_signaling_address=xx.xx.xx.xx

//xx.xx.xx.xx is my public ip address

here is the extension section

[102]
type = aor
max_contacts = 5
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[102]
type = auth
username = 102
password = xxxxxx

[102]
type = endpoint
transport = transport-udp-nat
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 102 <Zone_2>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 102
outbound_auth = 102
aors = 102
nat = yes

Devices register, not extension.

What do you mean by remote? Not in the same broadcast area? Outside of NAT?

Whilst I haven’t used PJSIP in anger, I do know that the transport section isn’t the part of pjsip.conf that primarily deals with endpoint matching. If you don’t fully uderstan the configuration, provide it all.

Sorry for the wrong term used

Asterisk is on a device with a private Ip address, I am port forwarding external 5080 to the asterisk IP:5060. By remote, I mean that the device that I am using is not in the private network, rather it is utilizing a mobile data network.

I used the script provided here to convert my sip.conf to pjsip.conf

which files would you require?

pjsip.conf and all files that are included, directly or indirectly, by it.

This is the pjsip.conf

;--
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements start
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[general]
vmexten = *97

[100]
trustrpid = yes

[101]
trustrpid = yes

[102]
trustrpid = yes

[103]
trustrpid = yes

[104]
trustrpid = yes

[105]
trustrpid = yes

[106]
trustrpid = yes

[107]
trustrpid = yes

[108]
trustrpid = yes

[109]
trustrpid = yes

[110]
trustrpid = yes

[111]
trustrpid = yes

[112]
trustrpid = yes

[113]
trustrpid = yes

[114]
trustrpid = yes

[115]
trustrpid = yes

[116]
trustrpid = yes

[117]
trustrpid = yes

[118]
trustrpid = yes

[119]
trustrpid = yes

[120]
trustrpid = yes


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--;


[global]
type = global
user_agent = S720(3.0.0)

[transport-udp-nat]
type=transport
protocol=udp
bind=0.0.0.0:5080
local_net=192.168.2.0/24
local_net=127.0.0.1/32
external_media_address=xx.xx.xx.xx
external_signaling_address=xx.xx.xx.xx

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060
tos = cs3



[100]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[100]
type = auth
username = 100
password = xxxxxx

[100]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 100 <100>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 100
outbound_auth = 100
aors = 100

[acl]
type = acl
permit = 0.0.0.0/0.0.0.0
deny = 192.1.2.1/255.225.0.0

[101]
type = aor
max_contacts = 5
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[101]
type = auth
username = 101
password = xxxxxx

[101]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 101 <Zone_1>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 101
outbound_auth = 101
aors = 101

[102]
type = aor
max_contacts = 5
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[102]
type = auth
username = 102
password = xxxxxx

[102]
type = endpoint
transport = transport-udp-nat
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 102 <Zone_2>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 102
outbound_auth = 102
aors = 102
nat = yes


[103]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[103]
type = auth
username = 103
password = xxxxxx

[103]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 103 <Zone_3>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 103
outbound_auth = 103
aors = 103

[104]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[104]
type = auth
username = 104
password = xxxxxx

[104]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 104 <Zone_4>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 104
outbound_auth = 104
aors = 104

[105]
type = aor
max_contacts = 5
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[105]
type = auth
username = 105
password = xxxxxx

[105]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 105 <Zone_5>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 105
outbound_auth = 105
aors = 105


[106]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[106]
type = auth
username = 106
password = xxxxxx

[106]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 106 <Zone_6>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 106
outbound_auth = 106
aors = 106

[107]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[107]
type = auth
username = 107
password = xxxxxx

[107]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 107 <Zone_7>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 107
outbound_auth = 107
aors = 107

[108]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[108]
type = auth
username = 108
password = xxxxxx

[108]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 108 <Zone_8>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 108
outbound_auth = 108
aors = 108

[109]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[109]
type = auth
username = 109
password = xxxxxx

[109]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 109 <Zone_9>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 109
outbound_auth = 109
aors = 109

[110]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[110]
type = auth
username = 110
password = xxxxxx

[110]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 110 <Zone_10>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 110
outbound_auth = 110
aors = 110

[111]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[111]
type = auth
username = 111
password = xxxxxx

[111]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 111 <Zone_11>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 111
outbound_auth = 111
aors = 111

[112]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[112]
type = auth
username = 112
password = xxxxxx

[112]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 112 <Zone_12>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 112
outbound_auth = 112
aors = 112

[113]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[113]
type = auth
username = 113
password = xxxxxx

[113]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 113 <Zone_13>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 113
outbound_auth = 113
aors = 113

[114]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[114]
type = auth
username = 114
password = xxxxxx

[114]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 114 <Zone_14>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 114
outbound_auth = 114
aors = 114

[115]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[115]
type = auth
username = 115
password = xxxxxx

[115]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 115 <Zone_15>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 115
outbound_auth = 115
aors = 115

[116]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[116]
type = auth
username = 116
password = xxxxxx

[116]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 116 <Zone_16>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 116
outbound_auth = 116
aors = 116

[117]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[117]
type = auth
username = 117
password = xxxxxx

[117]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 117 <117>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 117
outbound_auth = 117
aors = 117

[118]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[118]
type = auth
username = 118
password = xxxxxx

[118]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 118 <118>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 118
outbound_auth = 118
aors = 118

[119]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[119]
type = auth
username = 119
password = xxxxxx

[119]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 119 <119>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 119
outbound_auth = 119
aors = 119

[120]
type = aor
max_contacts = 1
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[120]
type = auth
username = 120
password = xxxxxx

[120]
type = endpoint
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid = 120 <120>
send_pai = yes
use_avpf = no
named_call_group = 
named_pickup_group = 
tos_audio = ef
tos_video = af41
auth = 120
outbound_auth = 120
aors = 120



Have you used the CLI to examine that the expected endpoint exists? (pjsip show endpoints / pjsip show endpoint). Have you looked at the console log at startup to see if it complains about the endpoint?

The Endpoint can register without any issues if I the device is in the same LAN

Then I’d suggest comparing the difference between the two situations, as there should be no reason that an endpoint is found in one instance and not the other.