The audio is not recorded

The audio from the file ligacaoseragravada.alaw is played to the caller but the audio is not recorded in the file generated by MixMonitor.
Is there any way to also record the contents of the file ligacaoseragravada.alaw in the file generated by MixMonitor?

context inicioAtendimentoAtendente{
s => {
ano = ${STRFTIME(${EPOCH},%Y)};
mes = ${STRFTIME(${EPOCH},%m)};
dia = ${STRFTIME(${EPOCH},%d)};
Set(nomeArquivo=/opt/asterisk/gravacoes/${ano}/${mes}/${dia}/${FILTER(0-9,${origem})}${ano}${mes}${dia}${STRFTIME(${EPOCH},%H%M%S)}${CDR(uniqueid)}.ogg);
MixMonitor(${nomeArquivo},b);
}
}

_XXXX => {
Answer();
Queue(setor2,R,protocolo.agi,inicioAtendimentoAtendente);
}

protocolo.agi

#!/usr/bin/python
import sys
comando=‘EXEC Playback ligacaoseragravada.alaw \n’
sys.stdout.write(comando)
sys.stdout.flush()

Don’t use the b option.

However, assuming AEL doesn’t do anything strange (please provide dialplan show output, so we can see the compiled dialplan), your parameters don’t align with the correct positions for positional parameters, and, even if they did, your subroutine may well get run after the AGI script (I suspect it runs things in the same order as the parameters, but might not). This all looks over-complicated to me.

The sensible place to put the MixMonitor is in the _XXXX extension, before Queue.

Your AGI script is cutting corners. You will probably get away with it, possibly with some warning messages, probably broken pipes, but you really should read out the initial parameters, and read and check the responses to the actions.

If you don’t use option b, it records all the time that was delivered in the queue, and I don’t want that.

If you do include it, it won’t record anything unless the two parties can talk to each other.

David551 good morning, I removed option b and the mixmonitor started to also record the music on hold while the caller waits in the queue, and I don’t want that. I put the MixMonitor before Queue