mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	mgw: Update RTP local address on E1 endpoints too
E1 endpoints still have usually 1 RTP connection on it (they do
E1-slot<->RTP), so we still need to update the RTP addr+port binding
upon CRCX & MDCX on those endpoints.
This fixes a recent regression with setups with E1 BTS failing to
establish calls.
Fixes: b317b0056a
Change-Id: I52e91cd2d9d4b64961b76bb0fecc82494ca0d7cb
			
			
This commit is contained in:
		@@ -647,6 +647,33 @@ static int mgcp_endp_update_virtual(struct mgcp_endpoint *endp, struct mgcp_conn
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	OSMO_ASSERT(conn);
 | 
						OSMO_ASSERT(conn);
 | 
				
			||||||
	OSMO_ASSERT(conn->type == MGCP_CONN_TYPE_RTP);
 | 
						OSMO_ASSERT(conn->type == MGCP_CONN_TYPE_RTP);
 | 
				
			||||||
 | 
						struct mgcp_conn_rtp *conn_rtp = mgcp_conn_get_conn_rtp(conn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switch (conn_rtp->type) {
 | 
				
			||||||
 | 
						case MGCP_RTP_DEFAULT:
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						case MGCP_RTP_OSMUX:
 | 
				
			||||||
 | 
							if (conn_osmux_event_rx_crcx_mdcx(conn_rtp) < 0) {
 | 
				
			||||||
 | 
								LOGPCONN(conn, DLMGCP, LOGL_ERROR, "CRCX: Osmux handling failed!\n");
 | 
				
			||||||
 | 
								return -500;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						case MGCP_RTP_IUUP:
 | 
				
			||||||
 | 
							return mgcp_conn_iuup_event_rx_crcx_mdcx(conn_rtp);
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return -523;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*! update endpoint, updates internal endpoint specific data, should be
 | 
				
			||||||
 | 
					 *  after when MDCX or CRCX has been executed successuflly.
 | 
				
			||||||
 | 
					 *  \param[in] endp endpoint to update.
 | 
				
			||||||
 | 
					 *  \returns zero on success, mgcp negative error on failure. */
 | 
				
			||||||
 | 
					int mgcp_endp_update(struct mgcp_endpoint *endp, struct mgcp_conn *conn, enum mgcp_verb verb)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						OSMO_ASSERT(conn);
 | 
				
			||||||
	struct mgcp_trunk *trunk = endp->trunk;
 | 
						struct mgcp_trunk *trunk = endp->trunk;
 | 
				
			||||||
	struct mgcp_conn_rtp *conn_rtp = mgcp_conn_get_conn_rtp(conn);
 | 
						struct mgcp_conn_rtp *conn_rtp = mgcp_conn_get_conn_rtp(conn);
 | 
				
			||||||
	char new_local_addr[INET6_ADDRSTRLEN];
 | 
						char new_local_addr[INET6_ADDRSTRLEN];
 | 
				
			||||||
@@ -668,21 +695,15 @@ static int mgcp_endp_update_virtual(struct mgcp_endpoint *endp, struct mgcp_conn
 | 
				
			|||||||
			goto fail_bind_port_ret;
 | 
								goto fail_bind_port_ret;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (conn_rtp->type) {
 | 
						/* Allocate resources */
 | 
				
			||||||
	case MGCP_RTP_DEFAULT:
 | 
						switch (endp->trunk->trunk_type) {
 | 
				
			||||||
		break;
 | 
						case MGCP_TRUNK_VIRTUAL:
 | 
				
			||||||
	case MGCP_RTP_OSMUX:
 | 
							return mgcp_endp_update_virtual(endp, conn, verb);
 | 
				
			||||||
		if (conn_osmux_event_rx_crcx_mdcx(conn_rtp) < 0) {
 | 
						case MGCP_TRUNK_E1:
 | 
				
			||||||
			LOGPCONN(conn, DLMGCP, LOGL_ERROR, "CRCX: Osmux handling failed!\n");
 | 
							return mgcp_e1_endp_update(endp);
 | 
				
			||||||
			return -500;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		break;
 | 
					 | 
				
			||||||
	case MGCP_RTP_IUUP:
 | 
					 | 
				
			||||||
		return mgcp_conn_iuup_event_rx_crcx_mdcx(conn_rtp);
 | 
					 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return -523;
 | 
							OSMO_ASSERT(false);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fail_bind_port_ret:
 | 
					fail_bind_port_ret:
 | 
				
			||||||
@@ -701,23 +722,6 @@ fail_bind_port_ret:
 | 
				
			|||||||
	return -500;
 | 
						return -500;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*! update endpoint, updates internal endpoint specific data, should be
 | 
					 | 
				
			||||||
 *  after when MDCX or CRCX has been executed successuflly.
 | 
					 | 
				
			||||||
 *  \param[in] endp endpoint to update.
 | 
					 | 
				
			||||||
 *  \returns zero on success, mgcp negative error on failure. */
 | 
					 | 
				
			||||||
int mgcp_endp_update(struct mgcp_endpoint *endp, struct mgcp_conn *conn, enum mgcp_verb verb)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	/* Allocate resources */
 | 
					 | 
				
			||||||
	switch (endp->trunk->trunk_type) {
 | 
					 | 
				
			||||||
	case MGCP_TRUNK_VIRTUAL:
 | 
					 | 
				
			||||||
		return mgcp_endp_update_virtual(endp, conn, verb);
 | 
					 | 
				
			||||||
	case MGCP_TRUNK_E1:
 | 
					 | 
				
			||||||
		return mgcp_e1_endp_update(endp);
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		OSMO_ASSERT(false);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void mgcp_endp_add_conn(struct mgcp_endpoint *endp, struct mgcp_conn *conn)
 | 
					void mgcp_endp_add_conn(struct mgcp_endpoint *endp, struct mgcp_conn *conn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	llist_add(&conn->entry, &endp->conns);
 | 
						llist_add(&conn->entry, &endp->conns);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user