“m” option on Dial()
See asterisk/musiconhold.conf.sample at master · asterisk/asterisk · GitHub for how to configure it.
.wav is only supported if the file is mono, 8kHz, 16 bit signed linear. Don’t use .WAV, as the GSM codec and music don’t mix. The general case of .wav is not supported.
If you are using expensive codecs, store the file in the format the codec uses.
I can’t remember if m forces the call to be answered. Unless you are permitted early media for long enough for the agent to answer, you may have to explicitly answer first. Doing so is likely to result in the caller being billed for listening to the music, but should stop network timeouts on unanswered calls.