mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merged revisions 323370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r323370 | twilson | 2011-06-14 09:33:55 -0700 (Tue, 14 Jun 2011) | 10 lines Add rtpkeepalives back to 1.8 The RTP-engine conversion left out support for handling rtpkeepalives. This patch adds them back. (closes issue ASTERISK-17304) Reported by: lmadsen Review: https://reviewboard.asterisk.org/r/1226/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5061,6 +5061,7 @@ static int dialog_initialize_rtp(struct sip_pvt *dialog)
|
||||
}
|
||||
ast_rtp_instance_set_timeout(dialog->vrtp, global_rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->vrtp, global_rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->vrtp, global_rtpholdtimeout);
|
||||
|
||||
ast_rtp_instance_set_prop(dialog->vrtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||
}
|
||||
@@ -5071,12 +5072,14 @@ static int dialog_initialize_rtp(struct sip_pvt *dialog)
|
||||
}
|
||||
ast_rtp_instance_set_timeout(dialog->trtp, global_rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->trtp, global_rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->trtp, global_rtpholdtimeout);
|
||||
|
||||
ast_rtp_instance_set_prop(dialog->trtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||
}
|
||||
|
||||
ast_rtp_instance_set_timeout(dialog->rtp, global_rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->rtp, global_rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->rtp, global_rtpkeepalive);
|
||||
|
||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&dialog->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
|
||||
@@ -5144,6 +5147,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
|
||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF_COMPENSATE, ast_test_flag(&dialog->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
|
||||
ast_rtp_instance_set_timeout(dialog->rtp, peer->rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->rtp, peer->rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->rtp, peer->rtpkeepalive);
|
||||
/* Set Frame packetization */
|
||||
ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(dialog->rtp), dialog->rtp, &dialog->prefs);
|
||||
dialog->autoframing = peer->autoframing;
|
||||
@@ -5151,10 +5155,12 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
|
||||
if (dialog->vrtp) { /* Video */
|
||||
ast_rtp_instance_set_timeout(dialog->vrtp, peer->rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->vrtp, peer->rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->vrtp, peer->rtpkeepalive);
|
||||
}
|
||||
if (dialog->trtp) { /* Realtime text */
|
||||
ast_rtp_instance_set_timeout(dialog->trtp, peer->rtptimeout);
|
||||
ast_rtp_instance_set_hold_timeout(dialog->trtp, peer->rtpholdtimeout);
|
||||
ast_rtp_instance_set_keepalive(dialog->trtp, peer->rtpkeepalive);
|
||||
}
|
||||
|
||||
/* XXX TODO: get fields directly from peer only as they are needed using dialog->relatedpeer */
|
||||
@@ -25396,11 +25402,19 @@ static void check_rtp_timeout(struct sip_pvt *dialog, time_t t)
|
||||
}
|
||||
|
||||
/* If we have no timers set, return now */
|
||||
if (!ast_rtp_instance_get_timeout(dialog->rtp) && !ast_rtp_instance_get_hold_timeout(dialog->rtp)) {
|
||||
if (!ast_rtp_instance_get_keepalive(dialog->rtp) && !ast_rtp_instance_get_timeout(dialog->rtp) && !ast_rtp_instance_get_hold_timeout(dialog->rtp)) {
|
||||
dialog_unlink_rtpcheck(dialog);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check AUDIO RTP keepalives */
|
||||
if (dialog->lastrtptx && ast_rtp_instance_get_keepalive(dialog->rtp) &&
|
||||
(t > dialog->lastrtptx + ast_rtp_instance_get_keepalive(dialog->rtp))) {
|
||||
/* Need to send an empty RTP packet */
|
||||
dialog->lastrtptx = time(NULL);
|
||||
ast_rtp_instance_sendcng(dialog->rtp, 0);
|
||||
}
|
||||
|
||||
/*! \todo Check video RTP keepalives
|
||||
|
||||
Do we need to move the lastrtptx to the RTP structure to have one for audio and one
|
||||
|
Reference in New Issue
Block a user