Macro For Recording Calls

Home » Asterisk Users » Macro For Recording Calls
Asterisk Users No Comments

Hello,

I have defined macro for recording:

[macro-record]
exten => s,1,Set(FILE=${CDR(src)}-${CDR(dst)}.wav)
same => n,MixMonitor(/tmp/${FILE},b,)
same => n,MacroExit

and use it in my dialplan as such:

exten => 1234,1,Macro(record)
…. same => n,Hangup()

it works fine, but the problem is it “records” even empty calls. ie, the wav file is 44 bytes, and contains only header.

I understand that the recording has to start before the call is answered. So it cannot know in advance whether the cal will actually

Is there a way to modify my macro, so that I don’t record empty calls?

I understand that the recording has to start before the call is answered. So it cannot know in advance whether the cal will actually be empty or not.

But anyway, is there some trick for this ?

thank you,