انتقل إلى المحتوى
تكنولوجيا 7 نوفمبر 2026 11 قراءة دقيقة

SIP Trunk Registration Failed: How to Fix It

Fix a SIP trunk that will not register: what 401, 403, 408 and 423 mean on REGISTER, the realm and auth ID traps, NAT keep-alives, and how to read the trace.

D
7 نوفمبر 2026

إجابة سريعة

A SIP trunk fails to register when the registrar rejects or never receives the REGISTER request. A repeating 401 or 407 means wrong credentials, auth ID or realm. A 403 is a refusal, so stop retrying and ask the carrier. A 408 or silence points to DNS, transport, port or firewall problems. A 423 means your expiry is too short. If registration works but calls fail, suspect NAT bindings and keep-alives. Capture the trace to see which one it is.

A trunk that will not register is one of the most frustrating faults in VoIP, because the screen usually says only "failed" or "unregistered". The real answer is in a single SIP status code and a few header lines, and the same handful of causes explain most cases.

This guide is vendor-neutral. It ties each code to the SIP standard (RFC 3261), explains the realm and auth ID traps that cause endless 401 loops, and shows how to read a trace. First, a question that saves hours: does your trunk need to register at all?

Do you need to register at all? IP-authenticated vs registering trunks

There are two common ways a carrier knows a trunk is yours. With IP authentication, the carrier trusts traffic from the source addresses you gave them, so there is no REGISTER and nothing to fail. With registration, your PBX or dialer sends a REGISTER with a username and password, and the carrier uses that registration to know where to send inbound calls. Which model you have is the carrier's decision, written in the setup sheet they gave you.

نموذجHow the carrier identifies youWhat can fail
IP authenticationSource IP address on an allow-listYour IP changed or is not listed, so calls are rejected (for example with a 403)
RegistrationUsername and password on REGISTER, refreshed before it expiresCredentials, realm, expiry, NAT, firewall

Two mistakes are common. The first is switching registration on for an IP-authenticated trunk, then chasing the errors it produces. The second is the reverse: leaving registration off when the carrier needs it, so inbound calls never arrive. If the carrier's sheet says "register to" a host name, you register. If it only lists IP addresses to allow, you probably do not.

How a REGISTER exchange works

REGISTER is defined in RFC 3261 section 10. Your device tells the registrar "calls for this address can reach me at this Contact for this long". A normal exchange has four steps:

  1. Your device sends a REGISTER with no credentials.
  2. The registrar replies 401 Unauthorized with a WWW-Authenticate header holding a realm and a nonce. RFC 3261 says 401 is issued by user agent servers and registrars, while 407 is the equivalent used by proxy servers (section 21.4.2).
  3. Your device sends the REGISTER again with an Authorization header computed from the username, password, realm and nonce.
  4. The registrar replies 200 OK, listing the current bindings and the expiry it actually granted.

So a single 401 at the start is normal and not an error. The fault is a 401 that keeps coming back after your device has answered it.

The expiry matters too. Your device suggests an interval with an Expires header or an expires parameter on the Contact, but the registrar selects the actual time based on its local policy (RFC 3261, section 10.2.1.1). The 200 OK tells you what you got. Your device is responsible for refreshing the binding before that interval has elapsed (section 10.2.4). If it does not, the registration lapses and inbound calls stop, with no error on the screen.

401 and 407 loops: username vs auth ID, realm, password

