T
T
Talyan2020-02-20 22:15:14
Asterisk
Talyan, 2020-02-20 22:15:14

Why does music_on_hold get into the record when using the b option?

Transferred my office asterisk from extensions.conf to more advanced extensions.ael
Outputted call recording into a macro:

macro recording (calling,called) {
        if ("${RECORDING}" = "1"){
              Set(fname=${UNIQUEID}-${STRFTIME(${EPOCH},,%Y-%m-%d-%H_%M)}-${calling}-${called});
              MixMonitor(имя_файла.wav,b);
       } 

}


I call like this:
context incoming_noselect {
  s	=>	{
      &recording(${CALLERID(number)},${EXTEN});			
      Dial(SIP/provider/399999,,m(moh_abon));			
  }
}


That is, is it clear? I'm calling a macro from MixMonitor with the option " b " to write the file only when connected.

And in the end, I find that even this very waiting music is being written to the file - m (moh_abon), although the phone has not yet been picked up.

But the most remarkable thing is that if I stupidly cut MixMonitor from the macro, and paste it instead of &recording(${CALLERID(number)},${EXTEN}); , that is, I will not call the macro, but execute its contents directly in the extension, then the recording works as it should, and Music on hold is not written, and the recording starts only from the moment the handset is picked up.

Maybe I'm calling the macro in the wrong way?

I am working with AEL syntax for the first time. Before that, I did everything on extensions.conf.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Barbolin, 2020-02-21
@flapflapjack

Do you reload dialplan using ael reload?
It is better to do so, then the recording of the conversation will start after picking up the handset.
Dial(SIP/provider/399999,,U(moh_abon));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question