changeset 8:eaf0e8f81a22

test-fsk: don't feed RTP to modem Rx during ringing
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 06 Mar 2024 21:33:49 -0800
parents 6d832abad660
children ff535725e01f
files test-fsk/rtp_rx.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test-fsk/rtp_rx.c	Tue Mar 05 10:57:45 2024 -0800
+++ b/test-fsk/rtp_rx.c	Wed Mar 06 21:33:49 2024 -0800
@@ -20,6 +20,8 @@
 extern const uint16_t pcmu_decode_table[256];
 extern const uint16_t pcma_decode_table[256];
 
+extern int rtp_out_enable;	/* misusing the flag :-( */
+
 struct sockaddr_in rtp_local_addr;
 int rtp_udp_fd, rtcp_udp_fd;
 
@@ -124,6 +126,10 @@
 			rtp_last_seq, rtp_last_ts);
 		rtp_start_flag = 1;
 	}
+	/* ignore early RTP during ringing, before answer supervision */
+	if (!rtp_out_enable)
+		return;
+	/* feed samples to modem Rx */
 	for (n = 0; n < FRAME_20MS; n++)
 		pcm_samples[n] = pcm_dec_table[pkt.payload[n]];
 	process_rx_frame(pcm_samples);