# How to tell a VICIdial server is idle before you touch it

> The database can look quiet while calls are still up. How to quiesce a VICIdial floor and which single command proves nothing is on the wire.

URL: https://trustane.com/blog/is-vicidial-server-idle
By Trustane. Published 2026-11-05.

> **To the point**
> A VICIdial server is idle only when Asterisk says it holds zero channels. The database records what the application intends, so it can look quiet while calls are still up.
>
> - Run `asterisk -rx 'core show channels count'` on every live node. Zero on all of them is idle.
> - `vicidial_live_agents`, `vicidial_auto_calls` and the campaign `active` flag each miss part of the picture.
> - Take the reading twice, a few seconds apart, and once more right before a destructive step.
> - A heartbeat in `server_updater` older than about two minutes means a dead node.

## The only honest check

Run the command on each dialer node and read the active channels. If it is zero, nothing is on the wire. If it is anything else, the floor is not idle, whatever the database says.

```bash
asterisk -rx 'core show channels count'
```

It prints active channels, active calls and calls processed since start. Read the first two. A box that has just emptied can show a few channels while recent calls tear down, so count twice.

## Why the database lies

Three places look like they should answer the question. Each fails differently.

![Diagram comparing what three VICIdial tables can and cannot tell you about live calls](https://trustane.com/media/47a7495ccbb4e0b8-1600x618.webp "Each table answers a narrower question than whether anyone is on a call")

`vicidial_auto_calls` is a MEMORY table. It is rebuilt empty on every restart, and if a dialer process has just died it can be empty while Asterisk still holds the channels. Asterisk is what holds the calls, so ask Asterisk.

## On a cluster, ask every live node

The `servers` table lists what the cluster was configured to be. The `server_updater` table shows what is running, because each node writes a heartbeat to its `last_update` column.

```bash
mysql -e "SELECT server_id, server_ip, last_update FROM server_updater ORDER BY last_update DESC"
```

A row older than about two minutes is a dead node. Counting it overstates the cluster, and waiting for it means waiting for a box that is not there. Show the age of each heartbeat so a person can judge. Then run the channel count on each live node.

The database name, user, password and port are in `/etc/astguiclient.conf` (the `VARDB_*` lines). On some builds they are randomised, so do not assume `asterisk` and 3306.

## Getting to zero, in order

If you cannot wait for the floor to empty, this is the order we use.

![Diagram: five steps from stopping new calls to counting channels again](https://trustane.com/media/eb1d9aa6c9df19e0-1600x1060.webp "Stop the inflow first, then log agents out, then count")

Every step changes a live floor, so tell the people on it first. A warning that agents are logged in should be a warning, not a block. Whether a maintenance window is worth waiting for is the owner's call.

> **Close the agent log row first**
> Each agent's current session has an open row in `vicidial_agent_log`. Close it before you delete the live-agent row, or that session never ends.

## What idle does not prove

![Checklist of four things a zero channel count does not guarantee](https://trustane.com/media/8931fe927fed049d-1600x825.webp "A zero count is a reading at one moment, not a promise")

For the hopper, see [why a campaign is not dialing](https://trustane.com/guides/why-vicidial-is-not-dialing-hopper). Decide the number you accept before you start. For a restart of a web service a few calls may be fine. For a database wipe or a cutover, the number is zero on every node.

> **Take the reading late**
> Idle is a point in time. Read it as late as you can, and read it again immediately before the destructive step. If you are about to wipe a database, refuse when agents are live on the destination.

## When the count will not fall

If the count stays up after campaigns are closed and agents logged out, something is still dialing. Look at what holds the channels with `asterisk -rx 'core show channels'`. Check for a long inbound call, a remote agent, a conference or a stuck local channel.

A stuck channel with no matching call in `vicidial_auto_calls` will not clear by itself. A restart of Asterisk is what is left, and it drops anything real on the line. That is a decision for the person who owns the floor, not for a script.

## Questions people ask

### Can I trust an empty vicidial_live_agents table?

No. It only means nobody is logged in to the agent screen. Remote agent lines and calls still up after the agent screen has gone are not covered.

### Does setting a campaign to inactive stop the calls in flight?

No. `active='N'` stops new calls. The ones already placed finish by themselves, which in our runs took seconds, not minutes.

### What does mysqlcheck report on the MEMORY tables?

It says the storage engine does not support check. That is noise, not damage.

## Next steps

Pick your accepted number, run the count on every live node, and write down the time. If you want a second pair of eyes before a cutover, a [managed migration](https://trustane.com/migrate) shows the result before anything is deleted. For where the new server lives and what it costs, see [VICIdial hosting](https://trustane.com/vicidial-hosting) and [pricing](https://trustane.com/vicidial-pricing). The copy rules are in [what we copy and what we never copy](https://trustane.com/blog/move-vicidial-server-what-to-copy).

VICIdial is a trademark of its owner. Trustane is an independent hosting provider.
