How to change call one touch recording filenames

Spin off of

I have been using a custom [sub-record-check] that I placed in:
etc/asterisk/extensions_override_freepbx.conf but when we were required to switch to on demand recording (*1) instead of every call, the customization disappeared.

I found that *1 uses /var/lib/asterisk/bin/one_touch_record.php and the the filename variables are set there.

I tried to add the variable for CID name right after CID Number

$realCallerIdNum = getVariable($channel, "REALCALLERIDNUM");

// CID NAME added by miahac
$cidName = getVariable($channel, "CALLERID(name)");

and on the line wher ethe callFileName is set

$callFileName = "ondemand-$dst-$fromExten-$cidName-$timestr-$uniqueid";

But this just gave me a –

Am I on the right path at all?

Any suggestions would be great. Not a PHP pro and do not know where the all caps VARIABLES are loaded from in /one_touch_record.php so I was trying to use the channel variable syntax from asterisk to and define the php variable.

CALLERID(name) could contain spaces or other nasty things. You should probably filter it out to A-Za-z0-9 so it fits cleanly in that string every time. Although I’m not sure if you can even access CALLERID(name) like that – it might be on the master channel, not sure.

Did you look into setting the CALLFILENAME variable from dial plan earlier in the call flow ? It might be easier to change that in /etc/asterisk/extensions_custom.conf vs. editing PHP that can change out whenever you update the FreePBX modules.

PenguinPBX

Yes I am setting the CALLFILENAME in the extensions_override_freepbx.conf and that works properly for calls that are recorded by other means than *1

This PBX is proxying another PBX for call routing and recording and that PBX puts the agents extension in cname and only there so I have no other choice of where to procure the data.

Once I have the field showing up I will do some string filter but being an amateur at PHP I do not want to troubleshoot more than one function at a time.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.