One-Touch Call Recording

Features Asterisk 18+ -- Last reviewed 2026-08-22 recording mixmonitor features dtmf Found this useful? Upvote it. ×

One-Touch Call Recording

Let users start and stop call recording by pressing a DTMFDual-Tone Multi-Frequency, the touch-tone signals phones send for digit input during a call, used by IVRs and feature codes. key during an active call. This uses the automixmon feature map entry, which toggles MixMonitor on and off.

Features Configuration (features.conf)

[featuremap]
automixmon => *3      ; Press *3 to toggle recording on/off

[applicationmap]
; Optional: custom recording feature with specific filename
custom_record => *4,self,MixMonitor,${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLERID(num)}.wav,b

Dialplan: Enabling Recording Features

[internal]
; Using built-in automixmon (X option enables it for callee, x for caller)
exten => _1XXX,1,NoOp(Call with one-touch recording enabled)
 same => n,Dial(PJSIP/${EXTEN},30,xX)
 same => n,Hangup()

; Using custom recording via DYNAMIC_FEATURES
exten => _2XXX,1,NoOp(Call with custom recording feature)
 same => n,Set(__DYNAMIC_FEATURES=custom_record)
 same => n,Dial(PJSIP/${EXTEN},30,Tt)
 same => n,Hangup()

; Always-on recording (no DTMF toggle needed)
exten => _3XXX,1,NoOp(Auto-recorded call)
 same => n,MixMonitor(${UNIQUEID}.wav,ab)
 same => n,Dial(PJSIP/${EXTEN},30)
 same => n,StopMixMonitor()
 same => n,Hangup()

How it works

  1. automixmon: A built-in feature map entry that toggles MixMonitor on the channelA single call leg passing through Asterisk. Channels represent connections to endpoints and are what dialplan applications act on.. The first press starts recording, the second press stops it. Audio from both sides is mixed into a single file.
  2. Dial() options x and X: Lowercase x allows the caller to trigger automixmon. Uppercase X allows the callee. Use both (xX) to let either party record.
  3. MixMonitor vs Monitor: MixMonitor records both sides into a single file. The older Monitor application records each direction into separate files (-in.wav and -out.wav). MixMonitor is preferred.
  4. Recording location: By default, recordings are saved to /var/spool/asterisk/monitor/. The filename defaults to the channel name. Use MixMonitor(filename.wav) to set a custom name.
  5. MixMonitor options: a appends to an existing file, b bridges audio from both channels immediately. Without b, recording starts only when the call is answered.

Tips

User Notes

Know a tip or gotcha for this topic? Share it below and help others.

Contribute a note

Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.

Moderated before publishing. Email never shown.
Related Snippets