Fix pulse dialing with R1

This commit is contained in:
Andreas Eversberg 2023-12-10 18:02:46 +01:00
parent 9c7c3470c7
commit 2346b3795a
2 changed files with 4 additions and 2 deletions

View File

@ -272,9 +272,10 @@ next_digit:
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Send digit \'%c\' from dial string\n", tone);
} else {
/* SF pulse */
dsp->pulse_num = digit_to_pulses(dsp->dial_string[dsp->dial_index++]);
dsp->pulse_num = digit_to_pulses(dsp->dial_string[dsp->dial_index]);
if (dsp->pulse_num == 0) {
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Skipping digit \'%c\' from dial string that cannot be puled\n", dsp->dial_string[dsp->dial_index]);
dsp->dial_index++;
goto next_digit;
}
/* pulse on */
@ -295,6 +296,7 @@ next_digit:
if (++dsp->pulse_count == dsp->pulse_num) {
dsp->pulse_count = 0;
dsp->digit_on = 0;
dsp->dial_index++;
duration = dsp->pulse_pause;
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Send pause after pulsing digits from dial string\n");
}

View File

@ -601,7 +601,6 @@ static void r1_timeout(void *data)
link_reset(r1);
break;
case R1_STATE_RECV_PULSE_OFF:
PDEBUG_CHAN(DR1, DEBUG_INFO, "Received complete pulse sequence, storing digit %c.\n", r1->pulse_counter);
/* start timer */
timer_start(&r1->timer, TO_DIALING);
/* add digit */
@ -619,6 +618,7 @@ static void r1_timeout(void *data)
else
r1->dialing[i++] = '?';
r1->dialing[i] = '\0';
PDEBUG_CHAN(DR1, DEBUG_INFO, "Received complete pulse sequence, storing digit %c.\n", r1->dialing[i - 1]);
/* change state (after adding digit) */
r1_new_state(r1, R1_STATE_RECV_PULSE_WAIT);
break;