Saltar al contenido principal

Phones on networks that block SIP

Some networks stop desk phones from working even though web browsing works fine: hotels, guest Wi-Fi, some offices, and some mobile and home internet providers. They close the SIP ports (5060 and 5061), inspect traffic and drop anything that looks like a phone call, or rewrite calls with a broken "SIP ALG" in the router. The usual symptoms:

  • the phone does not register, or registers and drops again;
  • calls connect but you hear nothing, or only one side hears the other;
  • the same phone works at the office or on a mobile hotspot.

MonoPbx has two options for these phones under Admin > Restricted networks. Both are off until you turn them on, and need no configuration files, certificates or port changes.

:::note Local rules In some countries internet telephony is restricted by law or by the provider's terms. These options do not change what is allowed. Follow the rules that apply where your phones are. :::

The two options​

Stealth SIP on port 443Built-in VPN for desk phones
How it worksThe phone connects to your PBX over encrypted TLS on port 443, the port websites use.The phone opens an encrypted tunnel to your PBX and sends everything through it.
CallsSignalling over TLS, audio always encrypted (SRTP).Everything inside the tunnel.
Helps whenSIP ports are closed, calls are inspected or rewritten (SIP ALG).Even port 443 is filtered for phones, or the audio is blocked.
PhonesEvery supported desk phone vendor.Phones with an OpenVPN client: Yealink, Grandstream, Fanvil, Snom and Htek.
AppsMonoPhone and the web phone also get an audio relay on port 443 (TURN over TLS).Not needed: the apps already work over port 443.

Try Stealth SIP first. Use the VPN for phones it does not help.

Turn on Stealth SIP​

  1. Open Admin > Restricted networks.
  2. Turn on Stealth SIP on port 443. The page runs its checks at once.
  3. Read the status line. Working means a phone outside your network can use it.
  4. On each phone that needs it, open Admin > People and devices > Devices and phones, select the phone and set Network to Stealth (TLS 443), then Apply. Phones left on Auto switch by themselves (see below).

The phone is told to fetch its settings at once. If it is not registered, or does not change within a minute, reboot it. Its device page then shows Registered through Stealth (TLS 443).

Stealth SIP needs the built-in front proxy on port 443, which the installer sets up by default when the server has a name and a certificate. Phones connect to the server's public name, for example pbx.example.com, on port 443; no extra DNS record is needed.

The front proxy shares port 443 with phones only while Stealth SIP on port 443 or the Built-in VPN for desk phones is on; otherwise port 443 serves only the console and the apps. After you turn either switch on or off, the server applies it within about 20 seconds; apps that are connected at that moment may reconnect once. On a server without the console's update agent, run sudo mpbx-ctl front-sync after changing a switch; sudo mpbx-ctl front-l4 shows whether port 443 is shared.

What a stealth phone gets​

  • SIP over TLS to the server's public name on port 443, with that name as the outbound proxy;
  • a keep-alive every 30 seconds so the connection stays open;
  • encrypted audio (SRTP) required. A call that offers unencrypted audio on this path is refused.

Changing the phone's template keeps working: the server, port and transport come from the same template variables as before. Custom templates can add the extra settings with the stealth flag and the stealth.proxy_host and stealth.proxy_port variables (see Desk phone provisioning).

The Network setting of a phone​

NetworkThe phone uses
Auto (default)The normal SIP ports. When Stealth SIP is on, a phone that fetches its settings from outside your own network (from a public address) is given Stealth instead; phones on your local network keep the normal ports.
NormalThe normal SIP ports, following the phone's transport setting.
Stealth (TLS 443)Stealth SIP, as described above. Only while Stealth SIP is on.
VPNThe built-in VPN. Only while the VPN is on and only for phones with an OpenVPN client.

Turning Stealth SIP off moves its phones back to the normal ports the next time they fetch their settings.

Built-in VPN for desk phones​

The built-in VPN gives each supported phone an encrypted tunnel to your PBX. The phone's registration, calls and audio all travel inside it, so a network that blocks SIP, inspects calls or blocks the audio sees only one encrypted connection. The PBX runs the VPN server itself and makes every certificate; there is nothing to install on a PC and nothing to copy to the phones.

