Message recorder

Home » Asterisk Users » Message recorder
Asterisk Users 1 Comment

Hello List,

Good day. I’m trying to create a message recorder. User will be prompted
with some soundfile (instructions on how to use recorder * to restart and #
to submit).

*Requirement:* Two copies of the recorded message are required.
[Recorder-A] One will contain only the last message recorded(final)
[Recorder-B] second one will record all the previous retries of the

Once the instruction file is played sound recording will start.

Meanwhile recording if user press * Instruction file is played again and
message recording: continues for Recorder-B and restarted for Recorder-A.

If user presses # meanwhile recording..Save both files and continue to next

I’ve done sort of combination with Record() application, Mixmonitor, Monitor
etc but nothing successful so far !

Please help.


– Sammy

One thought on - Message recorder

  • Hey Steve,

    I very much appreciate your reply, I created that dialplan the same day but
    after 8~10 hours of working. Yes, I use combination of MixMonitor and
    I’ll share my logical dialplan here.

    It works like: MixMonitor() is used with option a (append) to record all
    user recordings in one file. Monitor is only for most recent recording,
    overwrites on each retry. This had to be Gosub for user to press * or #. On
    * I jump back to Mixmonitor and monitor and wait for user input at
    Waitexten(300,m(silence)). on # just concatenate the required Audio with
    previously required audio file.

    its something like this (psuedo-code)

    exten => s,1,NOOP(I’m trying to record your voice – Previously recorded
    final messages are in file ${GOODAUDIO})
    same => n,SET(ALLAUDIO=bigfilename)
    same => n,SET(THISAUDIO=small-file)
    same => n(rerecord),Mixmonitor(${ALLAUDIO},a)
    same => n,Monitor(${THISAUDIO})
    same => n,Waitexten(300,m(silence))

    exten => i,1,GOTO(*,1)
    exten => t,1,GOTO(*,1)

    exten => *,1,GOTO(s,rerecord) ; user wants to retry recording message

    exten => #,1,StopMonitor() ; user thinks his message is god enough and
    save message now
    same => n,StopMixmonitor()
    same => n,System(sox ${THISAUDIO} ${GOODAUDIO} ${GOODAUDIO}) ;This will
    concatenate this required recording to previously recorded good responses.
    same => n,Return()

    P.S: Macros are useless ! Use Gosub instead. Calling a Gosub inside a macro
    (just to get user DTMF) clears macro stack and leaves you look like

    – Sammy