vicigeeksimple guides
Browse
All guides

Phone system (Asterisk) · Recording fault · channel cleanup

VICIdial recording will not stop: investigate channel buildup safely

Investigate a legacy mono recording whose conference leg remains active after a call. First identify the recording type; stereo, parallel and gateway recordings use different controls.

Reader setup

Before you diagnose

  1. Root or an authorized read-only account on the Asterisk server, so `asterisk -rx` and a targeted grep of `/etc/astguiclient.conf` both actually work.
  2. A curl configuration file already set up for the Agent API, for example `/etc/vicidial-api/agent.cfg`, so no user name or password is ever typed on the command line.
  3. One synthetic test call you are authorized to place and record, so you have a real channel and recording ID to check instead of a live customer's.
Expected result
You can tell a genuine stranded-conference-leg recording fault from a finished-file backlog or a still-live call, using only read-only checks, before anyone stops a channel or reports the transfer path to your VICIdial owner.
Before making changes
Only stop a channel or recording once the checks below have confirmed, by recording ID and channel name, that it belongs to your own synthetic test call.

Identify the recording type before following a channel

Start on the authorized lead’s Recordings area and record its recording ID, extension/type, start time, owning server and file path privately. This procedure is for legacy mono agent-session recording, such as the captured 8309 Monitor/Wait leg. A blank STEREO marker identifies legacy mono in the current project documentation; an S-prefixed stereo type needs the stereo guide instead.

The signal is specific: a recording keeps growing well past the point a transfer or hangup should have ended it, or the count of active channels on the server keeps climbing instead of settling back down between calls. A channel, in Asterisk (the open-source phone engine underneath VICIdial), is one live leg of audio — the agent's leg, the customer's leg, and a leg inside a conference are each their own channel, and one call can involve several at once.

This is different from a recording that only looks long because the call itself ran long, or a storage alert that fires because old finished recordings were never archived. Confirm the call's own timestamp, the recording's own start time, and whether the underlying channel still shows as active before assuming anything is actually stuck.

Some VICIdial troubleshooting instinct reaches for the dialplan — Asterisk's own set of call-handling instructions — first. This guide does not: the mechanism below centers on the agent's own conference and the one leg VICIdial records from it, not a dialplan setting anyone would need to edit.

A VICIdial forum thread reports exactly this pattern: a recording that kept growing for hours, with channel buildup on the server, after a three-way transfer — one account of the mechanism below, not a guaranteed match for your own build.

Choose the recording investigationScroll sideways to compare columns
Recording typeNext checkStop boundary
Legacy mono agent sessionMatch agent/conference and recording leg, then use this guide’s STATUS/STOP checks.A database START row alone does not prove the leg is still active.
Customer-channel stereo / parallelUse the stereo guide and identify its customer-channel/type-specific control.Legacy recording STOP does not establish that every stereo/parallel file stopped.
Gateway or unknownAsk the recording owner to identify the recorder and retention process.Do not hang up a guessed channel.

Identify and verify stereo recordings

Trace path · read left to right
01Agent API recording STATUS02Recording leg on extension 830903Stranded conference leg after transfer

Why a recording keeps running after the call should be over

On this build's stock recording extension, VICIdial does not use Asterisk's newer MixMonitor application at all; starting a recording from the agent screen runs `agc/manager_send.php`'s MonitorConf action, which writes a row to `recording_log` and then queues an AMI Originate into the campaign's own Recording Extension — 8309 on a stock build, or 8310 for a GSM-format recording. That extension is a short, fixed sequence: Answer, then Asterisk's older Monitor application (still present and running on this build, though marked deprecated), then a long Wait, then Hangup. The Originate creates a dedicated recording leg inside the agent's own conference — ConfBridge on this build — and Monitor names the file from the caller ID name field VICIdial set on that leg. Stopping works the same way in reverse: VICIdial's StopMonitorConf action writes that `recording_log` row's end time and length, then finds the matching leg among the live SIP channels and queues an AMI Hangup for it — VICIdial's own "stop" is exactly that one hangup, nothing more.

VICIdial does use a dialplan `h` extension on this build, confirmed with `dialplan show trunkinbound`, which runs an AGI hook for hangup and call-logging — but that extension governs call-detail records, not recordings. A context missing or breaking that `h` handling can leave a call's log entry incomplete; on its own, it is not why a recording keeps running.

A transfer or a three-way call is the riskiest moment for a stuck recording, because it adds a leg to the conference for the new party without necessarily tearing down the original recording leg the instant the call looks, on screen, like it has ended. If that original leg is never actually hung up, it keeps running its own Monitor and keeps writing, even though the agent and the customer both believe the call is already over — the exact pattern the forum report above describes.

