Can't record calls directed to a virtual extension or misc application?

I’m following Shaun Ewing’s guide to installing the “Lenny” application

(I’m using FreePBX 14.0.13.23 on a fully-updated RasPBX 04-04-2018 image running on a Pi 2B. I deliberately wanted to use the latest FreePBX 14 as I’m expecting to use the John Fawcett’s Dynamic Routing module and that doesn’t seem to have a version for FreePBX 15 yet.)

Lenny is working perfectly fine, from the callers point of view. I get to listen to Lenny, he detects my silences or chatter just fine.

But having set up call recording on all incoming calls, I’m unable to discover why calls to Lenny end up as 44 byte .wav files, whereas calls between extensions or from trunks that don’t reach his dulcet tones are recorded normally? (Clearly half the point of Lenny is recording the chaos wrought by him!)

Shaun’s instructions had me create a virtual extension as the destination for the calls, and set recording preferences on that extension. This approach generated some errors in the asterisk log:

...
[2019-12-27 22:04:31] VERBOSE[4501][C-0000000e] pbx.c: Executing [[email protected]:16] NoOp("SIP/8888-00000015", "Starting recording: internal, 6666") in new stack
[2019-12-27 22:04:31] VERBOSE[4501][C-0000000e] pbx.c: Executing [[email protected]:17] Set("SIP/8888-00000015", "__CALLFILENAME=internal-6666-8888-20191227-220431-1577484271.21") in new stack
...
[2019-12-27 22:04:31] WARNING[4501][C-0000000e] channel.c: No channel type registered for 'VIRTUAL'
[2019-12-27 22:04:31] WARNING[4501][C-0000000e] app_dial.c: Unable to create channel of type 'VIRTUAL' (cause 66 - Channel not implemented)
[2019-12-27 22:04:31] VERBOSE[4501][C-0000000e] app_dial.c: Everyone is busy/congested at this time (1:0/0/1)
...

…and the recording file was a truncated 44 byte stub:

[email protected]:/var/spool/asterisk/monitor/2019/12/27# ls -l /var/spool/asterisk/monitor/*/*/*/*1577484271.21*
-rw-r--r-- 1 asterisk asterisk     44 Dec 27 22:04 internal-6666-8888-20191227-220431-1577484271.21.wav

I then tried his other approach and included the MixMonitor application in the Lenny dial plan itself, which made no detectable difference to the outcome:

[Lenny]
exten => talk,1,Set(i=${IF($["0${i}"="016"]?7:$[0${i}+1])})
same => n,ExecIf($[${i}=1]?MixMonitor(${UNIQUEID}.wav))
same => n,Playback(Lenny/Lenny${i})
same => n,BackgroundDetect(Lenny/backgroundnoise,1500)

Next I tried @lgaetz advice in this post, and instead created a Misc. Application to point to the Custom Destination.

Here are the logs from another successful call to Lenny, with no errors:

