I always get what seems the most head-scratching configurations to do on Asterisk.
Company has an asterisk server connected direct to SIP trunks and all work fine. Been asked to introduce call recording to inbound and outbound calls automatically after them trialling the automixmon (*3) command.
Their requirements are simple, only the MD and sales manager will have access to the calls, everything's internal so just getting dumped into the /var/spool/asterisk/monitor folder and a web server with authentication allows them to view the folder - when they're happy we'll clean this bit up.
I've got the outbound calls doing what we want with this (we use AEL) so the following snippet is triggered on dialling out from any extension.
_9. => {
Monitor(wav,${STRFTIME(${EPOCH},,%Y%m%d-%H:%M:%S)}-OUT-${CALLERID(num)}-${EXTEN:${ABSORB}},m);
Dial(SIP/${EXTEN:${ABSORB}}@MAINTRUNK,90,X);
};
ABSORB is a global variable which is mostly just set to 1 so that the 9 is not passed to the Dial() application.
The inbound calls are a bit trickier as the incoming calls go through this:
Dial(SIP/2000&SIP/2001&SIP/2002&SIP/2003&SIP/2004&SIP/2005,35,Tt);
So for now i've just set it up like this:
Monitor(wav,${STRFTIME(${EPOCH},,%Y%m%d-%H:%M:%S)}-IN-${CALLERID(num)},m);
Dial(SIP/2000&SIP/2001&SIP/2002&SIP/2003&SIP/2004&SIP/2005,35,Tt);
Which at least gets a file with a date/time the "IN" state and the incoming caller ID.
What the MD wants is that the file gets tagged with the extension that actually answered the call.
Is there any way to say put a placeholder in the filename like 'XXXX' and then use MONITOR_EXEC to get to a shell and rename the file after the call hangs up by replacing the XXXX with the last connected channel?
I realise it won't take transferred calls into account.
I can't see a way to determine the active extension for the call as I have to enable monitoring just before the dial command.
any suggestions?