diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2012-01-16 09:29:28 +0100 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2014-05-06 17:21:24 +0400 |
commit | 166b32b8d696981955b7d6bb0ec7ac1b801fff47 (patch) | |
tree | f3f2fab54a8cecd44cf5cb1023b83b9058f44f66 /openbsc/src/libtrau/rtp_proxy.c | |
parent | f2f94ce900bae621dca89571bc526fef4a71489c (diff) |
Add traffic forwarding via RTP to remote application
Instead of forwarding traffic through MNCC interface, traffic can
be forwarded to a given RTP peer directly. A special MNCC message
is used to control the peer's destination. The traffic can still be
forwarded through MNCC interface when this special MNCC message is
not used.
It also works with E1 based BTSs.
In conjunction with LCR's "rtp-bridge" feature, the RTP traffic
can be directly exchanged with a remote SIP endpoint, so that the
traffic is not forwarded by LCR itself. This way the performance
of handling traffic only depends on OpenBSC and the remote SIP
endpoint. Also the traffic is exchanged with the SIP endpoint
without transcoding, to have maximum performance.
Increment MNCC version to 5.
Diffstat (limited to 'openbsc/src/libtrau/rtp_proxy.c')
-rw-r--r-- | openbsc/src/libtrau/rtp_proxy.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 22d135c3e..d2bf88dbd 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -473,7 +473,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) other_rss->bfd.when |= BSC_FD_WRITE; break; - case RTP_RECV_UPSTREAM: + case RTP_RECV_UPSTREAM: /* from BTS to application */ if (!rs->receive.callref || !rs->receive.net) { rc = -EIO; goto out_free; @@ -502,6 +502,24 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) trau_tx_to_mncc(rs->receive.net, new_msg); break; + case RTP_RECV_APP: /* from remote application */ + if (!rs->receive.callref || !rs->receive.net) { + rc = -EIO; + goto out_free; + } + if (rss->bfd.priv_nr != RTP_PRIV_RTP) { + rc = ENOTSUP; + goto out_free; + } + rc = rtp_decode(msg, rs->receive.callref, &new_msg); + if (rc < 0) + goto out_free; + msgb_free(msg); + tch_frame_down(rs->receive.net, rs->receive.callref, + (struct gsm_data_frame *) new_msg->data); + msgb_free(new_msg); + break; + case RTP_NONE: /* if socket exists, but disabled by app */ msgb_free(msg); break; |