Asterisk 11: Can't record calls in queues

We’re having some trouble with Asterisk v11.13.1

According to this document http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/ACD_id288901.html#options_defined_queues about the only thing you need to do to record all calls that get sent to a queue is add the following two lines to a defined queue:

[defined-queue]
monitor-format=wav
monitor-type=MixMonitor

And call recordings should start showing up in /var/spool/asterisk/monitor. If you want to change the directory the recordings go, they say you should set the MONITOR_FILENAME variable in the dialplan before sending the call to the queue:

exten => 1,1,Answer()
same => n,Set(MONITOR_FILENAME="/var/spool/asterisk/monitor/incoming/${DAY}/${TIME}-${CALLERID(num)}")
same => n,Queue(defined-queue)

(This assumes that the other variables ${DAY} and ${TIME} are set too, but I wanted some clarity)

However, I see no new files in /var/spool/asterisk/monitor or /var/spool/asterisk/monitor/incoming. I also don’t see any pertinent output in the Asterisk console about what might have gone wrong. Nor does Asterisk complain about the format of the monitor-format and monitor-type directives in queues.conf when I reload that file.

It’s like everything’s set correctly, but Asterisk chooses to do nothing anyway.

We’re also using Flash Operator Panel 2, which has its own call recording feature, and handles which members belong to which queue. However, the queues themselves and their settings are defined in queues.conf, and that’s where this should technically be handled, should it not?

Any help would be appreciated. Even if it turns out to be a bug in this particular version of Asterisk.

Bump! No response in 8 days.

Have you tried updating to the current release?

I don’t even see 11.13.1 as a release, only 11.13.0 and 11.14 both which are pretty old.

In particular, it’s 11.13.1~dfsg-2+b1, which is the package version that comes with Debian Jessie, which is still the current stable release of Debian.

And yeah, it might be an “ancient” version of Asterisk, but Debian is always about the most stable version of any bit of software. I’ve personally experienced what unstable versions of Asterisk are like under load (max uptime was around 20 minutes with 1100 SIP clients), and while this one is running a more normal use case for a small office PBX, it’s still a fairly busy call centre and we’re a bit wary of riding the bleeding edge ever again.

So if this is a bug that’s been fixed in later versions of 11 or 13, that would be nice to know ahead of time, instead of experimenting with unknowns for shnicks and giggles.

Those variables doesnt exist in Asterisk, before there was a variable caleld ${DATETIME} * - Current date time in the format: DDMMYYYY-HH:MM:SS and is (Deprecated; use ${STRFTIME(${EPOCH},%d%m%Y-%H:%M:%S)})

That’s not a problem because those variables are user-defined elsewhere in the dialplan. I’ve verified that they get defined properly with STRFTIME.

If you defined the variables on the dialplan is fine, but you need to make sure those variables are accesibles as global variables, executing Noop() before the above line is good way to verify it.

same => n,Set(MONITOR_FILENAME="/var/spool/asterisk/monitor/incoming/${DAY}/${TIME}-${CALLERID(num)}")

It’s not strictly necessary, since we see the MONITOR_FILENAME variable being set on the console anyway:

[Jul 11 10:23:53] – Executing [2@ivr-lightspeed-day:6] Set(“SIP/dolphintel-00015e20”, “MONITOR_FILENAME=”/var/spool/asterisk/monitor/incoming/2016-07-11/102353-REDACTED"") in new stack
[Jul 11 10:23:53] – Executing [2@ivr-lightspeed-day:7] Queue(“SIP/dolphintel-00015e20”, “lsqueue-day”) in new stack
[Jul 11 10:23:53] – Started music on hold, class ‘default’, on SIP/dolphintel-00015e20

The file /var/spool/asterisk/monitor/incoming/2016-07-11/102353-REDACTED does not exist after the call goes through the queue.

As a test I would recommend to try adjusting your MONITOR_FILENAME to just be the desired filename and seeing if it records to that name in /var/spool/asterisk/monitor without the sub-directories.

I remember having a problem with directories not being created for my recordings at one point in time but that was back in 1.8.

That’s a good point, I also suggest just file name instead of directory

Nope. No dice. I can’t get it to create new files just using the ${TIME}-${E} filename, and yeah, ${TIME}-${E} gets expanded properly when the dialplan runs.

The strange part is that Asterisk has absolutely no trouble recording outgoing calls using the following format:

   same => n,Set(FILENAME="outgoing/${DAY}/${TIME}-${E}")
   same => n,Verbose(Filename: ${FILENAME})
   same => n,Monitor(wav,${FILENAME},m)

The Monitor() command has no trouble creating new directories that don’t exist according to ${DAY}. It seems to just be the Queue() command that fails at this.

If I could verify that later versions of Asterisk v11 execute this properly, and which version does work, I’d be able to confidently upgrade our version of Asterisk to match it.

Bump. No reply in 7 days.

What ls shows

ls -lh /var/spool/asterisk/*

# ls -lh /var/spool/asterisk/*
/var/spool/asterisk/dictate:
total 0

/var/spool/asterisk/meetme:
total 0

/var/spool/asterisk/monitor:
total 12K
drwxrwx---  5 asterisk www-data   4.0K May 18 07:40 2016
drwxrwx---  3 asterisk sambashare 4.0K Jul 11 10:32 incoming
drwxrwx--- 55 asterisk sambashare 4.0K Jul 21 07:31 outgoing

/var/spool/asterisk/outgoing:
total 0

/var/spool/asterisk/outgoing_done:
total 4.0K
-rw-r--r-- 1 root www-data 111 Apr  8 15:29 testcall.call

/var/spool/asterisk/system:
total 0

/var/spool/asterisk/tmp:
total 0

/var/spool/asterisk/voicemail:
total 4.0K
drwxr-x--- 9 asterisk www-data 4.0K Feb  2 09:45 default

So, my question now is “What version of Asterisk 11 will execute the Monitor command on an incoming queue?”

if your version works, I’d be happy to install it!

Sorry for the lame reply but did you change this in asterisk.conf

cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).

When i setup voicemail to record message and sending via mail without these changes nothing happened…

I just tried that on a lark, and no, it doesn’t help.