mgcp_client: copy back Connection Information from MDCX ACK

This is needed in case MGW changes the local IP address (for instance
because it initlaly offered an IPv4 address, and a client submitted a
remote IPv6 address, so MGW needs then to offer a local IPv6 address for
the RTP connection to be possible).

Change-Id: Ie964412b81fe6e10914790baaea724ca5f772adc
diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c
index c68d8b3..c1fc0de 100644
--- a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c
@@ -469,14 +469,12 @@
 
 	ci->pending = false;
 
+	rtp_info = data;
+
 	switch (ci->verb) {
 	case MGCP_VERB_CRCX:
 		/* If we sent a wildcarded endpoint name on CRCX, we need to store the resulting endpoint
 		 * name here. Also, we receive the MGW's RTP port information. */
-		rtp_info = data;
-		OSMO_ASSERT(rtp_info);
-		ci->got_port_info = true;
-		ci->rtp_info = *rtp_info;
 		osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi),
 			sizeof(ci->mgcp_ci_str));
 		if (rtp_info->endpoint[0]) {
@@ -486,6 +484,15 @@
 				return;
 		}
 		ci->ep->first_crcx_complete = true;
+		OSMO_ASSERT(rtp_info);
+		/* fall through */
+	case MGCP_VERB_MDCX:
+		/* Always update the received RTP ip/port information, since MGW
+		 * may provide new one after remote end params changed */
+		if (rtp_info) {
+			ci->got_port_info = true;
+			ci->rtp_info = *rtp_info;
+		}
 		break;
 
 	default: