mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-03 06:52:05 +00:00
deal with rtp keep alives
This commit is contained in:
parent
5ba88abf14
commit
c0dc8ed6ff
@ -3961,6 +3961,10 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
|||||||
|
|
||||||
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, bytes);
|
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, bytes);
|
||||||
|
|
||||||
|
if (*bytes) {
|
||||||
|
rtp_session->missed_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (check_rtcp_and_ice(rtp_session) == -1) {
|
if (check_rtcp_and_ice(rtp_session) == -1) {
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
@ -4642,6 +4646,14 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
||||||
|
if (bytes) {
|
||||||
|
rtp_session->missed_count = 0;
|
||||||
|
} else if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {
|
||||||
|
ret = -2;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
||||||
//switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_CRIT, "Read bytes (%i) %ld\n", status, bytes);
|
//switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_CRIT, "Read bytes (%i) %ld\n", status, bytes);
|
||||||
@ -4837,15 +4849,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
|
||||||
if (bytes) {
|
|
||||||
rtp_session->missed_count = 0;
|
|
||||||
} else if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {
|
|
||||||
ret = -2;
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
check = !bytes;
|
check = !bytes;
|
||||||
|
|
||||||
if (rtp_session->flags[SWITCH_RTP_FLAG_FLUSH]) {
|
if (rtp_session->flags[SWITCH_RTP_FLAG_FLUSH]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user