I am a beginner Asterisk developer .
I would like to know if there is a way to play an audio file during a call started with Dial() application.
My first attempt was to use Dial() with A(x) option in this way:
Your first method, assuming the file exists in the right place, can be used to play something to just the called party, between when they answer and connecting the speech path. The second will only play the sound after the call fails.
My impression is that you are trying to achieve non-standard behaviour, and are doing something that requres well beyond newbie skill levels.
If you want to play sound continuously during the call (almost certainly annoying to both parties) you will probably have to use the whisper mechanism or create a conference. Have look at the discussion for people trying to play music after the first digit during dialing.
Also please note that the right forum for support questions is Asterisk Support.
thank you for your support and sorry for my post in the wrong section.
My goal is to test the quality of PSTN line playing an audio file from the calling party, recording it on the called party and later compare the two signals with an external software. So Iām going to use MixMonitor application (is it right??) before call start for recording, but Iām not able to play the desired audio file for line testing.
If this is not possible, can I use the Originate application in the following way?
In file /var/spool/asterisk/outgoing/SimpleCall.call:
Playing a file to the called party is fairly easy (it is often done for phone spam) and your call file should do that.
Playing a file in parallel with other activity on a call is more difficult and you should look at the DTMF postings already mentioned.
I am getting confused as to which of these you are trying to do. Your descriptiion of your test doesnāt require what I would call playing during a call, but only the first case, i.e. the dump an advert on the answering machine mode.
Note you may require quite complex comparison software. Some parts of modern phone systems, particularly mobile networks and VoIP donāt try and reproduce the original waveform, but just something recognizable as the original spoken words. For that part of the distortion comparisons are actually made with panels of human listeners, not by machines.
I just have to play my audio file at the establishment of the call, so when the called party hook off the phone. My goal is to dump an āadvertā on the answering machine mode as you said. I donāt need any DTMF tone.
You said that playing a file to the called party is fairly easy, but how can I do that? Iām rather confused.
As regards file comparison I already have a software.