AstRecipes » Recording all outgoing traffic for some extensions
You want to record all outgoing traffic done by some extensions - not all extensions (it would be trivial) but just some of your choosing. You also want to be able to turn recordings on or off without modifying the dialplan. How to do itThe idea is simple: we use Asterisk's internal database to record a flag for each extension that tells us whether to record those calls or not. We add a check for this flag before dialling out, so we can catch all outgoing traffic. Modifying the dialplan
Whenever you are currently dialing out (we assume that any number starting with 0 is an external call) you add the following piece of dialplan:
exten => _0.,1,NoOP,Dial out with hidden CLID
exten => _0.,2,SetCallerPres(prohib)
exten => _0.,3,DBGet(rec=registra/${CALLERIDNUM})
exten => _0.,4,GotoIf($[ ${rec} = 1 ]?10:20)
exten => _0.,10,MixMonitor(REC-${CALLERIDNUM}-${UNIQUEID}.wav|b|)
exten => _0.,11,Goto(20)
exten => _0.,20,Dial(Zap/g1/${EXTEN:1})
Once your piece of dialplan is in place, you use the following command from the Asterisk CLI to tell Asterisk an extension is to be recorded:
database put registra 299 1
database put registra 299 0
ast*CLI> database show registra
/registra/223 : 1
/registra/224 : 0
/registra/299 : 1
You can find the recorded calls by issuing the following command:
[root@ast monitor]# ls -l /var/spool/asterisk/monitor/REC*
-rw-r--r-- 1 root root 186284 Aug 8 16:36 /var/spool/asterisk/monitor/REC-299-1186583777.73726.wav
-rw-r--r-- 1 root root 206764 Aug 8 16:40 /var/spool/asterisk/monitor/REC-299-1186584038.73774.wav
Softlinks:
Home Page - Installing QueueMetrics from scratch - AddQueueMember and the queue_log file - Compiling Asterisk 1.4 with TDM400 and H323 - Upgrading QueueMetrics licences - Installing Queuemetrics on Debian - Avoiding queue_log file rotation - Manually updating QueueMetrics - QueueMetrics logs - Listening to recorded calls using XC-AST - Using a HT-488 with Asterisk - Managing agents that dynamically log-on - Installing Queuemetrics on PBX-in-a-Flash - Installing QueueMetrics on Fonality PBXtra - Installing QueueMetrics using Yum - Administering QueueMetrics using Tomcat - Rebuilding Fonality queue_log - QueueMetrics - Debugging Qloaderd installation - Installing QueueMetrics
Home Page - Installing QueueMetrics from scratch - AddQueueMember and the queue_log file - Compiling Asterisk 1.4 with TDM400 and H323 - Upgrading QueueMetrics licences - Installing Queuemetrics on Debian - Avoiding queue_log file rotation - Manually updating QueueMetrics - QueueMetrics logs - Listening to recorded calls using XC-AST - Using a HT-488 with Asterisk - Managing agents that dynamically log-on - Installing Queuemetrics on PBX-in-a-Flash - Installing QueueMetrics on Fonality PBXtra - Installing QueueMetrics using Yum - Administering QueueMetrics using Tomcat - Rebuilding Fonality queue_log - QueueMetrics - Debugging Qloaderd installation - Installing QueueMetrics