One consequence of this shipped design is worth knowing on its own: a recording leg actually running the stock 8309 steps stops itself, through its own Wait and Hangup, after roughly an hour, whether or not VICIdial's own stop message ever arrives. If a recording appears to grow beyond that interval, verify the active channel, file identity and configured extension. A custom dialplan or another process writing the file may explain the discrepancy; the duration alone does not identify the cause.

Rank the likely causes before you touch anything

Work through these in the order below: the fix for the first cause does nothing for the third, and acting on the fourth without recognizing it is how a diagnostic session turns into an outage.

  • Most likely: a recording leg was left behind in the agent's own conference after a transfer or a three-way call, the exact forum-reported pattern above, and it was never actually hung up.
  • Second: VICIdial's own stop never reached the recording leg — either the agent closed the browser tab instead of logging out normally, so the screen never sent a stop at all, or VICIdial queued the stop's AMI Hangup action but the `ASTsend` screen session that delivers queued AMI actions never actually delivered it.
  • Third: nothing is actually stuck — the mover or cron job that clears finished recording files out of the working directory has fallen behind, so a backlog of already-finished files looks like ongoing growth.
  • Fourth, and the one to escalate rather than fix yourself: the audio is genuinely still live, meaning a real person remains connected on a channel somewhere, and this is not a cleanup bug at all.

Check the shipped Agent API before opening the Asterisk CLI

VICIdial's own Agent API ships a `recording` function with a STATUS value built for exactly this question, so check it before reaching for a raw Asterisk command. One read-only call reports the recording ID, filename, server, start time and the agent's own session state together.

The config file supplies the API URL, user, password and `source`; the only fields you add per call are `agent_user`, the VICIdial user whose session you are checking, plus `function` and `value`. Nothing sensitive appears outside the file.

Use a dedicated permitted API account and an isolated synthetic agent. Keep the config, returned recording ID and filename private; an API version response does not prove protected recording access.

Before you use it
Run this against your synthetic test agent while their session is still open; the config file supplies the API URL, user and password, so nothing sensitive appears on the command line.
Check the agent's own recording status
curl --fail-with-body --silent --show-error --config /etc/vicidial-api/agent.cfg --data-urlencode "agent_user=<AGENT_USER>" --data-urlencode "function=recording" --data-urlencode "value=STATUS"
Evidence · ViciBox 12 demo capture · demo values substituted

Captured demo response · 2026-09-23 21:35 UTC. Any filtering, hidden values or test-only data are identified in the capture label. Select Replay transcript to read the recorded output.

Command output line: curl --fail-with-body --silent --show-error --config /etc/vicidial-api/agent.cfg --data-urlencode "agent_user=kpisynag" --data-urlencode "function=recording" --data-urlencode "value=STATUS"
ERROR: agent_user is not logged in - kpisynag
Success looks like
A `NOTICE: recording active` line reports the recording ID, filename, server, start time and the agent's own status — STATUS itself never returns SUCCESS; that word is reserved for the START and STOP values.
Stop if
`NOTICE: not recording` means this agent's current session has no active recording — it cannot see a leg orphaned from an earlier, already-ended session. `ERROR: agent_user is not logged in` means there is no session open at all right now. Either response sends you to the Asterisk-level checks below, since STATUS can only report on the session that is open right now.

Confirm the channel, the file paths, and the screen sessions

Once the agent has logged out, or when you need to see a channel the API is not reporting on, go straight to Asterisk. `core show channels verbose` lists every live channel and the context it is currently running, which shows immediately whether the call you are chasing has actually ended underneath.

On the documented lab, extension 8309 or 8310 and Wait 3600 can suggest a recording leg. These values do not establish ownership or prove a leg is stranded; correlate the exact channel and recording ID with your synthetic test and check the configured recording extension.

The two variables in `/etc/astguiclient.conf` that name where in-progress and completed recordings live are worth confirming by name rather than guessed at; grep for them specifically instead of reading the whole file, since it also holds database credentials that must never be printed.

The channel listing may contain other people’s calls. Inspect it privately and correlate only the exact channel belonging to your authorized synthetic test; extension and Wait values alone do not establish ownership.

Before you use it
Run all three together; none of them needs a placeholder value or a live call in progress, so this capture works as a baseline any time.
Read-only channel and path checks
asterisk -rx 'core show channels verbose'screen -lsgrep -i "PATHmonitor\|PATHDONEmonitor" /etc/astguiclient.conf
Evidence · ViciBox 12 demo capture

Captured demo response · 2026-09-23 21:35 UTC. Any filtering, hidden values or test-only data are identified in the capture label. Select Replay transcript to read the recorded output.

Command output line: asterisk -rx 'core show channels verbose'
Channel Context Extension Prio State Application Data CallerID Duration Accountcode PeerAccount BridgeID
0 active channels
0 active calls
2 calls processed
Command output line: screen -ls
There are screens on:
17814.ASTVDremote (Detached)
16697.ASTVDadapt (Detached)
22463.ASTemail (Detached)
3255.ASTConfUpdater (Detached)
3252.ASTVDauto (Detached)
3249.ASTlisten (Detached)
3246.ASTsend (Detached)
3243.ASTupdate (Detached)
3013.asterisk (Detached)
2996.astshell20260920080703 (Detached)
2096.ASTVDadFILL (Detached)
2085.ASTfastlog (Detached)
12 Sockets in /run/screens/S-root.
Command output line: grep -i "PATHmonitor\|PATHDONEmonitor" /etc/astguiclient.conf
PATHmonitor=/var/spool/asterisk/monitor
PATHDONEmonitor=/var/spool/asterisk/monitorDONE
Success looks like
No channel shows Extension 8309 or 8310 with Wait 3600 that you cannot account for, `screen -ls` lists `ASTsend` among its sessions, and the two conf values point at real, distinct in-progress and completed directories.
Stop if
An unfamiliar channel may belong to another call. Do not stop it. If ASTsend is missing, record the result and ask the server administrator to check the queue, process and scheduled recovery on this build; the screen listing alone cannot prove why it is absent.

Fix the cleanup path, not the symptom

For a confirmed stranded recording belonging to your own isolated synthetic test, prefer the Agent API STOP path if the agent session is still open. The example below is unexecuted; obtain the synthetic agent ID and a dedicated authorized API configuration. This stops one recording, not the underlying cause.

If the agent session has ended, ask the administrator to inspect the exact channel and recording ID privately. A direct channel hangup bypasses VICIdial recording-stop bookkeeping and can require reconciliation; do not use a channel based on extension or Wait alone. Document the observed transfer or conference path and escalate a recurring symptom.

Before you use it
Prospective state-changing example: replace <AGENT_USER> with the confirmed synthetic agent only. The protected configuration must belong to a dedicated permitted API account. Do not publish the response or credentials.
Stop a confirmed synthetic test recording
curl --fail-with-body --silent --show-error --config /etc/vicidial-api/agent.cfg --data-urlencode "agent_user=<AGENT_USER>" --data-urlencode "function=recording" --data-urlencode "value=STOP"
Reader-run example · not executed for this guide

This example has no recorded result here. Follow its preparation, expected result and stop conditions before using it.

Success looks like
The API response reports the outcome for the selected synthetic agent; verify the recording state separately. No STOP result is demonstrated here.
Stop if
A direct CLI hangup bypasses VICIdial’s recording-stop bookkeeping, so the database row may need administrative reconciliation. If the symptom recurs, document the test path and escalate rather than repeatedly hanging up channels.

Verify with a fresh call, not the same one

Recovery means a brand new synthetic call, not another look at the one you were diagnosing. Place one more test call, transfer it through the same path the original symptom happened on, hang up normally, and repeat the checks above.

This is a prospective test only. A new synthetic call and its result have not been demonstrated here.

  • The Agent API STATUS call for that fresh test now returns no active recording once the call is over.
  • `core show channels verbose` no longer lists a channel from that test after a normal hangup delay.
  • The finished file actually lands in the completed directory named in `/etc/astguiclient.conf`, not the in-progress one.

When to stop and hand this to someone else

Escalate immediately, rather than continuing to test alone, the moment a real customer's channel is the one still recording, disk usage on the recording partition is climbing toward full, or channel counts are rising across calls that have nothing to do with the transfer path you are testing. Any one of those turns a cleanup bug into an outage or a compliance problem, and neither is safe to keep diagnosing solo on a live system.

Checks and sources

What was checked

  • AGENT_API.txt documents the `recording` function's STATUS value and its exact return fields, cited directly rather than recalled from memory.
  • A VICIdial forum thread reports the same growing-recording-and-channel-buildup pattern after a three-way transfer that this guide's mechanism section explains.
  • On this build, `dialplan show 8309@default` shows exactly Answer, Monitor(wav), a long Wait, then Hangup, and the shipped `agc/manager_send.php` stop path queues a Hangup for that same recording leg and writes its end time — confirmed directly on this lab rather than assumed from a different VICIdial version.

Primary references

Sources

  1. Recording not stopping on 3-way transfer/hangup, growing to 3hrs, channel buildupVICIdial forum · accessed September 23, 2026
  2. VICIdial Agent APIVICIdial · accessed September 23, 2026
  3. Stereo versus legacy mono recordingVICIdial · accessed November 7, 2026

Follow without guesswork

Get the next article

RSS is live now. Email delivery below is an explicit local preview and sends nothing.Open the RSS feed
Email preview only. The address stays in this browser and is never transmitted.