Asterisk - Call monitoring for queues

2.4k Views Asked by At

I have set up basic call monitoring for individual extensions in my Asterisk setup. This is what I have done for recording individual calls:

[macro-automon]
exten => s,1,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(num)})
        same => n,MixMonitor(${MONITOR_FILENAME}.wav,b)

[LocalSets]
exten => 101,1,noop(dialing 101)
        same => n,Macro(automon)
        same => n,Dial(${EXT_TESTONE},20,m)  ; Replace 0000FFFF0001 with your device name
        same => n,Playback(vm-nobodyavail)   ; Play "no one's available"
        same => n,Hangup()

This works and a call which is picked up by extension 101 is saved under /var/spool/asterisk/monitor

Now, I have setup a couple of test queues called sales and support, like so:

[Queues]
exten => 7001,1,Verbose(2,${CALLERID(all)} entering the support queue)
        same => n,Queue(support)
        same => n,Hangup()
exten => 7002,1,Verbose(2,${CALLERID(all)} entering the sales queue)
        same => n,Queue(sales)
        same => n,Hangup()

I have also added the user called 0000FFFF0001 under the sales queue. Thus, when I dial 7002, it rings at ext.101 and the call can be picked up. However, the call monitoring doesn't take place.

How could I enable monitoring for calls which come to 101 via the queue?

2

There are 2 best solutions below

0
On

Call queue have own monitoring flags.

However you always can do it via local channel. Instead of do queue do

  Dial(Local/s@toqueuesales/n)

and put in extensions.conf

[toqueuesales]
exten => s,1,Answer
exten => s,2,Queue(sales)

That way it have work anyway(but will show 2 channels and 2 cdrs)

0
On

You can also add local channels to the Queue instead of extensions. Technically when the queue is ringing your agent, it's ringing SIP/101 (or whatever the agent extension is). If you added Local/101@LocalSets as an agent in your queue config, the dialplan you provided would work. You'd need to tweak the default log in/out macros, but this is the easiest way to get your dialplan to work.

See the docs for a comprehensive guide to adding queue members.