# Sonata Dialer Agent Login (The connection to the server has failed.)

**URL:** https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917
**Category:** Sonata Dialer Issues
**Created:** [January 21, 2025, 1:33pm UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917 "2025-01-21T13:33:43Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![RenatoSagcal](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/renatosagcal/32/2172_2.png) [@RenatoSagcal](https://forums.vitalpbx.org/u/RenatoSagcal)
#### Post date: [January 23, 2025, 10:45am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/21 "2025-01-23T10:45:48Z")

</div>

@zahid  
What are your changes?  
Did you use the default port 443?

---

<div class="post-metadata">

### Author: ![zahid](https://forums.vitalpbx.org/letter_avatar_proxy/v4/letter/z/e79b87/32.png) [@zahid](https://forums.vitalpbx.org/u/zahid)
#### Post date: [January 23, 2025, 10:55am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/22 "2025-01-23T10:55:28Z")

</div>

Yes i did setup as default and it is working  
The time zone was UTC i did change it to New York and now i am able to make test calls

---

<div class="post-metadata">

### Author: ![RenatoSagcal](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/renatosagcal/32/2172_2.png) [@RenatoSagcal](https://forums.vitalpbx.org/u/RenatoSagcal)
#### Post date: [January 23, 2025, 11:24am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/23 "2025-01-23T11:24:34Z")

</div>

Yes it is working when using default port.

I will wait for @maynor for their checking regarding the custom port. Really need this as it adds additional security not only for Sonata Dialer as well as other add ons or things that uses HTTPS.

---

<div class="post-metadata">

### Author: ![zahid](https://forums.vitalpbx.org/letter_avatar_proxy/v4/letter/z/e79b87/32.png) [@zahid](https://forums.vitalpbx.org/u/zahid)
#### Post date: [January 23, 2025, 11:38am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/24 "2025-01-23T11:38:32Z")

</div>

Yes absolutely  
And i think it is possible through (NGNIX) we can map custom ports External to internal as Sonata apps are running virtual hosts  
During troubleshoot i found Sonata dialer listening on 6002 port as virtual host

---

<div class="post-metadata">

### Author: ![RenatoSagcal](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/renatosagcal/32/2172_2.png) [@RenatoSagcal](https://forums.vitalpbx.org/u/RenatoSagcal)
#### Post date: [February 3, 2025, 3:25am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/25 "2025-02-03T03:25:47Z")

</div>

Any updates on this @maynor still no updates?

---

<div class="post-metadata">

### Author: ![maynor](https://forums.vitalpbx.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@maynor](https://forums.vitalpbx.org/u/maynor)
#### Post date: [March 26, 2025, 8:23pm UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/26 "2025-03-26T20:23:20Z")

</div>

Hello!

Sorry for the delay in the response, the new version of S. Dialer is available!: [Sonata Dialer – Versions 4.5.0-3 & 4.0.2-2](https://forums.vitalpbx.org/t/sonata-dialer-versions-4-5-0-3-4-0-2-2/5227)

Please proceed with the update,

Regards,

---

<div class="post-metadata">

### Author: ![Connexium](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/connexium/32/4453_2.png) [@Connexium](https://forums.vitalpbx.org/u/Connexium)
#### Post date: [February 11, 2026, 11:32am UTC](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917/27 "2026-02-11T11:32:26Z")

</div>

Hi everyone,

Had the same issue of a fresh Sonata (4.5.0-5) on a 4.5.1 R6 VitalPBX release  
But same issue happend after upgrade to 4.5.2 R1

I wanted to share what finally fixed this issue for me. While this might not be the exact same issue the OP is facing, I’m hoping my experience helps someone else who finds this thread while troubleshooting.

In my case, I was using a standard setup (default port 443, no custom HTTPS ports) and had my SSL certificates correctly configured. Despite the UI looking correct, the Agent Portal would consistently show “The connection to the server has failed.”

**What was wrong:** Even though the add-on was installed, the background services and “workers” that handle the connection were not running or enabled by default. Because these services were “dead” (inactive), the browser couldn’t establish the WebSocket handshake.

**The Fix (via CLI):** You’ll need to log in to your PBX via SSH as root and run these commands to bring the backend to life:

1. **Fix permissions and clear old logs:** `dialer app:fix-permissions` `dialer logs:clear`
2. **Enable and start the services:** (Note: VitalPBX 4 uses instanced workers, so you need to enable them specifically). `systemctl enable --now sonata-dialer` `systemctl enable --now sonata-dialer-worker@1` `systemctl enable --now sonata-dialer-worker@2` `systemctl enable --now sonata-dialer-worker@3`
3. **Verify they are running:** `systemctl status sonata-dialer` `systemctl status sonata-dialer-worker@1`

**Settings to check in the Web UI:** Under **Sonata Dialer \> Settings \> PBX Settings** :

- **Host:** Ensure this matches your FQDN (e.g., `pbx.yourdomain.com`) and NOT `localhost` if you are using SSL.
- **Port:** 443
- **Secure:** Checked
- **WSS Port:** 8089

Once those services were started, the Agent Portal immediately connected without further changes.

**A note for the VitalPBX team:** It seems that on some fresh installs of VitalPBX 4, these services don’t always start or enable themselves automatically. It might be worth looking into the installation script to ensure these workers are triggered by default so users don’t have to manually intervene in the CLI.

[Previous page](https://forums.vitalpbx.org/t/sonata-dialer-agent-login-the-connection-to-the-server-has-failed/4917.md?page=1)
