Seb
Seb

Reputation: 520

How to automatically create a new wav file for each recorded calls with MixMonitor?

Intro : I am trying to record each calls but I don't want to append them to a same file or overwrite it all the time. I'd like to have a file for each call. The name of the file should be the date+time when the call was made so that it is unique. I can't figure out how to do this.

My current extension.conv :

exten => 1000,1,Answer()
exten => 1000,2,MixMonitor(${DATETIME}.wav,v(0)V(0))
exten => 1000,3,Background(/var/lib/asterisk/sounds/intro2168000)

Problem:

the file is only called ".wav".

Is there a way to make it work ?

Upvotes: 0

Views: 1071

Answers (1)

miken32
miken32

Reputation: 42727

That should work on older versions of Asterisk. The ${DATETIME} variable is deprecated and should be replaced with ${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)} on modern versions of Asterisk.

exten => 1000,1,Answer()
exten => 1000,2,MixMonitor(${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}.wav)
exten => 1000,3,Background(/var/lib/asterisk/sounds/intro2168000)

Note your v(0)V(0) wasn't doing anything so can be left off.

Upvotes: 1

Related Questions