How to do it
We will 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:
Deciding which extensions will be recorded
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:
While you use the following to tell Asterisk an extension is not to be recorded anymore:
If you want to know the status of your recorded extension, you type:
Any key that has value of 1 will be recorded; any other key (whether it has value 0 or does not exist) is not recorded.
Finding recorded calls
You can find the recorded calls by issuing the following command:
And you can listen to them by copying them over to any audio software.