# HG changeset patch
# User Mychaela Falconia <falcon@freecalypso.org>
# Date 1664247058 28800
# Node ID d26d97974c8a0f867f1fcc19a883ce9e8247d307
# Parent  ca21fbf9d2eac0bf534315644a790a5782e02dda
mgw p2g init: fix bug in forwarding re-enable scenario

diff -r ca21fbf9d2ea -r d26d97974c8a mgw/pstn2gsm.c
--- a/mgw/pstn2gsm.c	Mon Sep 26 15:21:05 2022 -0800
+++ b/mgw/pstn2gsm.c	Mon Sep 26 18:50:58 2022 -0800
@@ -136,6 +136,8 @@
 pstn2gsm_init(ep)
 	struct endpoint *ep;
 {
+	if (ep->gsm_encoder_state)
+		return TMGW_RESP_OK;
 	switch (ep->gsm_payload_msg_type) {
 	case GSM_TCHF_FRAME:
 		ep->gsm_encoder_state = gsm_create();