mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
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: I06660ba672c0a343814af4cec838e6025cafd54b
This commit is contained in:
@@ -2166,6 +2166,7 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz
|
||||
void *temp = buf;
|
||||
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
||||
struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
|
||||
int res;
|
||||
|
||||
*ice = 0;
|
||||
|
||||
@@ -2184,7 +2185,11 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz
|
||||
}
|
||||
#endif
|
||||
|
||||
return ast_sendto(rtcp ? rtp->rtcp->s : rtp->s, temp, len, flags, sa);
|
||||
res = ast_sendto(rtcp ? rtp->rtcp->s : rtp->s, temp, len, flags, sa);
|
||||
if (res > 0) {
|
||||
ast_rtp_instance_set_last_tx(instance, time(NULL));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int rtcp_sendto(struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int *ice)
|
||||
|
Reference in New Issue
Block a user