Playing audio to both ends of a call

I am currently using asterisk and trying to play an audio file to both sides of a call after a DTMF sequence. This sequence is activated by a macro. I would like the caller to input the DTMF and have the audio be played to both sides of the caller using Playback.

exten => s,n,Playback(stopmonitor)

On Wednesday 22 May 2024 at 16:32:11, HarryJ via Asterisk Community wrote:

I am currently using asterisk and trying to play an audio file to both
sides of a call after a DTMF sequence.

Please give more details of your dialplan than just a single line:

exten => s,n,Playback(stopmonitor)

What do you mean by “This sequence is activated by a macro.”?

I would like the caller to input the DTMF and have the audio be
played to both sides of the caller using Playback.

  1. Is the same audio supposed to be played to both sides?

  2. What is supposed to happen once the audio has finished playing?

Antony.


“Remember: the S in IoT stands for Security.”

  • Jan-Piet Mens

                                                Please reply to the list;
                                                      please *don't* CC me.
    

[macro-apprecord]
exten => s,1,GotoIf($[“${XAD}” = “0” | “${XAD}” = “”]?startrec:stoprec)
exten => s,n(startrec),Playback(startmonitor)
exten => s,n,Set(XAD=1)
exten => s,n,Set(filename=${STRFTIME(,%F-H-%H-M-%M-S-%S)}-Caller-${CALLERID(num)}-Ext-${EXTEN})
exten => s,n,Monitor(wav,${filename},m)
exten => s,n,MacroExit
exten => s,n(stoprec),StopMonitor
exten => s,n,Set(XAD=0)
exten => s,n,Playback(stopmonitor)
exten => s,n,MacroExit

This is my current dialplan, there is a dynamic feature that activates the macro in features.conf: apps=> *9,self/caller,Macro,apprecord

The audio file will be the same on both sides, one to announce that the call recording has started and one saying that it has stopped. Once the audio has been played it will move on to the next stage of the dialplan / the call will continue.

I want the audio to play to both sides of the call and have tried several different solutions in both features.conf and the dialplan.

Feature codes are only run on one channel. ActivatedOn has to be self or peer.

I suspect the only way of doing this is to replace Dial by an ARI/stasis application. I’d consider whether the requirement really exists.

You really should be moving from Monitor to MixMonitor and Marco to Gosub because both Monitor and Macro are deprecated and have been removed as of v21.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.