diff mgw/pstn2gsm.c @ 97:9aed16c30622

mgw p2g: set M bit when restarting forwarding after no-forward
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2022 20:05:02 -0800
parents f24bbfd23c9d
children 1579ec0e9fb9
line wrap: on
line diff
--- a/mgw/pstn2gsm.c	Sun Sep 25 19:32:27 2022 -0800
+++ b/mgw/pstn2gsm.c	Sun Sep 25 20:05:02 2022 -0800
@@ -109,8 +109,14 @@
 	ep->p2g_last_ts = ntohl(pkt.tstamp);
 	ep->p2g_last_seq = ntohs(pkt.seq);
 	/* actual transcoding and forwarding */
-	if (!(ep->fwd_mode & TMGW_FWD_ENABLE_PSTN2GSM))
+	if (!(ep->fwd_mode & TMGW_FWD_ENABLE_PSTN2GSM)) {
+		ep->p2g_drop_flag = 1;
 		return;
+	}
+	if (ep->p2g_drop_flag) {
+		ep->p2g_drop_flag = 0;
+		m_out = 1;
+	}
 	for (n = 0; n < SAMPLES_PER_FRAME; n++)
 		pcm_samples[n] = pcm_dec_table[pkt.payload[n]];
 	pkt.m_pt = ep->gsm_payload_type;