Skip to content

Voicemail

A flow's voicemail block records into either a mailbox chosen when the flow is drawn, or the mailbox of the extension the call was ringing. An optional prompt plays before the beep; without a prompt the caller hears only the beep. The message finishes when the caller presses #, hangs up, or reaches the mailbox's maximum length (180 seconds by default).

Two short pauses sit in that sequence on purpose. A second and a half after the call is answered, before anything is played, gives the media path time to come up so the first word is not clipped and the beep is not lost whole. Two seconds between the prompt ending and the beep keeps the beep readable as a cue rather than as the tail of the sentence that announced it. Neither costs the caller any of their message: recording starts when the beep has finished playing, and the mailbox's maximum length is counted from there.

Click a mailbox name to see its newest 200 messages, including caller details and duration. Messages can be played, downloaded as WAV, and deleted. The inbox refreshes every ten seconds. Deleting an unused mailbox also deletes its messages. A message counts as new until it is played back or downloaded, which is what turns the phone's light out. A message can also be emailed, with or without the recording (see Voicemail to email); it is not transcribed yet.

The light on the phone

A desk phone that subscribes to its own address-of-record is told how many messages the mailbox it owns holds (RFC 3842's message-summary package), and is told again the moment that changes: a message left, a message played back, a message deleted. Nothing has to be configured — the light belongs to the extension that owns the mailbox, so a phone is told about its own mailbox and no other. A mailbox a team shares drives no light: a phone can only subscribe to its own account, so a shared mailbox needs an extension of its own to light one. An extension whose mailbox was taken away has nothing to subscribe to and its SUBSCRIBE is refused, rather than answered with a count that could never change.

A phone shows the light while the mailbox holds a message nobody has listened to. Playing a message back or downloading it, from the Voicemail page or through the API, is what marks it heard — so the light follows whether the message was actually heard rather than whether the page was opened.

Busy-lamp fields (watching another extension's phone) are a different event package and are not served: the call control siphon-pbx drives does not report which of several rung phones answered, so an extension's state cannot be told truthfully, and a lamp that guessed would be worse than none.

A mailbox of one extension's own

Every extension is created with a mailbox of its own, named after it and renamed with it. It is a mailbox like any other: it has its own greeting and length limit, its inbox is on the Voicemail page, and a flow may name it outright. Which extension it belongs to is recorded on the mailbox, so there is one answer to whether an extension has one: taking a mailbox away is deleting it, from the Voicemail page or from the extension's own panel, and giving one back is POST /api/v1/extensions/{number}/mailbox. An extension that wants none from the start is created with "voicemail": false.

A call dialled straight to an extension needs no flow: it rings the phone and falls through to that extension's own mailbox, or hangs up when the extension has none.

In a flow, {"type": "voicemail", "mailbox": {"of": "ringing_extension"}} records into the mailbox of whichever extension the call was ringing when it gave up: the one phone that was ringing, which in a group rung one at a time is its last member. Every path to the block has to establish one, so a flow is refused (no_ringing_extension) when a call could reach it with nothing having rung, after a group rung all at once, or after a queue rang its agents. An extension whose mailbox was taken away is a warning instead (no_extension_mailbox), since an administrator can give it one back without republishing; a call that gets there anyway ends as a flow error with the reason in the log, rather than pretending to take a message.

Storage and deployment

Migration 0020 adds message metadata and audio in Postgres, so database backups include voicemail. Migration 0023 records the extension a mailbox belongs to and gives every extension that already exists one, so an upgraded organisation takes messages per person without being reconfigured. The telephony compose stack supplies a private recordings volume shared with the media engine. init-recordings sets directory ownership; the engine writes a random filename there. PBX imports only the finalised, non-empty WAV, then removes the temporary file after the database write succeeds. Failed imports are logged and the engine file is retained for recovery. No background recovery or automatic message retention policy is configured; administrators delete messages through the inbox.

A recording with nothing in it

The engine can finalise a WAV with no audio behind its header, and two very different things look like that: a caller who hung up on the beep without saying anything, and audio that never reached the file although the caller was speaking. Nothing on the control plane distinguishes them — the packet counters that would are in the media engine's own end-of-call summary, which is written to its CDR sink and not sent to a control application — so the flow reads it from how long the recording was open.

Under three seconds it is a caller who left nothing: the call completes with the no_message_left outcome, no message is stored, and the engine's file is removed. That is deliberately not a message of zero length, which would claim one and light a message-waiting lamp for silence. At three seconds or more the recording had every chance to hold a message and holds none, so the call ends as a flow error naming that — the caller believes they left a message and it is gone. Either way nothing is left on the volume; a file is retained only when there was audio and storing it failed.

For deployments outside compose, mount the same directory at the same path in PBX and the media engine, and set SIPHON_PBX_RECORDINGS_DIR (default /recordings). It must be writable by the engine and readable and writable by PBX. The API never accepts or exposes filesystem paths.

Public API

These routes require the mailbox organisation's session, like mailbox configuration:

Method Path Result
GET /api/v1/mailboxes/{id}/messages Newest 200 messages, newest first
GET /api/v1/mailboxes/{id}/messages/{message}/audio PCM WAV with Cache-Control: private, no-store
DELETE /api/v1/mailboxes/{id}/messages/{message} Delete a message, 204

Each message has id, caller_number, caller_name, received_at (UTC), and duration_ms. Deletion requires the same X-Requested-With header as other mutations. A mailbox or message owned by another organisation returns 404.

deploy/e2e/telephony.sh sends non-silent RTP with SIPp, checks saved messages after the recording limit, # key and caller hangup, decodes the downloaded WAV independently, and verifies deletion. It also dials an extension directly and asserts the message lands in that extension's own mailbox, and that an extension created without one hangs up instead.