diff mgw/crcx.c @ 99:738be11ac432

mgw internal code: simplify MDCX error handling
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2022 13:42:46 -0800
parents 020ba624bdd8
children f062c32a5116
line wrap: on
line diff
--- a/mgw/crcx.c	Sun Sep 25 20:28:54 2022 -0800
+++ b/mgw/crcx.c	Mon Sep 26 13:42:46 2022 -0800
@@ -143,13 +143,14 @@
 			return;
 		}
 	}
-	rc = mdcx_operation(ep, req, resp);
-	if (rc < 0) {
+	rc = mdcx_operation(ep, req);
+	if (rc != TMGW_RESP_OK) {
 		if (ep->ep_type & TMGW_EP_HAS_GSM_SOCK)
 			free_rtp_end(&ep->rtp_gsm);
 		if (ep->ep_type & TMGW_EP_HAS_PSTN_SOCK)
 			free_rtp_end(&ep->rtp_pstn);
 		free(ep);
+		resp->res = rc;
 		return;
 	}
 	/* all good - accept the new endpoint and return OK */