[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:1] NoOp("SIP/8888-00000017", "Running miscapp 1: Its Lenny") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:2] Macro("SIP/8888-00000017", "user-callerid,") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:1] Set("SIP/8888-00000017", "TOUCH_MONITOR=1577485200.23") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:2] Set("SIP/8888-00000017", "AMPUSER=8888") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:3] GotoIf("SIP/8888-00000017", "0?report") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:4] ExecIf("SIP/8888-00000017", "1?Set(REALCALLERIDNUM=8888)") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:5] Set("SIP/8888-00000017", "AMPUSER=8888") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:6] GotoIf("SIP/8888-00000017", "0?limit") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:7] Set("SIP/8888-00000017", "AMPUSERCIDNAME=RasPBX Test") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:8] ExecIf("SIP/8888-00000017", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:9] GotoIf("SIP/8888-00000017", "0?report") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:10] Set("SIP/8888-00000017", "AMPUSERCID=8888") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:11] Set("SIP/8888-00000017", "__DIAL_OPTIONS=Ttr") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:12] Set("SIP/8888-00000017", "CALLERID(all)="RasPBX Test" <8888>") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:13] ExecIf("SIP/8888-00000017", "0?Set(CALLERID(all)=)") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:14] GotoIf("SIP/8888-00000017", "0?limit") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:15] ExecIf("SIP/8888-00000017", "0?Set(GROUP(concurrency_limit)=8888)") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:16] NoOp("SIP/8888-00000017", "Macro Depth is 1") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:17] GotoIf("SIP/8888-00000017", "1?report2:macroerror") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx_builtins.c: Goto (macro-user-callerid,s,18)
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:18] GotoIf("SIP/8888-00000017", "0?continue") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:19] Set("SIP/8888-00000017", "__TTL=64") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:20] GotoIf("SIP/8888-00000017", "1?continue") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx_builtins.c: Goto (macro-user-callerid,s,36)
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:36] Set("SIP/8888-00000017", "CALLERID(number)=8888") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:37] Set("SIP/8888-00000017", "CALLERID(name)=RasPBX Test") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:38] GotoIf("SIP/8888-00000017", "0?cnum") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:39] Set("SIP/8888-00000017", "CDR(cnam)=RasPBX Test") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:40] Set("SIP/8888-00000017", "CDR(cnum)=8888") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:41] Set("SIP/8888-00000017", "CHANNEL(language)=en_GB") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:3] Goto("SIP/8888-00000017", "Lenny,talk,1") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx_builtins.c: Goto (Lenny,talk,1)
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:1] Set("SIP/8888-00000017", "i=1") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:2] ExecIf("SIP/8888-00000017", "1?MixMonitor(1577485200.23.wav)") in new stack
[2019-12-27 22:20:00] VERBOSE[5344][C-00000010] app_mixmonitor.c: Begin MixMonitor Recording SIP/8888-00000017
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:3] Playback("SIP/8888-00000017", "Lenny/Lenny1") in new stack
[2019-12-27 22:20:00] VERBOSE[5343][C-00000010] file.c: <SIP/8888-00000017> Playing 'Lenny/Lenny1.ulaw' (language 'en_GB')
[2019-12-27 22:20:05] VERBOSE[5343][C-00000010] pbx.c: Executing [[email protected]:4] BackgroundDetect("SIP/8888-00000017", "Lenny/backgroundnoise,1500") in new stack
[2019-12-27 22:20:05] VERBOSE[5343][C-00000010] file.c: <SIP/8888-00000017> Playing 'Lenny/backgroundnoise.ulaw' (language 'en_GB')
[2019-12-27 22:20:11] VERBOSE[5343][C-00000010] pbx.c: Spawn extension (Lenny, talk, 4) exited non-zero on 'SIP/8888-00000017'
[2019-12-27 22:20:11] VERBOSE[5344][C-00000010] app_mixmonitor.c: MixMonitor close filestream (mixed)
[2019-12-27 22:20:11] VERBOSE[5344][C-00000010] app_mixmonitor.c: End MixMonitor Recording SIP/8888-00000017

But in this case I don’t get a recording file created at all, despite the MixMonitor entries above?

I’m puzzled and would appreciate any guidance!

My googling had indicated this “44 byte recording” issue might be related to missing / incompatible codecs or transcoders? So I updated Asterisk SIP Settings to include only alaw, gsm, g726 and ulaw (I’m in the UK, if it matters). No improvement.

This next bit may be irrelevant, please ignore if so.

When a call is in progress between extensions (that does generate a recording), the CLI shows two active legs of the call, and on one I see:

raspbx*CLI> core show channel SIP/8888-00000013 
 -- General --
           Name: SIP/8888-00000013
           Type: SIP
       UniqueID: 1577484006.19
       LinkedID: 1577484006.19
      Caller ID: 8888
 Caller ID Name: RasPBX Test
Connected Line ID: 44***redacted***
Connected Line ID Name: Maven Cottage Phones
Eff. Connected Line ID: 44***redacted***
Eff. Connected Line ID Name: Maven Cottage Phones
    DNID Digits: 44***redacted***
       Language: en_GB
          State: Up (6)
  NativeFormats: (alaw)
    WriteFormat: alaw
     ReadFormat: alaw
 WriteTranscode: No 
  ReadTranscode: No 

