Commit 8d120b3c authored by jehan's avatar jehan

avoid to many stun packets to be sent

parent 07a8b569
......@@ -72,6 +72,7 @@ static void send_stun_packet(RtpSession *s)
mp = allocb(len, BPRI_MED);
memcpy(mp->b_wptr, buf, len);
mp->b_wptr += len;
ms_message("Stun packet sent for session [%p]",s);
rtp_session_sendm_with_ts(s, mp, 0);
}
}
......@@ -350,7 +351,8 @@ static void check_stun_sending(MSFilter *f) {
SenderData *d = (SenderData *) f->data;
RtpSession *s = d->session;
if ((d->last_stun_sent_time == -1) || ((f->ticker->time - d->last_stun_sent_time) >= 500)) {
if ((d->last_stun_sent_time == -1) || ((f->ticker->time- d->last_sent_time>2000) /*no need to send stun packets au media sent ion last 2s*/
&& (f->ticker->time - d->last_stun_sent_time) >= 500)) {
d->last_stun_sent_time = f->ticker->time;
}
if (d->last_stun_sent_time == f->ticker->time) {
......
......@@ -3260,7 +3260,7 @@ void ice_check_list_process(IceCheckList *cl, RtpSession *rtp_session)
/* Check if there are some retransmissions pending. */
ms_list_for_each2(cl->check_list, (void (*)(void*,void*))ice_check_retransmissions_pending, &retransmissions_pending);
if (retransmissions_pending == FALSE) {
/* There is no connectivity check left to be sent and no retransmissions pending. */
ms_message("ice: There is no connectivity check left to be sent and no retransmissions pending, concluding checklist [%p]",cl);
ice_conclude_processing(cl, rtp_session);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment