From b5579d1f1645f33b6147f34bdd5d378105c501e4 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Fri, 15 Mar 2024 23:31:06 +0100 Subject: [PATCH] IMTS dialer: Calculate the parity from all pulses, not just from pulses of one digit --- src/imts/dialer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/imts/dialer.c b/src/imts/dialer.c index 6ef6692..4b6f2ba 100644 --- a/src/imts/dialer.c +++ b/src/imts/dialer.c @@ -213,7 +213,7 @@ static void process_signal(int buffer_size) int main(int argc, char *argv[]) { - int i, d, p, pulses, tone = 0; + int i, d, p, parity, pulses, tone = 0; int buffer_size; int rc, argi; @@ -267,13 +267,14 @@ int main(int argc, char *argv[]) dial_string[d].tone = TONE_CONNECT; dial_string[d++].length = 0.050 * (double)dsp_samplerate; /* seize */ dial_string[d].console = '-'; dial_string[d].tone = TONE_GUARD; dial_string[d++].length = 1.000 * (double)dsp_samplerate; /* pause */ + parity = 0; for (i = 0; station_id[i]; i++) { pulses = station_id[i] - '0'; if (pulses == 0) pulses = 10; dial_string[d].console = station_id[i]; for (p = 1; p <= pulses; p++) { - if ((p & 1) == 1) + if ((++parity & 1) == 1) tone = TONE_SILENCE; else tone = TONE_GUARD;