Recording Calls Voice

I’m really new to this. I just installed Fedora 14 and Asterisk 1.8 and I’m able to make calls, so that works.
I have a legal request to record all calls incoming/outgoing to .wav files and I’m not sure whether to use record, monitor or mixmonitor. We need to have the recording start for every call without user intervention, beeping is fine. Ideally, we would like to specify only certain extensions but if that’s not possible, we can live with it. I have searched through here and found some useful hints but nothing concrete. I was able to get record to work (if the other extension does not pick up)… also, we are using cisco IP 7960 phones
All help is greatly appreciated…

Well, I’ve gotten a bit further, I have a Macro which records the voice calls with no issues. Now the issue I have is going to voicemail:

here is the Macro:

[macro-automon]
exten => s,1,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLERID(num)})
exten => s,2,Playback(beep) ; optional - hear when recording starts
exten => s,3,MixMonitor(${MONITOR_FILENAME}.wav49,b)

here is the dialplan:
exten => 142,1,Noop(Dialing 142);
exten => 142,n,Macro(automon) ; start monitor
exten => 142,n,Dial(SIP/142,30) ; 30 secs
exten => 142,n,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => 142-NOANSWER,1,Voicemail(20,us) ; If unavailable, send to voicemail w/ unavail announce
exten => 142-NOANSWER,n,Playback(vm-goodbye)
exten => 142-NOANSWER,n,Hangup
exten => 142-BUSY,1,Voicemail(${MACRO_EXTEN},bs) ; If busy, send to voicemail w/ busy announce
exten => 142-BUSY,n,Playback(vm-goodbye)
exten => 142-BUSY,n,Hangup
exten => _142-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

exten => 142,1,Noop(Outbound call to: ${EXTEN})
exten => 142,2,Macro(automon) ; start monitor
exten => 142,3,Dial(SIP/lesnet_peer/1${EXTEN})

and here is the error:

– Nobody picked up in 30000 ms
– Executing [142@default:4] Goto(“SIP/141-00000120”, “s-NOANSWER,1”) in new stack
– Goto (default,s-NOANSWER,1)
– Sent into invalid extension ‘s-NOANSWER’ in context ‘default’ on SIP/141-00000120
– Executing [i@default:1] Answer(“SIP/141-00000120”, “”) in new stack
– Executing [i@default:2] Hangup(“SIP/141-00000120”, “”) in new stack

I can see that the extension is being set wronh at some point buy where and why I’m not sure…
If anyone has any Ideas, it would be greatly appreciated
Thanks

Your goto in that dialplan says

exten => 142,n,Goto(s-${DIALSTATUS},1) ; Jump based on status 

See where you’ve got (s-${DIALSTATUS}) that means it’s looking for the s extension with the dialstatus. You don’t have that.

Try

exten => 142,n,Goto(142-${DIALSTATUS},1) ; Jump based on status 

Wow, that worked great. I appreciate the response. I did note another issue. There seems to be a delay using mixmonitor, it seems the calls are mixed when recording is complete and/or the recording starts before the recipient answers the phone? Any Ideas how the timing is done?? Thanks again

Howdy,

Are you cat’ing the file to /dev/dsp and seeing that it’s only mixing one side of the conversation in realtime? MixMonitor should be outputting both to a unified location.

Actually, I see nothing under /dev/dsp (even when recording) but when I play back the wav file there is clearly a delay. The one thing we also noted is that when calling the extension that’s recording, the caller phone indicates connected before the recording extension has even picked up, I believe that’s the real issue…mixmonitor seems to start immediately before the extension even picks up… I appreciate all the help so far…

Ostensibly, the b flag should prevent that, but the invocation of MixMonitor occurs in your dialplan before the Dial is executed to the second leg of the call.

How much delay are we talking about?

Thanks, I seem to notice it when the system uses IAX2 (calls from outside), SIP seems to work fine (does this make sense?). The delay adds up to 10 seconds after 60 seconds of recording. I appreciate your help…

That sounds like a timing problem.

What have you got that matches res_timing* in /usr/lib/asterisk/modules?

Cheers.

Here are any modules that refer to timing:

-rwxr-xr-x. 1 root root 181014 Nov 11 10:33 app_sayunixtime.so
-rwxr-xr-x. 1 root root 455519 Nov 11 10:33 chan_unistim.so
-rwxr-xr-x. 1 root root 204068 Nov 11 10:33 func_realtime.so
-rwxr-xr-x. 1 root root 183228 Nov 11 10:33 func_timeout.so
-rwxr-xr-x. 1 root root 211174 Nov 11 10:33 pbx_realtime.so
-rwxr-xr-x. 1 root root 178769 Nov 11 10:33 res_realtime.so
-rwxr-xr-x. 1 root root 178924 Nov 11 10:33 res_timing_pthread.so
-rwxr-xr-x. 1 root root 159778 Nov 11 10:33 res_timing_timerfd.so

Let me know if I’m missing something,
Thanks

Move the pthread timing module out of that directory, and restart Asterisk. It’ll use the timerfd module in that case. See if that makes any difference.

I tried swapping both files separately and still no luck…Thanks and let me know if you can think of anything else…

Okay, so to make sure we’re on the same thing then and that I’m not confused.

You’re seeing MixMonitor recordings get out of sync w/ the two channels being recorded, using the dialplan snippet you’ve got above, using Asterisk 1.8. Running on a VM or native hardware? Which leg gets out of sync? Calling or called?

If you can track it down and provide debug, you should open an issue on

issues.asterisk.org