You can’t do it on the front end. At the time that you create the file name and enable the mixmonitor, the call hasnt been answered by an agent.
You can use the h event to rename the file after the call is completed.
I opted to just write the recording out under the unique id and then after the call is completed, I write out a text file which is save under the uniqueid but contains the queue, agent, time etc.
I also enabled the monitoring in my queue.conf file rather than the dial plan. Below is the Macro that I send my queue calls to. Also, to get the memberinterface be sure to put setinterfacevar=yes in the queue.conf.