From 2b42264e66656f6ab6bc664eec4e93d353c58ffe Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Thu, 9 Jul 2015 14:17:53 -0500 Subject: res_pjsip: Add rtp_keepalive endpoint option. This adds an "rtp_keepalive" option for PJSIP endpoints. Similar to the chan_sip option, this specifies an interval, in seconds, at which we will send RTP comfort noise frames. This can be useful for keeping RTP sessions alive as well as keeping NAT associations alive during lulls. ASTERISK-25242 #close Reported by Mark Michelson Change-Id: I3b9903d99e35fe5d0b53ecc46df82c750776bc8d --- main/rtp_engine.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'main') diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 6ae8faf9c..94bd8136f 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -190,6 +190,8 @@ struct ast_rtp_instance { struct ast_srtp *srtp; /*! Channel unique ID */ char channel_uniqueid[AST_MAX_UNIQUEID]; + /*! Time of last packet sent */ + time_t last_tx; }; /*! List of RTP engines that are currently registered */ @@ -2206,3 +2208,14 @@ int ast_rtp_engine_init() return 0; } + + +time_t ast_rtp_instance_get_last_tx(const struct ast_rtp_instance *rtp) +{ + return rtp->last_tx; +} + +void ast_rtp_instance_set_last_tx(struct ast_rtp_instance *rtp, time_t time) +{ + rtp->last_tx = time; +} -- cgit v1.2.3