Skip to main content

mod_voicemail_ivr — Voicemail IVR Navigation

mod_voicemail_ivr lives in src/mod/applications/mod_voicemail_ivr and provides a fully DTMF-driven IVR front-end for voicemail retrieval and management. It handles caller authentication, inbox navigation (new/saved messages), message deletion, saving, forwarding with optional prepend recording, and subscriber preferences such as greeting and name recording and password changes.

The module delegates all storage operations to configurable back-end API commands — by default the vm_fsdb_* family provided by mod_voicemail — so the IVR logic is decoupled from the storage layer. Reach for this module when you need a phone-based voicemail retrieval experience on top of an existing voicemail store.

Loading the Module

The module name for load and modules.conf.xml is mod_voicemail_ivr. It is not present in the vanilla modules.conf.xml load list (only mod_voicemail appears there); you must add the entry manually and then either restart FreeSWITCH or run load mod_voicemail_ivr from fs_cli.

<load module="mod_voicemail_ivr"/>

No special build flag is needed; the module compiles as part of the standard FreeSWITCH build when its source directory is present.

Configuration: voicemail_ivr.conf.xml

The module reads voicemail_ivr.conf.xml from the FreeSWITCH autoload config path. The file contains one or more named <profile> blocks. Each profile has three child sections:

  • <settings> — operational parameters.
  • <apis> — mapping of logical operation names to actual FreeSWITCH API commands that perform storage operations.
  • <menus> — DTMF key bindings and phrase macro names for each IVR screen.

All 13 <api> entries are required; the module logs an error and refuses to use the profile if any are missing.

Settings Parameters

ParameterPurposeAccepted ValuesDefault
IVR-Maximum-AttemptsMaximum DTMF entry retries before exiting an IVR screenPositive integer3
IVR-Entry-TimeoutMilliseconds to wait for DTMF after audio finishesPositive integer (ms)3000
Record-FormatAudio file format used when recording greetings, names, or prepend messagesAny FreeSWITCH-supported format string (e.g., wav, mp3)wav
Record-Sample-RateSample rate override for recordingsInteger Hz (e.g., 8000)Not set (uses channel rate)
Record-Silence-HitsNumber of consecutive silence frames that trigger end-of-recordingPositive integer4
Record-Silence-ThresholdSilence energy threshold for end-of-recording detectionInteger200
Record-Maximum-LengthMaximum recording duration in secondsPositive integer30
Record-Minimum-LengthMinimum acceptable recording duration in seconds; recordings shorter than this are rejectedPositive integerNot set (no minimum enforced)
Exit-PurgeWhen true, permanently deletes all messages flagged for deletion when the session endstrue / falsetrue
Password-MaskDTMF input mask applied when collecting a password or new password; . means one-or-more repetitionsMask string (e.g., XXX.)XXX.
User-MaskDTMF input mask applied when collecting a mailbox IDMask string (e.g., X.)X.

Settings defined at the <profile> level act as defaults; individual <menu> blocks may override IVR-Maximum-Attempts and IVR-Entry-Timeout with their own <settings> section. The navigator menu also accepts Nav-Action-On-Delete (e.g., next_msg) to control cursor movement after a message is deleted. The main menu accepts Action-On-New-Message (e.g., new_msg:std_navigator): when there are new messages and the caller presses no key as the menu options play, the IVR auto-jumps once to the bound menu function instead of timing out. The shipped config sets it on std_main_menu.

API Mappings

Each <api> element binds a logical operation to the FreeSWITCH API command that the module will call at runtime. The default profile maps all operations to the vm_fsdb_* commands from mod_voicemail.

name attributeDefault valueOperation performed
auth_loginvm_fsdb_auth_loginAuthenticate a mailbox ID and password
msg_listvm_fsdb_msg_listList messages in a folder
msg_countvm_fsdb_msg_countCount messages by status
msg_deletevm_fsdb_msg_deleteMark a message for deletion
msg_undeletevm_fsdb_msg_undeleteUnmark a message for deletion
msg_savevm_fsdb_msg_saveMove a message to the saved folder
msg_purgevm_fsdb_msg_purgePermanently purge deleted messages
msg_getvm_fsdb_msg_getRetrieve metadata and path for one message
msg_forwardvm_fsdb_msg_forwardForward a message to another mailbox
pref_greeting_setvm_fsdb_pref_greeting_setSet the active greeting slot
pref_greeting_getvm_fsdb_pref_greeting_getRetrieve current greeting file path
pref_recname_setvm_fsdb_pref_recname_setSave a recorded name file
pref_password_setvm_fsdb_pref_password_setUpdate the mailbox password

