From 075a9ebdcc385ce7a87fb36f7a44a6c71d7dcbbb Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 19 Dec 2013 18:53:07 +0100 Subject: 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 --- openbsc/src/osmo-bsc_mgcp/mgcp_main.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'openbsc/src/osmo-bsc_mgcp') diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c index 596ea8a49..14ec22143 100644 --- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c +++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c @@ -137,15 +137,6 @@ static int mgcp_rsip_cb(struct mgcp_trunk_config *tcfg) return 0; } -static int mgcp_change_cb(struct mgcp_trunk_config *cfg, int endpoint, int state) -{ - if (state != MGCP_ENDP_MDCX) - return 0; - - mgcp_send_dummy(&cfg->endpoints[endpoint]); - return 0; -} - static int read_call_agent(struct osmo_fd *fd, unsigned int what) { struct sockaddr_in addr; @@ -233,7 +224,6 @@ int main(int argc, char **argv) /* set some callbacks */ cfg->reset_cb = mgcp_rsip_cb; - cfg->change_cb = mgcp_change_cb; /* we need to bind a socket */ if (rc == 0) { -- cgit v1.2.3