When the second REGISTER also receives a 401, the registrar looked at your credentials and rejected them. Work through the usual suspects in this order:

  • Username versus auth ID. Many carriers give you two values: the number or account name that appears in the From and To headers, and a separate authentication username used to compute the digest. Typing the account number into both fields is the most common cause of a permanent 401 loop. Use the value the carrier labels as the authentication username in the auth field.
  • Password. Look for trailing spaces, characters changed by a password manager, and a portal password mistaken for the SIP password. They are often different credentials.
  • Realm. The realm comes from the registrar in the WWW-Authenticate header. RFC 3261 says a realm string alone defines the protection domain, and recommends it contains a hostname or domain name (section 22.1). Your device normally copies the realm from the challenge. If you have typed a fixed realm into the configuration and it does not match the one the server sends, the digest will not validate. Leave the field blank or match it exactly to what the trace shows.
  • The domain in the request. Some registrars only accept the REGISTER if the domain in the Request-URI is the one they expect. Use the exact SIP domain from the carrier's sheet, not an IP address or a different host name.
  • Proxy challenges. A 407 Proxy Authentication Required means a proxy in the path wants credentials, not the registrar. It is rarer on REGISTER, but when you see it, check for an outbound proxy setting that is not meant to be there.

An illustrative trace of a failed attempt shows how little you need to read:

REGISTER sip:carrier.example.com SIP/2.0
Contact: <sip:1001@203.0.113.10:5060>
Expires: 3600

SIP/2.0 401 Unauthorized
WWW-Authenticate: Digest realm="carrier.example.com", nonce="..."

REGISTER sip:carrier.example.com SIP/2.0
Authorization: Digest username="1001", realm="carrier.example.com", ...

SIP/2.0 401 Unauthorized
WWW-Authenticate: Digest realm="carrier.example.com", nonce="..."

The addresses and names above use reserved example values. Two 401s in a row, with the second request carrying an Authorization header, tell you the server rejected what you sent. The username in that Authorization line is the first thing to compare with the carrier's sheet.

403 Forbidden on REGISTER: a refusal, so stop retrying

A 403 is different from a 401. RFC 3261 defines it this way: the server understood the request but is refusing to fulfil it, authorization will not help, and the request SHOULD NOT be repeated (section 21.4.4). Sending the same credentials again changes nothing. Common reasons sit on the carrier's side, and you cannot fix them from the device. They can include:

  • Your source IP address is not on the carrier's allow-list.
  • The account is suspended, not yet activated, or out of credit.
  • The username exists but is not allowed to register from this location or this transport.
  • Too many failed attempts may have triggered an automatic block on the carrier's side, which is a good reason not to hammer a failing trunk.

The practical step is to stop the retry loop, note your public IP address, and send the carrier the time of the attempt, the username and the public IP. They can see in their own logs why the request was refused.

408 or no response: DNS, transport, port and firewall

If the REGISTER never gets an answer, the device times out. RFC 3261 describes 408 Request Timeout as the server being unable to produce a response in a suitable time, and says the client MAY repeat the request later (section 21.4.9). In practice a 408 shown on your device is often generated locally, because nothing came back: RFC 3261 says a client that times out MUST treat it as if a 408 had been received (section 8.1.3.1). Check the path in order:

  1. DNS. A client locates a SIP server by resolving the host name: NAPTR records, then SRV records, then A or AAAA records, with the default port for the transport when none is given (RFC 3263, sections 4.1 and 4.2). If the name does not resolve from the machine that sends the REGISTER, nothing goes out. Test resolution from that machine, not from your laptop.
  2. Transport and port. The default ports are 5060 for UDP and TCP and 5061 for TLS (RFC 3261, section 18.2.1). Make sure the transport you chose is the one the carrier offers on that port. UDP configured against a TLS-only endpoint just times out.
  3. Firewall and security groups. Outbound traffic to the carrier must be allowed, and replies must be able to come back. A rule that permits the outbound packet but blocks the reply looks exactly like a dead server.
  4. Message size. RFC 3261 requires a request larger than 1300 bytes, when the path MTU is unknown, to be sent over a congestion-controlled transport such as TCP (section 18.1.1). A REGISTER carrying many headers, or a device that does not switch transports, can be dropped as a fragmented UDP packet.
  5. The carrier endpoint itself. Check the carrier's status page or support line. If other trunks reach it, yours is the problem.

The quickest test is to capture packets on the sending device. If the REGISTER leaves and nothing returns, the fault is in the network or at the carrier. If it never leaves, the fault is local configuration or DNS.

