VoIP.info Guide

Asterisk voicemail: mailboxes, routing and retrieval

Keep mailbox identity, call routing and message notification separate when building voicemail.

Reviewed 2026-09-07Asterisk 22 LTSIntermediateDocumentation based · not lab tested

Map the mailbox explicitly

A mailbox belongs to a voicemail context. It is not automatically identical to the dialplan context or the PJSIP endpoint name. Record the intended mailbox and context before connecting an unanswered call to VoiceMail.

Voicemail has four distinct stages
Call routing reaches a mailbox greeting. Audio is stored as a message, then retrieval and notification proceed through separate paths.

A message-waiting or email fault can occur even when the recording was saved correctly.

Build a controlled test

Create the mailbox using the documented voicemail configuration and a unique PIN. In a restricted test dialplan, call the explicit mailbox after an unanswered extension. The fragment below assumes the mailbox already exists; it is not a complete mailbox configuration.

Check that the greeting matches the user, a message is saved and authenticated retrieval works. A nonexistent mailbox is a routing error, not evidence that the caller's microphone is broken.

/etc/asterisk/extensions.conf — restricted test context
exten => 7201,1,VoiceMail(2001@office,u)
 same => n,Hangup()

Test notification separately

Message waiting, email delivery and stored audio are separate paths. First prove that a message exists and can be played locally. Then inspect the phone's mailbox mapping or email delivery status. Forwarding every message by email creates another copy with its own access and retention requirements.

Operate and recover

Monitor storage, test a full mailbox and document who resets a forgotten PIN. Include greetings, messages and configuration in the recovery design. FreePBX users should configure mailboxes through supported GUI controls rather than copying this standalone Asterisk fragment into generated files.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.