When I do the same with a call to Lenny, there’s only one leg to the call, and it shows:

raspbx*CLI> core show channel SIP/8888-00000010
 -- General --
           Name: SIP/8888-00000010
           Type: SIP
       UniqueID: 1577483908.16
       LinkedID: 1577483908.16
      Caller ID: 8888
 Caller ID Name: RasPBX Test
Connected Line ID: 6666
Connected Line ID Name: Its Lenny
Eff. Connected Line ID: 6666
Eff. Connected Line ID Name: Its Lenny
    DNID Digits: 6666
       Language: en_GB
          State: Up (6)
  NativeFormats: (alaw)
    WriteFormat: ulaw
     ReadFormat: slin
 WriteTranscode: Yes ([email protected])->([email protected])
  ReadTranscode: Yes ([email protected])->([email protected])

Any pointers gratefully received!
Mike Thomson

Not sure this will help but you are en_GB, thusly I would start off with (in asterisk)

file convert lennyN.ulaw lennyN.alaw
( for all the files)

.
.
Usage: file convert <file_in> <file_out>
Convert from file_in to file_out. If an absolute path
is not given, the default Asterisk sounds directory
will be used.

   Example:
       file convert tt-weasels.gsm tt-weasels.ulaw

.
.

Thanks @dicko - but your gut feeling was right, no improvement after I did the conversions.
I ran those from my shell using rasterisk and with the full path names as required, e.g.

[email protected]:~# rasterisk -x "file convert /var/lib/asterisk/sounds/Lenny/backgroundnoise.ulaw /var/lib/asterisk/sounds/Lenny/backgroundnoise.alaw"

I removed the ulaw files from the /var/lib/asterisk/sounds/Lenny/ folder just to be sure they would not be picked up.

But still I get 44 byte recordings if I go via the virtual extension (6666) and no recording at all if I route to the misc application (6667).

Most puzzling!

Lenny calls are being stored in the monitor folder (I think it’s /var/spool/asterisk/monitor/)

In FreePBX 14, by default the PBX only records calls once the channel answered, so you won’t see it in CDR. You can disable that setting in advanced settings so it will start recording all calls.

Thanks @PitzKey!

I’ve enabled the recording of unbridged calls by going into Settings / Advanced Settings and into the Call Recording section, then setting Call Record Option (“Don’t begin recording unless a call is bridged to another channel”) to the value of “No” (the default is Yes).

I now get proper recordings of the Virtual Extension calls when testing from another internal extension!

But the Misc Application / Custom Destination version doesn’t record anything, at least not on an inter-extension call. I’ll try from the trunk when I can get permission to steal the house phone line for testing!

I shall try reintroducing the explicit MixMonitor dial-plan snippet and see if that helps?

same => n,ExecIf($[${i}=1]?MixMonitor(${UNIQUEID}.wav))

Harumph. No change from adding the explicit MixMonitor line back in, so I’m still looking for a perfect solution, though this is already pretty good.

I also tried an explicit Answer() in place of the MixMonitor line, but that doesn’t help either, even though it’s being hit, there’s no sign of the checks for call recording in the trace:

