QUESTION Call recording, MixMonitor?

Joined
May 22, 2013
Messages
301
Reaction score
44
I am trying to implement device initiated call recording.

In my extensions_custom.conf I have
Code:
; Enable recording
exten => record,1,Answer
same => next,Wait(1)
same => next,Record(${ASTSPOOLDIR}/record/${RECORD_UNIQUEID}-${RECORD_PEERNAME}-${RECORD_DIRECTION}.wav,,,akqx);
same => next,Hangup(normal_clearing)

This gives me two files, one for the inbound and one for the outbound channels. I want to have one file for the recording instead. Someone has suggested to substitute line 4 for:

Code:
same => next,MixMonitor(${ASTSPOOLDIR}/record

But this only produces two files both of 44 bytes each. Can anyone give a solution how I can phrase this instead to only get one recorded file please?
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Another Approach

I took a different approach on my system, some may not like this technique, but it works well for my system and won't fill up your system with recordings. To invoke recording, the extension just presses *1, or on the SNOMs, it's already built in to the phone.

I added automon=*1 to features_featuremap_custom.conf via config.edit - this causes the merged recordings to reside in /var/spool/asterisk/monitor. From there, I have a cron job that runs to email me the recording as an MP3 attachment then delete.

I have used this solution for a couple of years now and it works fairly well.
 

pacpac

Member
Joined
Jul 27, 2013
Messages
39
Reaction score
0
Hi Trimline2, interesting, could you give a detailed procedure of how to do this (I am not that good at this..)
 
Joined
May 22, 2013
Messages
301
Reaction score
44
That does sound good, I'm interested too.

Unfortunately it doesn't fix the problem that when I press record on my Cisco 7941's, I still get the two unmixed legs of the call in the record folder and this is down to extensions_custom.conf. Can anyone shed light on how to configure this?
 
Joined
May 22, 2013
Messages
301
Reaction score
44
If it helps, here's the output of CLI if I try MixMonitor, it hangs up straight away as soon as it's started:

Code:
    -- Executing [record@from-internal:3] MixMonitor("SIP/202-00000003", "/var/spool/asterisk/record/1411498391.0-202-in.wav,,,akqx") in new stack
    -- Executing [record@from-internal:4] Hangup("SIP/202-00000003", "normal_clearing") in new stack
  == Spawn extension (from-internal, record, 4) exited non-zero on 'SIP/202-00000003'
    -- Executing [h@from-internal:1] Hangup("SIP/202-00000003", "") in new stack
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
By default, you should not need to add anything to your extensions_custom.conf. Remove all the items you have altered and go to the extension and make sure that recordings on demand is checked, then make sure your feature code *1 is turned on for recordings.

Make a test call and record it by pressing *1. When finished, go to your CDR, you should see an icon next to that call.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
*1 works fine but I want to get device initiated recording working, so to make the record softkey work on the phone I need to have an entry there. Record creates two files for in and outbound but I want one mixed file and I'm really struggling, this is something hardly anyone seems to be working on.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
As a test, I removed automon=*1 from features_featuremap_custom.conf and recorded a test call.

1. The recording was attached to the CDR report and played fine.
2. When I looked in /var/spool/asterisk/monitor/2014/09/24, there was only one wav file there that was name out**** and played both the incoming and outgoing call. It was not segmented with an "in" and an "out" recording.

My only suggestion would be to make sure Use MixMonitor for Recordings is set to true in Advanced SIP settings.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Thanks, I think there's a problem though with how I am phrasing line 4 of my extensions_custom.conf - it does record fine using my phone's softkey if I use this but as two files. I changed the initial word Record for MixMonitor and on the CLI the call hangs up straight away.

I looked in Asterisk settings and the closest I could find is Use Automixmon for One-Touch Recording, it makes no difference being set to true or false.

Have you any hints how I can get that line right in my extensions_custom.conf? I have a feeling I am very close but my knowledge is just about exhausted on this one.

Cheers
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Just thinking more on this - do I have to install MixMonitor or is it part of Asterisk's standard installation?
 
Joined
May 22, 2013
Messages
301
Reaction score
44
I have been doing a lot of reading today and then it struck me - *1 works during a call so if I check out the CLI to see what's happening I could replicate that in my extensions_custom.conf.

So I now have:

Code:
; Enable recording
exten => record,1,Answer
same => next,System(/var/lib/asterisk/bin/one_touch_record.php)
same => next,Hangup(normal_clearing)

That throws me out with this error when I press the record softkey:

Code:
  == Using SIP RTP CoS mark 5
    -- Executing [record@from-internal:1] Answer("SIP/202-00000008", "") in new stack
    -- Executing [record@from-internal:2] System("SIP/202-00000008", "/var/lib/asterisk/bin/one_touch_record.php") in new stack
      > 0x1eab050 -- Probation passed - setting RTP source address to 192.168.0.32:22906
    -- Executing [record@from-internal:1] Answer("SIP/202-00000009", "") in new stack
    -- Executing [record@from-internal:2] System("SIP/202-00000009", "/var/lib/asterisk/bin/one_touch_record.php") in new stack
      > 0x1ec06b0 -- Probation passed - setting RTP source address to 192.168.0.32:18892
  == Setting global variable 'ONETOUCH_REC_SCRIPT_STATUS' to 'STARTED'
  == Setting global variable 'THISEXTEN' to ''
  == Setting global variable 'ONETOUCH_REC' to 'RECORDING'
  == Setting global variable 'ONETOUCH_REC' to 'RECORDING'
  == Setting global variable 'REC_STATUS' to 'RECORDING'
  == Setting global variable 'REC_STATUS' to 'RECORDING'
  == Setting global variable 'MON_FMT' to 'wav'
  == Setting global variable 'ONETOUCH_RECFILE' to '.wav'
  == Setting global variable 'ONETOUCH_RECFILE' to '.wav'
  == Setting global variable 'ONETOUCH_REC_SCRIPT_STATUS' to 'RECORDING_STARTED'
    -- Executing [record@from-internal:3] Hangup("SIP/202-00000008", "normal_clearing") in new stack
  == Spawn extension (from-internal, record, 3) exited non-zero on 'SIP/202-00000008'
    -- Executing [h@from-internal:1] Hangup("SIP/202-00000008", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/202-00000008'
  == Setting global variable 'ONETOUCH_REC_SCRIPT_STATUS' to 'STARTED'
  == Setting global variable 'THISEXTEN' to ''
  == Setting global variable 'ONETOUCH_REC' to 'PAUSED'
  == Setting global variable 'ONETOUCH_REC' to 'PAUSED'
  == Setting global variable 'REC_STATUS' to 'PAUSED'
  == Setting global variable 'REC_STATUS' to 'PAUSED'
  == Setting global variable 'THISEXTEN' to ''
  == Setting global variable 'ONETOUCH_REC_SCRIPT_STATUS' to 'RECORDING_PAUSED'
    -- Executing [record@from-internal:3] Hangup("SIP/202-00000009", "normal_clearing") in new stack
  == Spawn extension (from-internal, record, 3) exited non-zero on 'SIP/202-00000009'
    -- Executing [h@from-internal:1] Hangup("SIP/202-00000009", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/202-00000009'
      > 0x42e2b6a8 -- Probation passed - setting RTP source address to 192.168.0.32:17788
    -- Executing [h@macro-dialout-trunk:1] Macro("SIP/202-00000006", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/202-00000006", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("SIP/202-00000006", "1?Set(CDR(recordingfile)=.wav)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("SIP/202-00000006", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/202-00000006' in macro 'hangupcall'
  == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on 'SIP/202-00000006'
  == Spawn extension (macro-dialout-trunk, s, 22) exited non-zero on 'SIP/202-00000006' in macro 'dialout-trunk'
  == Spawn extension (from-internal, 910000, 5) exited non-zero on 'SIP/202-00000006'

So I think I'm on the right track to get one touch record doing this, but how do I write this into my extensions_custom.conf properly? Clearly the line I've written in isn't right.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
I am trying to implement device initiated call recording.

But this only produces two files both of 44 bytes each. Can anyone give a solution how I can phrase this instead to only get one recorded file please?

I was reviewing the code for Lenny. You may want to try something similar.

Code:
[B]exten => 3333,n,Set(RECORDING=${UNIQUEID})
exten => 3333,n,MixMonitor(/tmp/Lenny/${RECORDING}.wav)
;exten => 3333,n,NoOp(Recording will be available: /tmp/Lenny/${RECORDING}.wav)[/B]
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Thanks, I have messed about with MixMonitor but each time I try anything with it I get a hangup straight away.

I've also tried confbridge:

Code:
; Enable recording
exten => record,1,Answer()
same => next,Wait(0.5)
same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
same => next,Set(CONFBRIDGE(user,quiet)=yes)
same => next,ConfBridge(${RECORD_UNIQUEID})
same => next,Hangup(normal_clearing)

Now this *almost* works - it records both legs of the file when I press the record softkey on the handset but there's a lag of about 20ms which I gather is a standard confbridge lag reading up online. This gives me a horrible echo on the handset when recording.

What I really want is just some way I suppose of getting the softkey 'record' to dial *1 in the background (which works fine if I dial *1 and records the conversation) ideally minus the bleep *1 creates.
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
curious as to what type of phone are you using.

gary
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Hi Gary, am using Cisco 7941 with the Gareth presence patch detailed here - https://issues.asterisk.org/jira/browse/ASTERISK-13145

He has given info on recording, which works perfectly but records two channels in two files without mixing. Someone else suggests using MixMonitor but I can't get it to work from what I have tried in extensions_custom.conf. Gareth then suggests recording using a conference bridge but that introduces the same received audio from the called party twice with a 20ms delay making it effectively unusable.

There's so little info out there about recording it's surprised me, I keep trying (collectively I reckon I'm up to about 10 hours on this project so far) but no closer to resolving it.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Whilst I'm looking into this, how easy is it to set up a prefix before a call (say 732 for 'rec') and that will automatically record the call from start to finish?

Then maybe if I'm being adventurous, how could I deliver that as a voicemail to myself to easily administrate without being logged onto a computer?

(I'm still no further with the record softkey btw, any hints on how to get it using MixMonitor instead of two leg record definitely appreciated).
 

Members online

Forum statistics

Threads
25,810
Messages
167,754
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top