INVITE
messages from my SIP trunk provider are being rejected with SIP/2.0 401 Unauthorized
.
I am seeing the following in the SIP debug logs:
No matching peer for '+1xxxxxxxxxx' from '34.210.91.114:5060'
In my pjsip trunk configuration, contact=sip:us-west-or.sip.flowroute.com
, which resolves to IP 34.210.91.112. My SIP trunk provider has a range of IPs for their servers (34.210.91.112/28).
When the INVITE message is received from the server with IP ending in .112, everything works fine and the call comes through. However, when the INVITE is received from any of the other IPs in the server range (that isn’t the IP of the contact=
, then the INVITE is rejected.
It was my understanding that any IP specified under match=
would be matched to the endpoint?
Why isn’t this working?
pjsip show identifies
Identify: <Identify/Endpoint...........................................................>
Match: <criteria...........................>
==========================================================================================
Identify: trunk-name/trunk-name
Match: 34.210.91.112/28
Match: 34.226.36.32/28
Match: 147.75.65.192/28
Objects found: 1
My pjsip.conf is configured as shown below:
[trunk-name](p1)
type=endpoint
dtmf_mode=rfc4733
transport=transport-udp-xxxxx
context=trk-8-in
allow=!all,ulaw,alaw,g729
language=en
aors=trunk-name
outbound_auth=trunk-name-oauth
[trunk-name-oauth]
type=auth
auth_type=userpass
username=xxxxx
password=xxxxx
[trunk-name](p1-aor)
type=aor
max_contacts=16
contact=sip:us-west-or.sip.flowroute.com
qualify_frequency=30
qualify_timeout=3
[trunk-name]
type=identify
endpoint=trunk-name
match=34.210.91.112/28
match=34.226.36.32/28
match=147.75.65.192/28
[trunk-name-reg-1]
type=registration
endpoint=trunk-name
transport=transport-udp-xxxxx
outbound_auth=trunk-name-oauth
server_uri=sip:us-west-or.sip.flowroute.com
client_uri=sip:xxxxx@us-west-or.sip.flowroute.com
retry_interval=60
max_retries=10
forbidden_retry_interval=10
expiration=3600
line=yes
auth_rejection_permanent=yes