diff sip-manual-out/rtp_tx.c @ 202:f3164f732b84

sip-manual-out: add tfo-stop command
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Apr 2023 18:05:30 -0800
parents d3c99b41fb04
children fbfa72b114e8
line wrap: on
line diff
--- a/sip-manual-out/rtp_tx.c	Sun Apr 02 18:01:34 2023 -0800
+++ b/sip-manual-out/rtp_tx.c	Sun Apr 02 18:05:30 2023 -0800
@@ -27,6 +27,7 @@
 static uint16_t tfo_fill_buf[9], tfo_req_buf[7];
 static uint16_t *is_out_ptr;
 static unsigned is_out_count;
+static int tfo_stop_req;
 
 void
 assign_rtpout_ssrc()
@@ -81,7 +82,7 @@
 	if (is_out_count) {
 		insert_is_msg(pkt.payload, *is_out_ptr++);
 		is_out_count--;
-		if (!is_out_count) {
+		if (!is_out_count && !tfo_stop_req) {
 			is_out_ptr = tfo_req_buf;
 			is_out_count = 7;
 		}
@@ -103,4 +104,11 @@
 	encode_tfo_ext_words(sig, codec, 0, tfo_req_buf + 5);
 	is_out_ptr = tfo_fill_buf;
 	is_out_count = 9;
+	tfo_stop_req = 0;
 }
+
+void
+stop_tfo_out()
+{
+	tfo_stop_req = 1;
+}