I am seeing something very odd happening on a system that has been running very well for months. We recently started seeing large chunks of phones (35-40 phones at a time) go unavailable. I started looking at some pjsip logging details and I’m seeing that these phones are attempting to re-REGISTER before their expiration time. What is weird is that Asterisk is responding to their re-REGISTER packet with “503 Service Unavilable”. Then a few seconds later Asterisk removes the pjsip contact due to “expiration”. Then a little later the phone will start over trying to register and this time the process looks normal and it works for a while until eventually this odd behavior happens again.
Here is the log output…
[2022-02-17 10:13:49] VERBOSE[2445] res_pjsip_logger.c: <--- Received SIP request (649 bytes) from TCP:xxx.xxx.xxx.20:11890 --->
REGISTER sip:SCRUBBED.DNS.ENTRY:5060 SIP/2.0
Via: SIP/2.0/TCP 10.0.0.192:11890;branch=z9hG4bK3881921094
From: "John Doe (7065)" ;tag=2536490602
To: "John Doe (7065)"
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact:
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T54W 96.84.0.30
Expires: 60
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0
[2022-02-17 10:13:49] VERBOSE[2445] res_pjsip_logger.c: <--- Transmitting SIP response (400 bytes) to TCP:xxx.xxx.xxx.20:11890 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/TCP 10.0.0.192:11890;received=xxx.xxx.xxx.20;branch=z9hG4bK3881921094
Call-ID: [email protected]
From: "John Doe (7065)" ;tag=2536490602
To: "John Doe (7065)" ;tag=z9hG4bK3881921094
CSeq: 1 REGISTER
Server: FPBX-14.0.16.11(16.20.0)
Content-Length: 0
[2022-02-17 10:14:04] VERBOSE[53826] res_pjsip_logger.c: <--- Transmitting SIP request (463 bytes) to TCP:xxx.xxx.xxx.20:11890 --->
OPTIONS sip:[email protected]:11890;transport=TCP SIP/2.0
Via: SIP/2.0/TCP xxx.xxx.xxx.12:5060;rport;branch=z9hG4bKPj88134694-2580-4968-b27b-a4e00a7c2abf;alias
From: ;tag=65cc0190-02c9-44fa-bbff-5a1015e2eb92
To:
Contact:
Call-ID: a255fd4e-a752-42d0-9668-9b68445826e1
CSeq: 35299 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-14.0.16.11(16.20.0)
Content-Length: 0
[2022-02-17 10:14:04] VERBOSE[2445] res_pjsip_logger.c: <--- Received SIP response (370 bytes) from TCP:xxx.xxx.xxx.20:11890 --->
SIP/2.0 200 OK
Via: SIP/2.0/TCP xxx.xxx.xxx.12:5060;rport=5060;branch=z9hG4bKPj88134694-2580-4968-b27b-a4e00a7c2abf;alias
From: ;tag=65cc0190-02c9-44fa-bbff-5a1015e2eb92
To: ;tag=1837962263
Call-ID: a255fd4e-a752-42d0-9668-9b68445826e1
CSeq: 35299 OPTIONS
User-Agent: Yealink SIP-T54W 96.84.0.30
Content-Length: 0
. . .
[2022-02-17 10:14:05] VERBOSE[2463] res_pjsip_registrar.c: Removed contact 'sip:[email protected]:11890;transport=TCP;x-ast-orig-host=10.0.0.192:11890' from AOR '7065' due to expiration
[2022-02-17 10:14:20] VERBOSE[2445] res_pjsip_logger.c: <--- Received SIP request (648 bytes) from TCP:xxx.xxx.xxx.20:11890 --->
REGISTER sip:SCRUBBED.DNS.ENTRY:5060 SIP/2.0
Via: SIP/2.0/TCP 10.0.0.192:11890;branch=z9hG4bK3913095958
From: "John Doe (7065)" ;tag=795045674
To: "John Doe (7065)"
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact:
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T54W 96.84.0.30
Expires: 60
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0
[2022-02-17 10:14:20] VERBOSE[45806] res_pjsip_logger.c: <--- Transmitting SIP response (550 bytes) to TCP:xxx.xxx.xxx.20:11890 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 10.0.0.192:11890;rport=11890;received=xxx.xxx.xxx.20;branch=z9hG4bK3913095958
Call-ID: [email protected]
From: "John Doe (7065)" ;tag=795045674
To: "John Doe (7065)" ;tag=z9hG4bK3913095958
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="SCRUBBED",opaque="SCRUBBED",algorithm=md5,qop="auth"
Server: FPBX-14.0.16.11(16.20.0)
Content-Length: 0
[2022-02-17 10:14:20] VERBOSE[2445] res_pjsip_logger.c: <--- Received SIP request (932 bytes) from TCP:xxx.xxx.xxx.20:11890 --->
REGISTER sip:SCRUBBED.DNS.ENTRY:5060 SIP/2.0
Via: SIP/2.0/TCP 10.0.0.192:11890;branch=z9hG4bK530506181
From: "John Doe (7065)" ;tag=795045674
To: "John Doe (7065)"
Call-ID: [email protected]
CSeq: 2 REGISTER
Contact:
Authorization: Digest username="7065", realm="asterisk", nonce="SCRUBBED", uri="sip:SCRUBBED.DNS.ENTRY:5060", response="SCRUBBED", algorithm=MD5, cnonce="SCRUBBED", opaque="SCRUBBED", 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-T54W 96.84.0.30
Expires: 60
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0
[2022-02-17 10:14:20] VERBOSE[81373] res_pjsip_registrar.c: Added contact 'sip:[email protected]:11890;transport=TCP;x-ast-orig-host=10.0.0.192:11890' to AOR '7065' with expiration of 60 seconds
[2022-02-17 10:14:20] VERBOSE[81373] res_pjsip_logger.c: <--- Transmitting SIP response (505 bytes) to TCP:xxx.xxx.xxx.20:11890 --->
SIP/2.0 200 OK
Via: SIP/2.0/TCP 10.0.0.192:11890;rport=11890;received=xxx.xxx.xxx.20;branch=z9hG4bK530506181
Call-ID: [email protected]
From: "John Doe (7065)" ;tag=795045674
To: "John Doe (7065)" ;tag=z9hG4bK530506181
CSeq: 2 REGISTER
Date: Thu, 17 Feb 2022 15:14:20 GMT
Contact: ;expires=59
Expires: 60
Server: FPBX-14.0.16.11(16.20.0)
Content-Length: 0
What would cause Asterisk to respond with 503 Service Unavailable randomly to some phones some of the time?