From 4cf88b8ce86534219e8f77a3eb551495cb1e0d11 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 1 Feb 2024 19:03:42 +0100 Subject: [PATCH] Fix DTMF detection from called end Now DTMF detection called end. Imagine Paypal calls you and asks you to enter digits. The routing script can then enable dtmf detection on the called end (after answer) and forward digits via telephone events. --- src/router/audio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/router/audio.c b/src/router/audio.c index ce9c124..6aa32c9 100644 --- a/src/router/audio.c +++ b/src/router/audio.c @@ -73,7 +73,11 @@ * | |buffer |<-clock * | +-------+ * | /|\ - * | | + * | | +------+ + * | | \| | + * | |---| DTMF | + * | | /| | + * | | +------+ * \|/ | * +-------+ +-------+ * |samples| |int to | @@ -203,6 +207,10 @@ void receive_terminator(struct osmo_cc_session_codec *codec, uint8_t __attribute /* convert int16 to samples */ int16_to_samples_speech(samples, (int16_t *)data, len); + /* dtmf decoding */ + if (relation->dtmf_dec_enable) + dtmf_decode(&relation->dtmf_dec, samples, len); + /* store to terminator jitter buffer */ jitter_save(&call->term_dejitter, samples, len, 1, sequence, timestamp, ssrc); }