Turn on the VPN​

  1. Open Admin > Restricted networks.
  2. Turn on Built-in VPN for desk phones. The first time, the PBX creates its own VPN certificates and starts the VPN service; this takes a few seconds.
  3. Open UDP port 1194 to the server in your firewall or cloud security group. Phones on networks that block UDP fall back to TCP port 443, which needs the built-in front proxy (the installer's default).
  4. Press Test. The status line says Working when the VPN server runs and answers.
  5. On each phone that needs it, open Admin > People and devices > Devices and phones, select the phone, set Network to VPN and Apply.

The phone fetches its settings, receives its own VPN certificate and VPN profile, connects the tunnel and registers through it. This can take a minute and some phones restart once. Its device page then shows Registered through the VPN and, in the VPN panel, its address inside the VPN. The VPN card shows how many phones are connected, for example 3 phones connected through VPN, with the list.

If the page shows a command such as sudo mpbx-ctl vpn on, this server cannot start the VPN service by itself (an older installation without the update agent): run the command once on the server.

Supported phones​

PhoneVPN profile
YealinkDownloaded by the phone as a small file next to its settings, with its own certificate.
GrandstreamInside the phone's settings. Grandstream phones use UDP 1194 only.
FanvilDownloaded as a small file next to its settings.
SnomDownloaded as a small file next to its settings.
HtekDownloaded as a small file next to its settings.
Cisco, PolyNo built-in VPN client. Use Stealth (TLS 443) for these phones; the device page says so.

A phone on the VPN connects to the server's public name, for example pbx.example.com, first on UDP 1194 and then on TCP 443. Inside the tunnel it registers with the PBX's VPN address, 10.213.0.1, which is also its outbound proxy. The tunnel reaches the phone service only: a phone on the VPN cannot reach other phones, your network or the internet through it.

Certificates and revoking​

Each phone gets its own certificate, valid for ten years and renewed automatically before it ends. Nobody needs to see or copy it.

  • Revoke VPN certificate on the phone's device page disconnects the phone within seconds. While its network stays VPN, the phone gets a new certificate the next time it fetches its settings. Use it when you want to replace a phone's VPN key.
  • To keep a lost or stolen phone out, revoke or delete the device. Its VPN certificate is revoked with it and the VPN server refuses it from then on.

Turning the VPN off disconnects every phone on it; they go back to the normal SIP ports the next time they fetch their settings.

VPN address range​

The VPN uses the private range 10.213.0.0/24 (up to about 250 phones). If your own network already uses that range, ask your installer to change MPBX_VPN_SUBNET in the server's settings file before you turn the VPN on.

VPN troubleshooting​

CheckIf it fails
Public nameThe PBX does not know the name phones connect to. Set the server's domain, then test again.
VPN service"This server cannot start the VPN by itself": run the command shown on the page once on the server.
VPN serverNot running: press Fix, which restarts it. Phones reconnect within a minute.
UDP 1194"Could not reach UDP port 1194 from inside the server" is common behind a router that does not loop traffic back. Make sure UDP 1194 is open to the server, and test with a phone outside your network.
TCP 443The fallback for networks that block UDP does not answer. It needs the built-in front proxy on port 443: re-run the installer with it on.

If a phone shows its VPN as connected but does not register, check that its Network is VPN on its device page and apply its settings again. The per-phone provisioning log on the device page shows when the phone downloaded its VPN profile.

Stealth SIP troubleshooting​

The Test button runs these checks from the server:

CheckIf it fails
Front proxyThe server has no built-in front proxy on port 443. Re-run the installer with the front proxy on.
NameThe server's public name does not resolve. Fix its DNS record.
Port 443"Port 443 not reachable from the internet — check your firewall": open TCP 443 to the server. "Could not test port 443 from inside the server" is common behind a router that does not loop traffic back; test with a phone outside your network.
CertificateThe certificate is not publicly trusted, so phones that check it refuse to connect. Use a certificate from a public authority (the installer gets one automatically when you give it an e-mail address).
SIP on port 443Port 443 does not answer SIP: make sure Stealth SIP is on. "Answers with the web page only" means the server needs the latest update.
Audio relay for the appsThe apps have no audio relay on port 443. Turn on the audio relay (TURN) when you run the installer.

If a stealth phone registers but calls fail with "Not acceptable", its encryption setting was changed by hand: set its SRTP back to mandatory, or apply its settings again from the device page.

Stealth SIP carries the signalling and encrypts the audio, but the audio itself still travels over UDP. On a network that blocks all UDP, use the built-in VPN for desk phones; MonoPhone and the web phone relay their audio over port 443 by themselves.