From d45259a38b22c8bbac35dfac6c7f8ad8d6808967 Mon Sep 17 00:00:00 2001 From: MayamaTakeshi Date: Sun, 1 Jan 2023 20:36:06 +0900 Subject: [PATCH 1/2] Adjusted function calls in UniMRCP-wrapper.cpp --- UniMRCP-wrapper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/UniMRCP-wrapper.cpp b/UniMRCP-wrapper.cpp index 373353a..0fa1a94 100644 --- a/UniMRCP-wrapper.cpp +++ b/UniMRCP-wrapper.cpp @@ -659,6 +659,7 @@ bool UniMRCPStreamRx::ReadFrame() return false; } +#define DTMF_FRAME_DURATION 50 bool UniMRCPStreamRx::OnOpenInternal(UniMRCPAudioTermination const* term, mpf_audio_stream_t const* stm) { @@ -666,7 +667,7 @@ bool UniMRCPStreamRx::OnOpenInternal(UniMRCPAudioTermination const* term, mpf_au dtmf_gen = mpf_dtmf_generator_create_ex(stm, term->dg_band ? static_cast(term->dg_band) : (stm->rx_event_descriptor ? MPF_DTMF_GENERATOR_OUTBAND : MPF_DTMF_GENERATOR_INBAND), - term->dg_tone, term->dg_silence, mrcp_application_session_pool_get(term->sess)); + term->dg_tone, term->dg_silence, DTMF_FRAME_DURATION, mrcp_application_session_pool_get(term->sess)); if (!dtmf_gen) { apt_log(APT_LOG_MARK, APT_PRIO_WARNING, "%s StreamOpenRx: Failed to create DTMF generator", swig_target_platform); @@ -1228,7 +1229,7 @@ apt_bool_t UniMRCPAudioTermination::StmOpenRx(mpf_audio_stream_t* stream, mpf_co UniMRCPStreamRx* sr; if (d) sr = t->OnStreamOpenRx(d->enabled == TRUE, d->payload_type, d->name.buf, - d->format.buf, d->channel_count, d->sampling_rate); + NULL, d->channel_count, d->sampling_rate); else sr = t->OnStreamOpenRx(false, 0, NULL, NULL, 0, 0); apt_log(APT_LOG_MARK, APT_PRIO_DEBUG, "%s StreamOpenRx: return %pp", @@ -1297,7 +1298,7 @@ apt_bool_t UniMRCPAudioTermination::StmOpenTx(mpf_audio_stream_t* stream, mpf_co UniMRCPStreamTx* st; if (d) st = t->OnStreamOpenTx(d->enabled == TRUE, d->payload_type, d->name.buf, - d->format.buf, d->channel_count, d->sampling_rate); + NULL, d->channel_count, d->sampling_rate); else st = t->OnStreamOpenTx(false, 0, NULL, NULL, 0, 0); apt_log(APT_LOG_MARK, APT_PRIO_DEBUG, "%s StreamOpenTx: return %pp", From a1f15912b43a043edbed25881dc8ee450e9a436c Mon Sep 17 00:00:00 2001 From: MayamaTakeshi Date: Sat, 28 Jan 2023 09:51:19 +0900 Subject: [PATCH 2/2] Added check for UNI_VERSION_AT_LEAST(1,8,0) to retain backward compatibility --- UniMRCP-wrapper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UniMRCP-wrapper.cpp b/UniMRCP-wrapper.cpp index 0fa1a94..b27d8e2 100644 --- a/UniMRCP-wrapper.cpp +++ b/UniMRCP-wrapper.cpp @@ -667,7 +667,11 @@ bool UniMRCPStreamRx::OnOpenInternal(UniMRCPAudioTermination const* term, mpf_au dtmf_gen = mpf_dtmf_generator_create_ex(stm, term->dg_band ? static_cast(term->dg_band) : (stm->rx_event_descriptor ? MPF_DTMF_GENERATOR_OUTBAND : MPF_DTMF_GENERATOR_INBAND), +#if UNI_VERSION_AT_LEAST(1,8,0) term->dg_tone, term->dg_silence, DTMF_FRAME_DURATION, mrcp_application_session_pool_get(term->sess)); +#else + term->dg_tone, term->dg_silence, mrcp_application_session_pool_get(term->sess)); +#endif if (!dtmf_gen) { apt_log(APT_LOG_MARK, APT_PRIO_WARNING, "%s StreamOpenRx: Failed to create DTMF generator", swig_target_platform); @@ -1229,7 +1233,11 @@ apt_bool_t UniMRCPAudioTermination::StmOpenRx(mpf_audio_stream_t* stream, mpf_co UniMRCPStreamRx* sr; if (d) sr = t->OnStreamOpenRx(d->enabled == TRUE, d->payload_type, d->name.buf, +#if UNI_VERSION_AT_LEAST(1,8,0) NULL, d->channel_count, d->sampling_rate); +#else + d->format.buf, d->channel_count, d->sampling_rate); +#endif else sr = t->OnStreamOpenRx(false, 0, NULL, NULL, 0, 0); apt_log(APT_LOG_MARK, APT_PRIO_DEBUG, "%s StreamOpenRx: return %pp", @@ -1298,7 +1306,11 @@ apt_bool_t UniMRCPAudioTermination::StmOpenTx(mpf_audio_stream_t* stream, mpf_co UniMRCPStreamTx* st; if (d) st = t->OnStreamOpenTx(d->enabled == TRUE, d->payload_type, d->name.buf, +#if UNI_VERSION_AT_LEAST(1,8,0) NULL, d->channel_count, d->sampling_rate); +#else + d->format.buf, d->channel_count, d->sampling_rate); +#endif else st = t->OnStreamOpenTx(false, 0, NULL, NULL, 0, 0); apt_log(APT_LOG_MARK, APT_PRIO_DEBUG, "%s StreamOpenTx: return %pp",