What is the best way to declare a while loop

Hi,

I have a diaplan dedicated to using the mixmonitor application, asterisk is called by something and everything it send will be recorded, to be able to work correctly, I need to send silence.

For that, I need a while loop end send the silence file in this loop, what would be the best condition to use in the while ? Is checking on the channel status a good idea ?

I don’t want my while loop to block the call to be ended.

Best regards.

Please describe what you are trying to achieve and then show us your dialplan. I have not the foggiest idea what you are trying to do.

If you play the silence file using:
BackgroundDetect(soundfiles/silenceFile)
it will wait for the person to speak.

I need to send the file from the start to the finish of the call, this is not necessary a silence file.