From 35331fcb48e51aff9ba480773cc7bee18449128d Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sun, 14 Oct 2018 05:11:51 -0700 Subject: [PATCH] Play notincache after user's transmission --- QnetGateway.cpp | 21 ++++++++++++++------- QnetGateway.h | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/QnetGateway.cpp b/QnetGateway.cpp index d8e90f6..40bd27a 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -1714,12 +1714,8 @@ void CQnetGateway::Process() } } else - { // Not in cache, please try again! - FILE *fp = fopen(qnvoicefile.c_str(), "w"); - if (fp) { - fprintf(fp, "%c_notincache.dat_NOT_IN_CACHE\n", rptrbuf.vpkt.hdr.r1[7]); - fclose(fp); - } + { + playNotInCache = true; // we need to wait until user's transmission is over } } } @@ -1929,6 +1925,16 @@ void CQnetGateway::Process() // send the "key off" message, this will end up in the openquad.net Last Heard webpage. ii->sendHeardWithTXStats(band_txt[i].lh_mycall, band_txt[i].lh_sfx, band_txt[i].lh_yrcall, band_txt[i].lh_rpt1, band_txt[i].lh_rpt2, band_txt[i].flags[0], band_txt[i].flags[1], band_txt[i].flags[2], band_txt[i].num_dv_frames, band_txt[i].num_dv_silent_frames, band_txt[i].num_bit_errors); + if (playNotInCache) { + // Not in cache, please try again! + FILE *fp = fopen(qnvoicefile.c_str(), "w"); + if (fp) { + fprintf(fp, "%c_notincache.dat_NOT_IN_CACHE\n", band_txt[i].lh_rpt1[7]); + fclose(fp); + } + playNotInCache = false; + } + band_txt[i].streamID = 0; band_txt[i].flags[0] = band_txt[i].flags[1] = band_txt[i].flags[2] = 0; band_txt[i].lh_mycall[0] = '\0'; @@ -1947,7 +1953,6 @@ void CQnetGateway::Process() band_txt[i].num_dv_frames = 0; band_txt[i].num_dv_silent_frames = 0; band_txt[i].num_bit_errors = 0; - } else { // not the end of the voice stream @@ -2557,6 +2562,8 @@ int CQnetGateway::Init(char *cfgfile) return 1; } + playNotInCache = false; + /* build the repeater callsigns for aprs */ rptr.mod[0].call = OWNER; for (i=OWNER.length(); i; i--) diff --git a/QnetGateway.h b/QnetGateway.h index 15e6dd6..7cf66bc 100644 --- a/QnetGateway.h +++ b/QnetGateway.h @@ -89,7 +89,7 @@ private: std::string OWNER, owner, local_irc_ip, status_file, dtmf_dir, dtmf_file, echotest_dir, irc_pass, qnvoicefile; - bool bool_send_qrgs, bool_irc_debug, bool_dtmf_debug, bool_regen_header, bool_qso_details, bool_send_aprs; + bool bool_send_qrgs, bool_irc_debug, bool_dtmf_debug, bool_regen_header, bool_qso_details, bool_send_aprs, playNotInCache; int play_wait, play_delay, echotest_rec_timeout, voicemail_rec_timeout, from_remote_g2_timeout, from_local_rptr_timeout, dtmf_digit;