diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-09-22 20:28:35 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-23 22:27:38 +0100 |
commit | 559ecb899a46829ee2df37166ddf5748a1e8df45 (patch) | |
tree | 54912729ae14a3da9b822507bd28a8b883867061 /openbsc/src/libmsc/msc_ifaces.c | |
parent | 7dff88a4eecf2faf7c62708df85da9c26c27367a (diff) |
bridge calls via mgcpgw
Change-Id: Ie259e30bc532fe9817c96562022ac33443d5747a
Diffstat (limited to 'openbsc/src/libmsc/msc_ifaces.c')
-rw-r--r-- | openbsc/src/libmsc/msc_ifaces.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index 2937b54f6..585927c73 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -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; +} |