Skip to content

Commit

Permalink
Merge pull request #4 from MayamaTakeshi/adjustments_for_unimrcp-1.8.0
Browse files Browse the repository at this point in the history
Adjusted function calls in UniMRCP-wrapper.cpp
  • Loading branch information
achaloyan authored Jan 29, 2023
2 parents ef77813 + a1f1591 commit 6e5beca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions UniMRCP-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,19 @@ bool UniMRCPStreamRx::ReadFrame()
return false;
}

#define DTMF_FRAME_DURATION 50

bool UniMRCPStreamRx::OnOpenInternal(UniMRCPAudioTermination const* term, mpf_audio_stream_t const* stm)
{
if (term->dg_band >= 0) {
dtmf_gen = mpf_dtmf_generator_create_ex(stm,
term->dg_band ? static_cast<mpf_dtmf_generator_band_e>(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);
Expand Down Expand Up @@ -1228,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",
Expand Down Expand Up @@ -1297,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",
Expand Down

0 comments on commit 6e5beca

Please sign in to comment.