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); PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Send digit \'%c\' from dial string\n", tone);
} else { } else {
/* SF pulse */ /* 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) { 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]); 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; goto next_digit;
} }
/* pulse on */ /* pulse on */
@ -295,6 +296,7 @@ next_digit:
if (++dsp->pulse_count == dsp->pulse_num) { if (++dsp->pulse_count == dsp->pulse_num) {
dsp->pulse_count = 0; dsp->pulse_count = 0;
dsp->digit_on = 0; dsp->digit_on = 0;
dsp->dial_index++;
duration = dsp->pulse_pause; duration = dsp->pulse_pause;
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Send pause after pulsing digits from dial string\n"); 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); link_reset(r1);
break; break;
case R1_STATE_RECV_PULSE_OFF: case R1_STATE_RECV_PULSE_OFF:
PDEBUG_CHAN(DR1, DEBUG_INFO, "Received complete pulse sequence, storing digit %c.\n", r1->pulse_counter);
/* start timer */ /* start timer */
timer_start(&r1->timer, TO_DIALING); timer_start(&r1->timer, TO_DIALING);
/* add digit */ /* add digit */
@ -619,6 +618,7 @@ static void r1_timeout(void *data)
else else
r1->dialing[i++] = '?'; r1->dialing[i++] = '?';
r1->dialing[i] = '\0'; 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) */ /* change state (after adding digit) */
r1_new_state(r1, R1_STATE_RECV_PULSE_WAIT); r1_new_state(r1, R1_STATE_RECV_PULSE_WAIT);
break; break;