DTMF Tone Not recorded during a call


The following is the scratch of my custom context.

exten => 101,1,Set(RECORD_FILE={file_name})
exten => 101,n,Monitor(wav,${RECORD_FILE},m)
exten => 101,n,Read(READ_NUM,{options})
exten => 101,n,SayDigits(${READ_NUM})
exten => 101,n,Hanfup()

I am using Monitor because i need the recording in two separate channels. After recording i will mix the two legs and convert this to mp3. Now for my future purpose i need to extract the DTMF tone that had pressed by the caller from the recording file. But now i cant hear any DTMF sound in my recording. How can i include The DTMF sound in recording file when using Monitor().?

In sip.conf


Please help me to solve this problem…

You will need to use dtmfmode=inband, and a simple codec, like G.711 (mulaw and alaw). You will need to configure your peers to do the same.

Asterisk will not regenerate DTMF that was received out of band, when making a recording.

Also, mp3 is a waste of disk space, as the audio quality will be determined by telephony codecs used.

1 Like

i have tried
exten => 101,n,SIPDtmfMode(inband)

But at that time DTMF was not detected properly. If i press 1 system says you are pressed 11.

You can’t change dtmfmode from just one end. This option is to deal with cases where the remote end isn’t actually using the method that was agreed at the start of the call, or you want to force the sending of in band audio tones.

Also, on further thought, Asterisk will convert even in band DTMF to out of band internally and delete the original tone from the media stream. I don’t think you can do what you want and and still have Asterisk recognize DTMF.

That is correct, there’s no way to have the DTMF injected into the recording except for purposely misconfiguring DTMF support.

1 Like