aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_network.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-19 12:13:32 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-01-16 12:17:24 +0100
commit0970bab2a39244dfdd6caa226383da4d4e569b65 (patch)
tree3208753b95af0d2eb613f00e630377168cc40eff /openbsc/src/libmgcp/mgcp_network.c
parentb8300080209f2f93d57cf10445ae7558c6281db4 (diff)
mgcp/rtp: Add flag to disable RTP output
This patch make it possible to have a valid endpoint that drops all outgoing RTP packets. The number of dropped packets is shown by the VTY 'show mgcp' command. By default, this feature is disabled. To enable packet dropping, the corresponding output_enabled field must be set to 0. Ticket: OW#1044 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_network.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 1c7c3daf..21d52b58 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -559,7 +559,9 @@ static int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
tap_idx = MGCP_TAP_BTS_OUT;
}
- if (is_rtp) {
+ if (!rtp_end->output_enabled)
+ rtp_end->dropped_packets += 1;
+ else if (is_rtp) {
mgcp_patch_and_count(endp, rtp_state, rtp_end, addr, buf, rc);
forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, rc);
return mgcp_udp_send(rtp_end->rtp.fd,