mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
bridge calls via mgcpgw
Change-Id: Ie259e30bc532fe9817c96562022ac33443d5747a
This commit is contained in:
@@ -48,3 +48,4 @@ int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int ciphe
|
||||
|
||||
int msc_tx_common_id(struct gsm_subscriber_connection *conn);
|
||||
int msc_call_assignment(struct gsm_trans *trans);
|
||||
int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2);
|
||||
|
@@ -1590,8 +1590,7 @@ static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge)
|
||||
/* through-connect channel */
|
||||
return tch_map(trans1->conn->lchan, trans2->conn->lchan);
|
||||
#else
|
||||
/* not implemented yet! */
|
||||
return -1;
|
||||
return msc_call_bridge(trans1, trans2);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -186,3 +186,32 @@ int msc_call_assignment(struct gsm_trans *trans)
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn1 = trans1->conn;
|
||||
struct gsm_subscriber_connection *conn2 = trans2->conn;
|
||||
|
||||
struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client;
|
||||
OSMO_ASSERT(mgcp);
|
||||
|
||||
const char *ip = mgcpgw_client_remote_addr_str(mgcp);
|
||||
|
||||
/* First setup the counterparts' endpoints, so that when transmission
|
||||
* starts the originating addresses are already known to be valid. */
|
||||
mgcpgw_client_tx_mdcx(mgcp, conn1->iu.mgcp_rtp_endpoint,
|
||||
ip, conn2->iu.mgcp_rtp_port_cn,
|
||||
MGCP_CONN_LOOPBACK);
|
||||
mgcpgw_client_tx_mdcx(mgcp, conn2->iu.mgcp_rtp_endpoint,
|
||||
ip, conn1->iu.mgcp_rtp_port_cn,
|
||||
MGCP_CONN_LOOPBACK);
|
||||
/* Now enable sending to and receiving from the peer. */
|
||||
mgcpgw_client_tx_mdcx(mgcp, conn1->iu.mgcp_rtp_endpoint,
|
||||
ip, conn2->iu.mgcp_rtp_port_cn,
|
||||
MGCP_CONN_RECV_SEND);
|
||||
mgcpgw_client_tx_mdcx(mgcp, conn2->iu.mgcp_rtp_endpoint,
|
||||
ip, conn1->iu.mgcp_rtp_port_cn,
|
||||
MGCP_CONN_RECV_SEND);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -268,6 +268,10 @@ int mgcpgw_client_tx_crcx(struct mgcpgw_client *client,
|
||||
uint16_t rtp_endpoint, unsigned int call_id,
|
||||
enum mgcp_connection_mode mode)
|
||||
{ return -ENOTSUP; }
|
||||
int mgcpgw_client_tx_mdcx(struct mgcpgw_client *client, uint16_t rtp_endpoint,
|
||||
const char *rtp_conn_addr, uint16_t rtp_port,
|
||||
enum mgcp_connection_mode mode)
|
||||
{ return -ENOTSUP; }
|
||||
const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp)
|
||||
{ return "0.0.0.0"; }
|
||||
uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp)
|
||||
|
Reference in New Issue
Block a user