Newly created PJSIP extension with state INVALID

I’m building a minimal asterisk PBX using SIP phones(Yealink T19P E2).

In my configuration, the extension resisters normally, but the state is “INVALID”. Why is that?

pabx*CLI> pjsip show endpoints

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
==========================================================================================

 Endpoint:  200                                                  Invalid       0 of 1
     InAuth:  200-iauth/200
        Aor:  200                                               10
      Contact:  200/sip:200@172.16.0.64:5060               3af0ce3a43 NonQual         nan
  Transport:  transport-udp             udp      0      0  172.16.0.144:5060


Objects found: 1

My pjsip_wizard.conf:

[endpoint-template](!)
type = wizard
transport = transport-udp
accepts_auth = yes
accepts_registrations = yes
has_hint = no
;hint_context = Hints
endpoint/context = Internal
endpoint/disallow = all
endpoint/allow = g722,g729,alaw,ulaw,opus
auth/auth_type = userpass
aor/max_contacts = 10
 
[200](endpoint-template)
;hint_exten = 200
endpoint/auth = 200
endpoint/aors = 200
endpoint/device_state_busy_at = 1
endpoint/allow_subscribe = yes
inbound_auth/username = 200
inbound_auth/password = SOMEPASSWORD
pabx*CLI> core show settings

PBX Core settings
-----------------
  Version:                     20.4.0
  Build Options:               BUILD_NATIVE, OPTIONAL_API
  Maximum calls:               Not set
  Maximum open file handles:   1024
  Root console verbosity:      6
  Current console verbosity:   3
  Debug level:                 0
  Trace level:                 0
  Dump core on crash:          No
  Core dump file:              core
  Maximum load average:        0.000000
  Minimum free memory:         0 MB
  Startup time:                17:56:27
  Last reload time:            17:56:27
  System:                      Linux/6.1.0-11-amd64 built by root on x86_64 2023-09-06 22:25:00 UTC
  System name:
  Entity ID:                   52:54:00:18:90:8c
  PBX UUID:                    xxxxxx-xxx-xxxxxxx-xxxxx-xxxxxx
  Default language:            en
  Language prefix:             Enabled
  User name and group:         asterisk/asterisk
  Running directory:           /
  Executable includes:         Disabled
  Transcode via SLIN:          Enabled
  Transmit silence during rec: Disabled
  Generic PLC:                 Disabled
  Generic PLC on equal codecs: Disabled
  Hide Msg Chan AMI events:    Disabled
  Min DTMF duration::          80
  Cache media frames:          Enabled
  RTP use dynamic payloads:    1
  RTP dynamic payload types:   35-63,96-127

* Subsystems
  -------------
  Manager (AMI):               Disabled
  Web Manager (AMI/HTTP):      Disabled
  Call data records:           Enabled
  Realtime Architecture (ARA): Disabled

* Directories
  -------------
  Configuration file:          /etc/asterisk/asterisk.conf
  Configuration directory:     /etc/asterisk
  Module directory:            /usr/lib/asterisk/modules
  Spool directory:             /var/spool/asterisk
  Log directory:               /var/log/asterisk
  Run/Sockets directory:       /var/run/asterisk
  PID file:                    /var/run/asterisk/asterisk.pid
  VarLib directory:            /var/lib/asterisk
  Data directory:              /var/lib/asterisk
  ASTDB:                       /var/lib/asterisk/astdb
  IAX2 Keys directory:         /var/lib/asterisk/keys
  AGI Scripts directory:       /var/lib/asterisk/agi-bin

My pjsip.conf:

[global]
type = global
user_agent = Asterisk PBX
debug = yes

[transport-udp]
type = transport
protocol = udp
bind = 172.16.0.144:5060
local_net = 172.16.0.0/24

Here is the PJSIP debug trying to register the phone:

<--- Received SIP request (828 bytes) from UDP:172.16.0.64:5060 --->
REGISTER sip:172.16.0.144:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.64:5060;branch=z9hG4bK675825328
From: "Tercio X" <sip:200@172.16.0.144:5060>;tag=219751247
To: "Tercio X" <sip:200@172.16.0.144:5060>
Call-ID: 0_3255234995@172.16.0.64
CSeq: 115 REGISTER
Contact: <sip:200@172.16.0.64:5060>
Authorization: Digest username="200", realm="asterisk", nonce="1695380193/3324c6a2ac0567c28ddca43f32b7dd74", uri="sip:172.16.0.144:5060", response="3f0052f27eb4054372c5c2015ffefd82", algorithm=MD5, cnonce="0a4f113b", opaque="0840dfb37726e53a", qop=auth, nc=00000002
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T19P_E2 53.84.0.125
Expires: 0
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0