Configuration Example

The following is a trimmed excerpt from the shipped voicemail_ivr.conf.xml:

<configuration name="voicemail_ivr.conf" description="Voicemail IVR">
<profiles>
<profile name="default">
<settings>
<param name="IVR-Maximum-Attempts" value="3" />
<param name="IVR-Entry-Timeout" value="3000" />
<param name="Record-Format" value="wav" />
<!--<param name="Record-Sample-Rate" value="8000" />-->
<param name="Record-Silence-Hits" value="4" />
<param name="Record-Silence-Threshold" value="200" />
<param name="Record-Maximum-Length" value="30" />
<!--<param name="Record-Minimum-Length" value="3" />-->
<param name="Exit-Purge" value="true" />
<param name="Password-Mask" value="XXX." />
<param name="User-Mask" value="X." />
</settings>
<apis>
<api name="auth_login" value="vm_fsdb_auth_login" />
<api name="msg_list" value="vm_fsdb_msg_list" />
<api name="msg_count" value="vm_fsdb_msg_count" />
<api name="msg_delete" value="vm_fsdb_msg_delete" />
<api name="msg_undelete" value="vm_fsdb_msg_undelete" />
<api name="msg_save" value="vm_fsdb_msg_save" />
<api name="msg_purge" value="vm_fsdb_msg_purge" />
<api name="msg_get" value="vm_fsdb_msg_get" />
<api name="msg_forward" value="vm_fsdb_msg_forward" />
<api name="pref_greeting_set" value="vm_fsdb_pref_greeting_set" />
<api name="pref_greeting_get" value="vm_fsdb_pref_greeting_get" />
<api name="pref_recname_set" value="vm_fsdb_pref_recname_set" />
<api name="pref_password_set" value="vm_fsdb_pref_password_set" />
</apis>
<!-- <menus> section omitted for brevity; see voicemail_ivr.conf.xml -->
</profile>
</profiles>
</configuration>

Dialplan Applications

ApplicationPurposeArguments
voicemail_ivrLaunch the voicemail IVR for an authenticated or unauthenticated callercheck <profile> <domain> [id]

voicemail_ivr

The sole registered application. The first positional argument must be the literal word check. The profile argument names a <profile> block in voicemail_ivr.conf.xml. The domain argument identifies the voicemail domain. The optional id argument pre-supplies the mailbox number; when omitted the IVR prompts the caller for it during authentication.

When id is provided and the channel variable voicemail_authorized is set to true, the authentication screen is bypassed entirely and the caller goes directly to the main menu.

<!-- Route to voicemail retrieval without pre-supplying the mailbox number -->
<action application="voicemail_ivr" data="check default $${domain}"/>

<!-- Skip authentication when the dialplan already verified the caller -->
<action application="set" data="voicemail_authorized=true"/>
<action application="voicemail_ivr" data="check default $${domain} ${caller_id_number}"/>

IVR Flow

The application runs three sequential phases, each resolved to a named menu function:

  1. Authentication (std_authenticate) — collects mailbox ID (if not pre-supplied) and password via DTMF and calls the auth_login API. Skipped if voicemail_authorized=true.
  2. Main menu (std_main_menu) — announces message counts and accepts keys to navigate new messages, saved messages, or preferences.
  3. Termination (std_purge) — if Exit-Purge is true, calls the msg_purge API before the session ends.

Channel Variables

VariableSet / ReadPurpose
voicemail_authorizedReadWhen set to true on the channel before calling voicemail_ivr, the authentication screen is skipped and the caller proceeds directly to the main menu.

See also

Source: src/mod/applications/mod_voicemail_ivr, conf/vanilla/autoload_configs/voicemail_ivr.conf.xml