The steps to capture audio from the PBX will differ depending on which software is being used. The steps outlined here will deal with Asterisk and Freeswitch, though most PBXs will have some method by which this can be accomplished and could likely be found in the documentation for the software.
Asterisk - dahdi_monitor recording
Before capturing a dahdi recording, it is necessary to know which channel Asterisk is using for the call in question. If you have no calls active on the system and you have configured Asterisk to allocate channels sequentially from low to high, then channel 1 is a good guess, however you may not have control over which channels the provider sends inbound calls on. You can find the channel for an active call by accessing the Asterisk CLI (shell command: asterisk -r ) and then giving the command 'core show channels'. This will list channels for active calls, but it's might not be useful to capture audio from an already established call if you are having problems with DTMF dialing. The best way to guarantee the channel you are using is to use the originate command to place a call from the Asterisk command line. Take the following steps:
Recording an incoming call using this technique is a little more tricky, since you have to guess the channel. If it's not critical to capture the first few seconds of the call, you can wait until it is established before find the channel in Asterisk and run the dahdi_monitor command on that channel as described above.
Freeswitch - ftdm trace recording
- Access the Freeswitch CLI (<freeswitch install path>/bin/fs_cli)
Give this command to enable call recording, taking care to fill in the correct parameters based on which channel and span the test call will be on:
-> ftdm trace <path> <span_id> <chan_id>
Note: The <path> parameter includes both the path for output recordings and the prefix for naming the files. Eg. /root/test will output files named test-in-s1c1 and test-out-s1c1 in /root for example.
You can disable tracing when finished with this command:
-> ftdm notrace <span_id> <chan_id>