Yealink Registration Failed on FreePBX: Ordered Triage
Yealink registration failed on FreePBX is fixed by reading the SIP code on the phone and matching it to the Asterisk log: 401 or 403 is credentials or ACL, 404 is a wrong user or domain, and a timeout is network, port or transport.
- The SIP response code on the phone (401, 403, 404, 408, 480, 503, or silence) tells you which of credentials, network, transport or PBX is at fault.
- After changing an extension secret in FreePBX, the phone keeps the old secret until it is re-provisioned, so compare with pjsip show endpoint and force a fresh config.
- FreePBX PJSIP defaults to UDP 5060 and chan_sip used 5160, so a phone pointed at the wrong port gets no response at all.
- A fail2ban ban or Max Contacts limit can reject a correctly configured phone, so check fail2ban-client status and the extension's Advanced tab.
- Confirm success with pjsip show contacts and a test call, and never disable fail2ban or the firewall just to get a phone to register.
What does Yealink or Polycom registration failed mean on FreePBX?
The phone sent a SIP REGISTER and either got an error, got no answer, or never sent one. Provisioning only proves the phone can fetch a file over HTTP or TFTP. Registration is a separate SIP exchange, so a phone can pull its config perfectly and still show Registration Failed, Unregistered or No Service.
Start with the evidence, not guesses. On a Yealink, open the web UI at Status > Status for account state, then Diagnostics to export the syslog. On a Polycom, use Status > Lines on the phone, and Diagnostics > Logs (or the web UI log view) for the SIP trace.
Then map the response code to a cause:
| Phone shows | Meaning | First place to look |
|---|---|---|
| 401 Unauthorized (repeating) | Digest auth failed, usually wrong secret or auth name | pjsip show endpoint, provisioned password |
| 403 Forbidden | Credentials rejected, ACL, or ban | Extension ACL, fail2ban, Firewall zones |
| 404 Not Found | User or domain not known to the PBX | Register name, server address, wrong PBX |
| 408 or timeout | Request never answered | Network path, port, transport, firewall |
| 480 or 503 | Server side unavailable or overloaded | Asterisk status, endpoint limits, trunk |
| No response at all | Packets not reaching PJSIP | Wrong port, UDP vs TCP vs TLS, SIP ALG, firewall |
How do I watch the registration attempt on the PBX?
Reproduce the failure while watching the PBX. Reboot the phone or press Register in its UI, and capture the exchange at the same time.
If nothing appears in the trace, the packets are not reaching Asterisk, which points to the network, port or transport. If you see the REGISTER and a rejection, the log line names the cause.
asterisk -rvvvvv
pjsip set logger on
# or capture on the wire
sngrep -d any port 5060
# security events
tail -f /var/log/asterisk/security_log
# RTP only matters after registration works
rtp set debug onWhich Asterisk log line matches which fix?
Once you have the phone code and the log line, the fix is usually one step. The security log is the most reliable pointer: InvalidAccountID means the name does not exist, while ChallengeResponseFailed means the name exists but the password hash was wrong.
| Log line | Likely cause | Fix |
|---|---|---|
| Failed to authenticate / ChallengeResponseFailed | Wrong secret or auth username | Re-provision with the current secret, check auth name |
| No matching endpoint found / InvalidAccountID | Register name or user does not exist, or phone is on the wrong PBX | Fix user name, check the endpoint exists and is enabled |
| Endpoint '1001' has no configured AORs | Broken or incomplete extension, often after a bad import or manual DB change | Open the extension in FreePBX, submit and Apply Config |
| Contact 1001/sip:... is now Unreachable | Qualify failed, so NAT, firewall or the phone went away | Check NAT settings, keepalive, ACL and route to the phone |
| Request from ... failed for ... (ACL) | Extension or global ACL or firewall blocks the source | Add the subnet to Trusted or Local zone, fix the ACL |
| Registration rejected, max contacts or removed existing | Another device or stale contact holds the slot | Raise Max Contacts or enable Remove Existing |
Why does the phone keep sending the wrong password after I changed it?
The provisioned file holds whatever secret existed when it was generated. Changing the secret in FreePBX does not rewrite the phone's config, so the phone keeps answering the digest challenge with the old value and gets 401 in a loop.
Check what the PBX expects, then regenerate and push the config:
- Run the commands below and confirm the endpoint exists and shows an auth object. FreePBX typically names the PJSIP endpoint, AOR and auth objects with the bare extension number, so the auth object here is 1001, not 1001-auth.
- In FreePBX open the extension and copy the current secret, or use the EPM to rebuild the phone's config.
- In EPM (Endpoint Manager) rebuild the config for that device, then reboot the phone. On a Yealink use Settings > Auto Provision > Autoprovision Now. On a Polycom, reboot or use the Update Configuration action so it re-reads the server config.
- Compare the Yealink Account > Register fields with the extension: Register Name and User Name are the extension number, while Password is the secret. If Authentication Name is filled in, it must match the PJSIP auth username, normally the extension number as well.
- Retype the password by hand to rule out trailing whitespace. Special characters such as quotes, ampersands or percent signs can be mangled by templates, so test with a plain alphanumeric secret.
asterisk -rx 'pjsip show endpoint 1001'
asterisk -rx 'pjsip show auth 1001'
asterisk -rx 'pjsip show aors'Is the phone pointed at the right server, port and transport?
A timeout or total silence usually means the phone is talking to something that is not PJSIP. FreePBX defaults PJSIP to UDP 5060, while chan_sip was moved to 5160. A phone left at a port inherited from an older system, a stale IP, or a DNS name that still resolves to the old PBX gets no answer or a 404.
Transport must also match. If the phone is set to TCP or TLS but that transport is not enabled in Settings > Asterisk SIP Settings > PJSIP, nothing is listening. Verify what is actually up:
asterisk -rx 'pjsip show transports'
ss -lunp | grep -E '5060|5160'
ss -ltnp | grep -E '5060|5061'
# from a PC on the phone's VLAN
nslookup pbx.example.comCould fail2ban, the firewall or device limits be rejecting a correct phone?
Yes, and this is the classic cause when the config looks perfect. A few wrong-password attempts from an old secret can get the phone's IP banned, after which it sees timeouts or 403 even with the right secret. The FreePBX Firewall module also drops SIP from any network not in a Trusted or Local zone, so a new VLAN or subnet needs to be added there.
The extension itself can also refuse. On the Advanced tab, Max Contacts defaults to 1. A second phone using the same extension, or a stale registration from a replaced handset, blocks the new one unless Remove Existing is set to Yes. Also check EPM: if two devices were assigned the same extension, the later phone competes with the first.
- List jails and banned IPs with fail2ban-client status, then inspect the jail with the sshd or asterisk name it shows.
- Unban the phone, replacing the IP, and fix the cause of the bad attempts first or it will be banned again.
- In Connectivity > Firewall, add the phone subnet to the Local or Trusted zone, then check Intrusion Detection settings.
- In the extension's Advanced tab, set Max Contacts and Remove Existing as needed, and check no other device uses that extension.
fail2ban-client status
fail2ban-client status asterisk-iptables
fail2ban-client set asterisk-iptables unbanip 192.168.10.45
asterisk -rx 'pjsip show contacts'What provisioning and network problems cause a phone to register, then drop?
Provisioning faults produce confusing symptoms. If the MAC address is mapped to the wrong extension in EPM, the phone pulls another extension's config and shows a 401 or registers as the wrong user. Check the MAC on the phone label against the EPM mapping, and confirm the template or profile matches the model. Phones can also cache config, so reboot them or trigger autoprovision after any change.
A firmware default or a local override can beat server settings. If the web UI shows values you did not provision, do a factory reset on the phone (on Polycom also clear the local overrides) and provision again.
Registrations that work then expire point at time and NAT. Common causes are SIP ALG on the router (turn it off), wrong External Address or Local Networks in Asterisk SIP Settings, a registration expiry set too short or too long for the NAT state timeout, and the phone's NAT keepalive being off. See the existing NAT article on this site for the full settings instead of repeating them here.
Make sure the phone's time and NTP are correct, as TLS fails when the clock is off.
| Setting | Yealink | Polycom |
|---|---|---|
| Server address | Account > Register > SIP Server 1 (account.1.sip_server.1.address) | reg.1.server.1.address |
| Port | Server Port (account.1.sip_server.1.port) | reg.1.server.1.port |
| Transport | Transport (account.1.sip_server.1.transport_type: 0 UDP, 1 TCP, 2 TLS) | reg.1.server.1.transport |
| Register user | Register Name, User Name | reg.1.address |
| Auth user and password | Authentication Name (account.1.auth_name), Password | reg.1.auth.userId, reg.1.auth.password |
| Outbound proxy | Outbound Proxy Server, leave empty on a LAN | reg.1.outboundProxy.address |
How do I confirm it is fixed and test a call?
Check the PBX first, not just the phone icon. A contact in Avail state with a sensible URI means the registration is live. Then call another extension and confirm audio in both directions.
- Run asterisk -rx 'pjsip show contacts' and look for the extension with status Avail (or NonQual/Unknown/Unavail if qualify is off or failing).
- Run asterisk -rx 'pjsip show endpoint 1001' and check Contact lines and that no auth errors are in the security log.
- On the phone, confirm the account status reads Registered.
- Dial a second extension, then dial *43 (echo test) to check two-way audio.
- If audio is one-way, the problem is RTP and NAT, not registration.
asterisk -rx 'pjsip show contacts'
asterisk -rx 'pjsip show endpoint 1001' | grep -i contact
tail -n 20 /var/log/asterisk/security_log Common questions
Why does a Polycom show unregistered after provisioning?
The phone fetched a file but the values in it, such as reg.1.auth.password, reg.1.server.1.address or the transport, do not match the extension. Check Status > Lines for the code, compare it with pjsip show endpoint, and look for a wrong MAC mapping in EPM that gave the phone another extension's config.
What does Yealink No Service mean?
No Service means the account is enabled but not registered, often because the phone has had no valid response yet or has no account configured. Check Account > Register for the server, port and transport, and look at the Yealink syslog for the SIP code.
Why do I get 401 when the password is correct?
A 401 is the normal first challenge, so only a repeating 401 is a failure. A repeating one usually means a wrong auth username, a stale provisioned secret, hidden whitespace or a special character that was mangled. Retype a simple secret to test.
Can I register a Yealink on the chan_sip port 5160?
Only if the extension is a chan_sip extension. A PJSIP extension needs the PJSIP port, normally UDP 5060, and sending PJSIP registrations to 5160 gets no answer. Match the port to the driver the extension uses.
How do I stop a phone being banned again?
Find out why it sent bad passwords, usually a stale secret in the config, and re-provision it. Then unban the IP and add its subnet to the FreePBX Firewall Local or Trusted zone, rather than turning off fail2ban.