sippy / rtpproxy

The RTPproxy is a high-performance software proxy for RTP streams that can work together with Sippy B2BUA, Kamailio, OpenSIPS and SER.
http://rtpproxy.org
BSD 2-Clause "Simplified" License
405 stars 114 forks source link

delayed packets causing new rtp stream to be dropped #103

Open bobert13 opened 4 years ago

bobert13 commented 4 years ago

Hi,

I'm using an old version (unfortunately upgrading is not an option at the moment), and we're having issues that after a new port is negotiated (callee reINVITEthen 200OK), the callee is briefly sending RTP from the old port, which causes RTPproxy to fill in the old port as the new stream and "forget" the new port. i.e. rxmit_packets: callee's address filled in .....

from what i can tell, this is occurring due to the "rxmit_packets" function in main.c, if i change it as below, will this address the issue by instituting a .01 second lag before the final fill-in? could this cause other issues?

change from:

 if (sp->prev_addr[ridx] == NULL || memcmp(sp->prev_addr[ridx], &packet->raddr, packet->rlen) != 0)
                sp->canupdate[ridx] = 0;

to:

if ((sp->prev_addr[ridx] == NULL || memcmp(sp->prev_addr[ridx], &packet->raddr, packet->rlen) != 0) && (dtime - sp->last_update[ridx] > 0.01))
                sp->canupdate[ridx] = 0;