[2019-12-28 17:07:05] VERBOSE[1122][C-00000022] netsock2.c: Using SIP RTP TOS bits 184
[2019-12-28 17:07:05] VERBOSE[1122][C-00000022] netsock2.c: Using SIP RTP CoS mark 5
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:1] NoOp("SIP/8888-00000029", "Running miscapp 1: Its Lenny") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:2] Macro("SIP/8888-00000029", "user-callerid,") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:1] Set("SIP/8888-00000029", "TOUCH_MONITOR=1577552825.41") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:2] Set("SIP/8888-00000029", "AMPUSER=8888") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:3] GotoIf("SIP/8888-00000029", "0?report") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:4] ExecIf("SIP/8888-00000029", "1?Set(REALCALLERIDNUM=8888)") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:5] Set("SIP/8888-00000029", "AMPUSER=8888") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:6] GotoIf("SIP/8888-00000029", "0?limit") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:7] Set("SIP/8888-00000029", "AMPUSERCIDNAME=RasPBX Test") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:8] ExecIf("SIP/8888-00000029", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:9] GotoIf("SIP/8888-00000029", "0?report") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:10] Set("SIP/8888-00000029", "AMPUSERCID=8888") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:11] Set("SIP/8888-00000029", "__DIAL_OPTIONS=Ttr") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:12] Set("SIP/8888-00000029", "CALLERID(all)="RasPBX Test" <8888>") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:13] ExecIf("SIP/8888-00000029", "0?Set(CALLERID(all)=)") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:14] GotoIf("SIP/8888-00000029", "0?limit") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:15] ExecIf("SIP/8888-00000029", "0?Set(GROUP(concurrency_limit)=8888)") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:16] NoOp("SIP/8888-00000029", "Macro Depth is 1") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:17] GotoIf("SIP/8888-00000029", "1?report2:macroerror") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx_builtins.c: Goto (macro-user-callerid,s,18)
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:18] GotoIf("SIP/8888-00000029", "0?continue") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:19] Set("SIP/8888-00000029", "__TTL=64") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:20] GotoIf("SIP/8888-00000029", "1?continue") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx_builtins.c: Goto (macro-user-callerid,s,36)
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:36] Set("SIP/8888-00000029", "CALLERID(number)=8888") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:37] Set("SIP/8888-00000029", "CALLERID(name)=RasPBX Test") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:38] GotoIf("SIP/8888-00000029", "0?cnum") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:39] Set("SIP/8888-00000029", "CDR(cnam)=RasPBX Test") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:40] Set("SIP/8888-00000029", "CDR(cnum)=8888") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:41] Set("SIP/8888-00000029", "CHANNEL(language)=en_GB") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:3] Goto("SIP/8888-00000029", "Lenny,talk,1") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx_builtins.c: Goto (Lenny,talk,1)
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:1] Set("SIP/8888-00000029", "i=1") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:2] Answer("SIP/8888-00000029", "") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:3] Playback("SIP/8888-00000029", "Lenny/Lenny1") in new stack
[2019-12-28 17:07:05] VERBOSE[7955][C-00000022] file.c: <SIP/8888-00000029> Playing 'Lenny/Lenny1.alaw' (language 'en_GB')
[2019-12-28 17:07:10] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:4] BackgroundDetect("SIP/8888-00000029", "Lenny/backgroundnoise,1500") in new stack
[2019-12-28 17:07:10] VERBOSE[7955][C-00000022] file.c: <SIP/8888-00000029> Playing 'Lenny/backgroundnoise.alaw' (language 'en_GB')
[2019-12-28 17:07:13] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:1] Set("SIP/8888-00000029", "i=2") in new stack
[2019-12-28 17:07:13] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:2] Answer("SIP/8888-00000029", "") in new stack
[2019-12-28 17:07:13] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:3] Playback("SIP/8888-00000029", "Lenny/Lenny2") in new stack
[2019-12-28 17:07:13] VERBOSE[7955][C-00000022] file.c: <SIP/8888-00000029> Playing 'Lenny/Lenny2.alaw' (language 'en_GB')
[2019-12-28 17:07:16] VERBOSE[7955][C-00000022] pbx.c: Executing [[email protected]:4] BackgroundDetect("SIP/8888-00000029", "Lenny/backgroundnoise,1500") in new stack
[2019-12-28 17:07:16] VERBOSE[7955][C-00000022] file.c: <SIP/8888-00000029> Playing 'Lenny/backgroundnoise.alaw' (language 'en_GB')

I get the same results from external PSTN calls coming in via my Obi110 trunk.
If I send the call to the virtual extension, I get a recording provided unbridged calls are enabled per @PitzKey advice. But if I send the call to the Misc Application, no recording is made.

So what’s the best way to force recordings of calls sent to a Misc Application?