<--- Transmitting SIP response (488 bytes) to UDP:172.16.0.64:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.16.0.64:5060;rport=5060;received=172.16.0.64;branch=z9hG4bK675825328
Call-ID: 0_3255234995@172.16.0.64
From: "Tercio X" <sip:200@172.16.0.144>;tag=219751247
To: "Tercio X" <sip:200@172.16.0.144>;tag=z9hG4bK675825328
CSeq: 115 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1695381779/d8d64712bff213bf261d2713e20df8c1",opaque="0d4e131719549235",stale=true,algorithm=MD5,qop="auth"
Server: Asterisk PBX
Content-Length:  0


<--- Received SIP request (827 bytes) from UDP:172.16.0.64:5060 --->
REGISTER sip:172.16.0.144:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.64:5060;branch=z9hG4bK88348219
From: "Tercio X" <sip:200@172.16.0.144:5060>;tag=219751247
To: "Tercio X" <sip:200@172.16.0.144:5060>
Call-ID: 0_3255234995@172.16.0.64
CSeq: 116 REGISTER
Contact: <sip:200@172.16.0.64:5060>
Authorization: Digest username="200", realm="asterisk", nonce="1695381779/d8d64712bff213bf261d2713e20df8c1", uri="sip:172.16.0.144:5060", response="ff35ee65ebc233500fb4aa150df35460", algorithm=MD5, cnonce="0a4f113b", opaque="0d4e131719549235", qop=auth, nc=00000001
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T19P_E2 53.84.0.125
Expires: 0
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0


    -- Removed contact 'sip:200@172.16.0.64:5060' from AOR '200' due to request
<--- Transmitting SIP response (368 bytes) to UDP:172.16.0.64:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.0.64:5060;rport=5060;received=172.16.0.64;branch=z9hG4bK88348219
Call-ID: 0_3255234995@172.16.0.64
From: "Tercio X" <sip:200@172.16.0.144>;tag=219751247
To: "Tercio X" <sip:200@172.16.0.144>;tag=z9hG4bK88348219
CSeq: 116 REGISTER
Date: Fri, 22 Sep 2023 11:22:59 GMT
Expires: 0
Server: Asterisk PBX
Content-Length:  0


  == Contact 200/sip:200@172.16.0.64:5060 has been deleted
  == Endpoint 200 is now Unreachable
<--- Received SIP request (564 bytes) from UDP:172.16.0.64:5060 --->
REGISTER sip:172.16.0.144:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.64:5060;branch=z9hG4bK2516824261
From: "User 200" <sip:200@172.16.0.144:5060>;tag=2733776351
To: "User 200" <sip:200@172.16.0.144:5060>
Call-ID: 0_2963207982@172.16.0.64
CSeq: 1 REGISTER
Contact: <sip:200@172.16.0.64:5060>
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T19P_E2 53.84.0.125
Expires: 3600
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0


<--- Transmitting SIP response (478 bytes) to UDP:172.16.0.64:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.16.0.64:5060;rport=5060;received=172.16.0.64;branch=z9hG4bK2516824261
Call-ID: 0_2963207982@172.16.0.64
From: "User 200" <sip:200@172.16.0.144>;tag=2733776351
To: "User 200" <sip:200@172.16.0.144>;tag=z9hG4bK2516824261
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1695381780/967f76384da531de622272e0affb5515",opaque="32ff9ee607c0e5ae",algorithm=MD5,qop="auth"
Server: Asterisk PBX
Content-Length:  0


<--- Received SIP request (831 bytes) from UDP:172.16.0.64:5060 --->
REGISTER sip:172.16.0.144:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.64:5060;branch=z9hG4bK3450741613
From: "User 200" <sip:200@172.16.0.144:5060>;tag=2733776351
To: "User 200" <sip:200@172.16.0.144:5060>
Call-ID: 0_2963207982@172.16.0.64
CSeq: 2 REGISTER
Contact: <sip:200@172.16.0.64:5060>
Authorization: Digest username="200", realm="asterisk", nonce="1695381780/967f76384da531de622272e0affb5515", uri="sip:172.16.0.144:5060", response="d4bcee5b15a552b012a86237f159937b", algorithm=MD5, cnonce="0a4f113b", opaque="32ff9ee607c0e5ae", qop=auth, nc=00000001
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T19P_E2 53.84.0.125
Expires: 3600
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0


    -- Added contact 'sip:200@172.16.0.64:5060' to AOR '200' with expiration of 3600 seconds
<--- Transmitting SIP response (424 bytes) to UDP:172.16.0.64:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.0.64:5060;rport=5060;received=172.16.0.64;branch=z9hG4bK3450741613
Call-ID: 0_2963207982@172.16.0.64
From: "User 200" <sip:200@172.16.0.144>;tag=2733776351
To: "User 200" <sip:200@172.16.0.144>;tag=z9hG4bK3450741613
CSeq: 2 REGISTER
Date: Fri, 22 Sep 2023 11:23:00 GMT
Contact: <sip:200@172.16.0.64:5060>;expires=3599
Expires: 3600
Server: Asterisk PBX
Content-Length:  0


  == Endpoint 200 is now Reachable

Well, it looks like some missing module was causing this. I build asterisk again, without removing a bunch of modules, and now it is working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.