aboutsummaryrefslogtreecommitdiffstats
path: root/src/anetz/anetz.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-01-02 10:13:43 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-01-02 10:13:43 +0100
commite724823c5b368971e21f6580f587ad1a7288ae7e (patch)
tree84db27f6f9e712f7a0d8462be09921def2608cb9 /src/anetz/anetz.c
parent2e7a05f8d9c4b9a8ee88d918045375ea02eb6871 (diff)
A-Netz: Reset tone detector when going idle
A pending tone must be detected as soon as the cell is idle. This happens if the phone picks up during release guard time.
Diffstat (limited to 'src/anetz/anetz.c')
-rw-r--r--src/anetz/anetz.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c
index a920929..96fe5dc 100644
--- a/src/anetz/anetz.c
+++ b/src/anetz/anetz.c
@@ -233,7 +233,8 @@ static void anetz_go_idle(anetz_t *anetz)
PDEBUG(DANETZ, DEBUG_INFO, "Entering IDLE state on channel %d, sending 2280 Hz tone.\n", anetz->sender.kanal);
anetz_new_state(anetz, ANETZ_FREI);
- anetz_set_dsp_mode(anetz, DSP_MODE_TONE);
+ /* also reset detector, so if there is a new call it is answered */
+ anetz_set_dsp_mode(anetz, DSP_MODE_TONE, 1);
anetz->station_id[0] = '\0';
}
@@ -244,7 +245,7 @@ static void anetz_release(anetz_t *anetz)
PDEBUG_CHAN(DANETZ, DEBUG_INFO, "Sending 2280 Hz release tone.\n");
anetz_new_state(anetz, ANETZ_AUSLOESEN);
- anetz_set_dsp_mode(anetz, DSP_MODE_TONE);
+ anetz_set_dsp_mode(anetz, DSP_MODE_TONE, 0);
anetz->station_id[0] = '\0';
timer_start(&anetz->timer, RELEASE_TO);
}
@@ -254,7 +255,7 @@ static void anetz_page(anetz_t *anetz, const char *dial_string, double *freq)
{
PDEBUG_CHAN(DANETZ, DEBUG_INFO, "Entering paging state, sending 'Selektivruf' to '%s'.\n", dial_string);
anetz_new_state(anetz, ANETZ_ANRUF);
- anetz_set_dsp_mode(anetz, DSP_MODE_PAGING);
+ anetz_set_dsp_mode(anetz, DSP_MODE_PAGING, 0);
dsp_set_paging(anetz, freq);
strcpy(anetz->station_id, dial_string);
timer_start(&anetz->timer, PAGING_TO);
@@ -293,7 +294,7 @@ void anetz_receive_tone(anetz_t *anetz, int tone)
if (tone == 1) {
PDEBUG_CHAN(DANETZ, DEBUG_INFO, "Received 1750 Hz calling signal from mobile station, removing idle signal.\n");
anetz_new_state(anetz, ANETZ_GESPRAECH);
- anetz_set_dsp_mode(anetz, DSP_MODE_SILENCE);
+ anetz_set_dsp_mode(anetz, DSP_MODE_SILENCE, 0);
break;
}
break;
@@ -316,7 +317,7 @@ void anetz_receive_tone(anetz_t *anetz, int tone)
PDEBUG_CHAN(DANETZ, DEBUG_INFO, "1750 Hz signal from mobile station is gone, answer call.\n");
call_in_answer(anetz->callref, anetz->station_id);
}
- anetz_set_dsp_mode(anetz, DSP_MODE_AUDIO);
+ anetz_set_dsp_mode(anetz, DSP_MODE_AUDIO, 0);
}
/* release call */
if (tone == 1) {
@@ -333,7 +334,7 @@ void anetz_receive_tone(anetz_t *anetz, int tone)
PDEBUG_CHAN(DANETZ, DEBUG_INFO, "Received 1750 Hz answer signal from mobile station, removing paging tones.\n");
timer_stop(&anetz->timer);
anetz_new_state(anetz, ANETZ_GESPRAECH);
- anetz_set_dsp_mode(anetz, DSP_MODE_SILENCE);
+ anetz_set_dsp_mode(anetz, DSP_MODE_SILENCE, 0);
break;
}
default: