aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-19 18:53:07 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-01-16 13:20:51 +0100
commit075a9ebdcc385ce7a87fb36f7a44a6c71d7dcbbb (patch)
tree2fbfa354db8458c878d22b0fed0baa4e567ef74d /openbsc/include/openbsc
parent34bdc9f8fe3862ce3213820d356a8ebbc45b7362 (diff)
mgcp: Send RTP keepalive dummy packets to net
So far, a single dummy packet has been sent immediately after the reception of a MDCX message. There is no dedicated keep alive mechanism (it just worked because the audio from the MS has always been forwarded to the NAT until the 'mgcp: Set output_enabled flags based on the MGCP mode' patch). This patch adds explicit, timer based keep alive handling that can be enable per trunk. A VTY command 'rtp keep-alive' command is added for configuration which can be used to set the interval in seconds, to send a single packet after the reception of a CRCX/MDCX when RTP data from the net is expected ('once'), or to disable the feature completely ('no rtp keep-alive'). In 'send-recv' connections, only the initial packet is sent if enabled (even when an interval has been configured). The default is 'once'. Note that this removes the mgcp_change_cb() from mgcp_main.c. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 335c83d93..1d7407820 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -25,6 +25,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/write_queue.h>
+#include <osmocom/core/timer.h>
#include "debug.h"
@@ -103,6 +104,8 @@ struct mgcp_port_range {
int last_port;
};
+#define MGCP_KEEPALIVE_ONCE (-1)
+
struct mgcp_trunk_config {
struct llist_head entry;
@@ -118,6 +121,7 @@ struct mgcp_trunk_config {
int audio_loop;
int omit_rtcp;
+ int keepalive_interval;
/* RTP patching */
int force_constant_ssrc; /* 0: don't, 1: once */
@@ -126,6 +130,9 @@ struct mgcp_trunk_config {
/* spec handling */
int force_realloc;
+ /* timer */
+ struct osmo_timer_list keepalive_timer;
+
unsigned int number_endpoints;
struct mgcp_endpoint *endpoints;
};
@@ -187,6 +194,8 @@ int mgcp_reset_transcoder(struct mgcp_config *cfg);
void mgcp_format_stats(struct mgcp_endpoint *endp, char *stats, size_t size);
int mgcp_parse_stats(struct msgb *msg, uint32_t *ps, uint32_t *os, uint32_t *pr, uint32_t *_or, int *loss, uint32_t *jitter);
+void mgcp_trunk_set_keepalive(struct mgcp_trunk_config *tcfg, int interval);
+
/*
* format helper functions
*/