423 Interval Too Brief and registrations that quietly expire

A 423 means the registrar is rejecting the request because the expiry you asked for is too short. RFC 3261 describes it as usable by a registrar to reject a registration whose Contact expiry was too small, and it carries a Min-Expires header (section 21.4.17). The client may retry with an expiry equal to or greater than that value (section 10.2.8). The fix is to raise the registration interval to at least the Min-Expires number in the response.

The quieter version of this problem has no error at all. The registration works, then lapses because the device did not refresh in time, or because it refreshed a different binding than the one that was created. Symptoms: calls arrive for a while after a restart and then stop; the status flips between registered and unregistered; the carrier shows your trunk as offline when the device shows it as online. Check that the refresh is sent before the granted interval ends, and that the interval is the one in the 200 OK, not the one you asked for.

Registered but calls still fail: NAT bindings and keep-alives

If your device sits behind NAT, the carrier's inbound INVITE has to travel back through the same NAT binding the REGISTER opened. Bindings do not last forever. An idle UDP mapping can close, and then the carrier is sending calls to a port that no longer leads to you. The registration still looks valid on the carrier side until it expires, so the failure is silent.

RFC 5626 describes the standard remedy. A keep-alive mechanism keeps NAT bindings refreshed and also detects flow failure (RFC 5626, section 3.5). For connection-oriented transports the device sends a double CRLF "ping" and waits for a single CRLF "pong"; for UDP it uses STUN over the same flow. When the server sends no Flow-Timer, the RFC's default for the UDP (STUN) keep-alive is a random interval between 24 and 29 seconds (section 4.4.2), and the CRLF method treats the flow as failed if no pong arrives within 10 seconds (section 4.4.1). It notes that many NATs have UDP timeouts as low as 30 seconds. If the server sends a Flow-Timer header, the device must send keep-alives at least that often (section 4.4).

Practical steps when registration holds but inbound calls fail:

Capture the trace and read it line by line

Do not guess. Capture one failed registration attempt from the device that sends the REGISTER, then read it in this order:

  1. Find the first REGISTER and note the Request-URI domain, the From and To users, the Contact and the Expires value.
  2. Find the first response. No response means network or DNS. A 401 is the normal challenge. A 403 is a refusal. A 423 shows Min-Expires.
  3. Compare the retry. Does the second REGISTER carry an Authorization header? Is the username in it the one the carrier gave you? Is the realm the same as in the challenge?
  4. Read the final answer. A 200 OK includes the granted expiry. Compare it with what you asked for.
  5. Watch the refresh. Leave the capture running past half the expiry and check that a new REGISTER goes out on time.

For the meaning of the status codes you will meet on calls rather than registrations, see رموز أخطاء SIP في المكالمات الصادرة.

كيف يتناسب DialerBee

On DialerBee's bring-your-own-carrier gateway form, the Authentication tab offers IP-based authentication or Digest Auth with اسم المستخدم المصادق عليه, كلمة مرور المصادقة و نطاق/مدى SIP. التسجيل لدى مقدم الخدمة is off by default. Turn it on only if the carrier expects a registration, and leave فترة التسجيل (بالثواني) at 3600 unless they asked for something else. The أحضر مشغّل الاتصالات الخاص بك page lists IP ACL, digest authentication or TLS client certificates as the options, and the full walkthrough is in كيفية توصيل خط SIP الخاص بك (إعداد BYOC).

If you connect an Asterisk or PJSIP system to the dialer, the registration questions are the same on that side; see Asterisk PJSIP trunk to a cloud dialer. If the term is new, ما هو خط SIP ؟ covers the basics.