Again, Lenny calls are being recorded and placed in the /monitor folder.

Sorry @PitzKey I wasn’t being clear. Per the original post, the initial recordings were only 44 bytes long, yes those were being placed in the monitor folder. See the listing:

[email protected]:/var/spool/asterisk/monitor/2019/12/27# ls -l /var/spool/asterisk/monitor/*/*/*/*1577484271.21*
-rw-r--r-- 1 asterisk asterisk     44 Dec 27 22:04 internal-6666-8888-20191227-220431-1577484271.21.wav

And now I get Lenny recordings with actual content, in that same folder, but ONLY when I’m sending the calls to the virtual extension.

-rw-r--r-- 1 asterisk asterisk 183084 Dec 28 16:53 internal-6666-8888-20191228-165323-1577552003.37.wav

What puzzles me is that when I send the calls to the Misc Application that points to the Custom Destination that points the exact same dial-plan, I don’t see any file appear in that monitor folder at all.

cd /var/spool/asterisk/monitor/
ls -l

Oh @PitzKey, you would not believe how hard I’m blushing now…

I had assumed (hah, the mother of all stuff-ups) that all of the Lenny recordings would be filed in the daily subdirectories under /var/spool/asterisk/monitor. I hadn’t realised you were pointing explicitly to the top level directory itself in your earlier reply, sorry.

I can now see that so long as I include the MixMonitor line in the dialplan for the Lenny context that recordings are now made for calls to either the virtual extension or the Misc Application, in /var/spool/asterisk/monitor, for either call type:

Call from local extension 8888 to virtual extension 6666

-rw-r--r-- 1 asterisk asterisk 157484 Dec 28 19:36 /var/spool/asterisk/monitor/1577561755.58.wav

Call from local extension 8888 to misc application 6667

-rw-r--r-- 1 asterisk asterisk 181804 Dec 28 19:36 /var/spool/asterisk/monitor/1577561789.59.wav

In the case of the virtual extension only, I also get an identical recording in the daily subdirectory:

-rw-r--r-- 1 asterisk asterisk 157484 Dec 28 19:36 /var/spool/asterisk/monitor/2019/12/28/internal-6666-8888-20191228-193555-1577561755.58.wav

(That’s what was throwing me off the scent before, not realising this is a duplicate of the file higher up the directory structure.)

When I remove the MixMonitor line in the Lenny dialplan I still get a recording when I call from 8888 to 6666 (virtual extension):

-rw-r--r-- 1 asterisk asterisk 195244 Dec 28 19:42 /var/spool/asterisk/monitor/2019/12/28/internal-6666-8888-20191228-194155-1577562115.60.wav

But a call from 8888 to 6667 (Misc. Application) creates no recording file in either location.

Armed with a more complete view I’ll see if I can make progress towards what I’d ideally prefer, e.g. no need for a virtual extension, but having the recorded files appear in the daily monitor subdirectories, tagged as per the normal recordings, e.g. with source, destination and date / time in the filenames.

I had hoped your initial hint of recording even unbridged calls would achieve that instantly, but again I’m guilty of seeing your good advice as a magic bullet to hit my goal, rather than a valued stepping stone along that path.

So I think I want to:

  • Remove the virtual extension and send all Lenny calls to the Misc Application
  • I’ve read up a bit on MixMonitor and Asterisk channel variables and how to specify the location it stores recordings into
  • Came up with a revised line of Lenny dialplan to fill out the additional information into the filename
same => n,ExecIf($[${i}=1]?MixMonitor(${STRFTIME(${EPOCH},,%Y/%m/%d)}/itslenny-${CALLERID(dnid)}-${CALLERID(num)}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}.wav)

Which results in Misc Application recordings being deposited as

-rw-r--r-- 1 asterisk asterisk 102124 Dec 28 20:35 /var/spool/asterisk/monitor/2019/12/28/itslenny-6667-8888-20191228-203459-1577565299.71.wav

Thanks for persevering against my failure to understand what you were telling me!
Cheers
Mike

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.