RTP IuUP Emulation: Avoid spamming with retransmitted Init

Until now, an Init was sent on each RTP transmit period, clogging the
pcap files. Moreover, this is break by design, since transmitting
another Init so close the the previous one would give no time to the
transmitter to receive the Init ACk and move state, which means the
other end would potentially be reconfigured each time (for each Init).

Change-Id: I8e299a3fe49f9d31cae182f7ed4dc0ea3fc22ba2
diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn
index b35602c..19c2c84 100644
--- a/library/IuUP_Emulation.ttcn
+++ b/library/IuUP_Emulation.ttcn
@@ -105,6 +105,7 @@
 		} else if (match(pdu, tr_IuUP_INIT_ACK)) {
 			if (st.cfg.active_init == true) {
 				log("IuUP INIT_ACK Received");
+				st.pending_tx_pdu := omit; /* Drop pending Init retrans */
 				st.state := ST_DATA_TRANSFER_READY;
 			} else {
 				setverdict(fail, "INIT_ACK received in PASSIVE role");
@@ -124,8 +125,12 @@
 	select (st.state) {
 		case (ST_INIT) {
 			if (st.cfg.active_init) {
-				/* send INIT */
-				pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+				if (not isvalue(st.pending_tx_pdu)) {
+					/* send INIT */
+					pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+					st.pending_tx_pdu := pdu;
+				} /* else: wait for INIT-ACK return ''O at the end */
+
 			} else {
 				/* wait for INIT */
 				if (isvalue(st.pending_tx_pdu)) {