Registration checklist

  • The carrier's sheet says whether to register or authenticate by IP, and your settings match.
  • Username, auth username, password and SIP domain are copied exactly from the sheet.
  • The realm is blank or matches the challenge in the trace.
  • The host name resolves from the sending machine, and the transport and port match the carrier's offer.
  • Outbound and return traffic are allowed through the firewall.
  • The requested expiry is at or above any Min-Expires value.
  • Keep-alives are on if the device is behind NAT.
  • After a 403, retries are stopped and the carrier has your public IP, username and the time of the attempt.
  • A test call in each direction works, not just a green registration status.

الأسئلة الشائعة

Why does my SIP trunk say registration failed?

The registrar answered with an error, or did not answer at all. A 401 or 407 that repeats means the credentials, auth ID or realm are wrong. A 403 means the server understood the request and is refusing it, so retrying will not help. A 408 or no response at all usually points to DNS, the transport, the port or a firewall. A 423 means your requested expiry is shorter than the registrar allows.

Does every SIP trunk need to register?

No. Many carriers authenticate by source IP address and never expect a REGISTER, while others require the customer's PBX or dialer to register with a username and password. Which one applies is a carrier decision, so check what your carrier's setup sheet says before you turn registration on. Registering to a carrier that does not expect it can produce errors that look like faults.

What is the difference between 401 and 403 on a REGISTER?

A 401 is a challenge: the registrar wants credentials and will accept a retry that carries a correct Authorization header (RFC 3261, sections 21.4.2 and 22.2). A 403 is a refusal: the server understood the request and RFC 3261 says it SHOULD NOT be repeated (section 21.4.4). Keep sending after a 403 and you only add load and noise to the carrier's logs.

What does 423 Interval Too Brief mean?

The registrar is rejecting the expiry you asked for because it is too short. The 423 response carries a Min-Expires header with the smallest value it accepts. RFC 3261 section 10.2.8 says the client may retry with an expiry equal to or greater than that value, so raise your registration interval to at least the Min-Expires number.

Why does my trunk register fine but then unregister or stop receiving calls?

Usually a NAT or firewall binding has expired, or the registration was not refreshed before its expiry. Through NAT, an idle UDP binding can close, so the carrier's inbound call never reaches you even though the registration looks healthy. Keep-alives and a refresh sent before the expiry runs out are the usual cure (RFC 5626 describes the keep-alive mechanisms, and RFC 3261 section 10.2.4 requires the refresh before the interval has elapsed).

How do I see why registration fails?

Capture the SIP messages on the device that sends the REGISTER and read them in order: the first REGISTER, the response, the retry with credentials, and the final answer. The status code, the WWW-Authenticate realm and the Contact and Expires values tell you which of the common causes you are dealing with.

مصادر

  1. RFC 3261, SIP: Session Initiation Protocol, sections 8.1.3.1, 10, 18.1.1, 18.2.1, 21.4.2, 21.4.4, 21.4.9, 21.4.17, 22.1 and 22.2. rfc-editor.org/rfc/rfc3261 (تم التحقق في 7 نوفمبر 2026)
  2. RFC 3263, Session Initiation Protocol (SIP): Locating SIP Servers, sections 4.1 and 4.2. rfc-editor.org/rfc/rfc3263 (تم التحقق في 7 نوفمبر 2026)
  3. RFC 5626, Managing Client-Initiated Connections in SIP, keep-alive sections 3.5, 4.4, 4.4.1 and 4.4.2. rfc-editor.org/rfc/rfc5626 (تم التحقق في 7 نوفمبر 2026)

قراءات ذات صلة

هل أنت مستعد لرؤية تطبيق DialerBee أثناء العمل؟

اطلب عرضًا توضيحيًا مباشرًا مدته 15 دقيقة، أو ابدأ تجربة مجانية لمدة 14 يومًا — دون شرائح عرض، ودون أي التزام. يبدأ الاتصال بمجرد ربط خط SIP أو نظام PBX الخاص بك واعتماده.

تجربة مجانية لمدة 14 يومًا · رصيد ذكاء اصطناعي مجاني · بدون بطاقة · 11 لغة · BYOC · ضوابط داعمة للامتثال

← عرض الموقع كاملاً بالإنجليزية