[Asterisk-cvs] asterisk/channels chan_iax2.c,1.143,1.144
markster at lists.digium.com
markster at lists.digium.com
Tue May 25 09:43:50 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv19938/channels
Modified Files:
chan_iax2.c
Log Message:
Make sure transmitted timestamps are solid on trunks (bug #1713)
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- chan_iax2.c 25 May 2004 00:23:02 -0000 1.143
+++ chan_iax2.c 25 May 2004 13:57:57 -0000 1.144
@@ -2551,12 +2551,12 @@
static unsigned int calc_txpeerstamp(struct iax2_trunk_peer *tpeer, int sampms, struct timeval *tv)
{
- long int mssincetx;
+ unsigned long int mssincetx; /* unsigned to handle overflows */
long int ms, pred;
tpeer->trunkact = *tv;
mssincetx = (tv->tv_sec - tpeer->lasttxtime.tv_sec) * 1000 + (tv->tv_usec - tpeer->lasttxtime.tv_usec) / 1000;
- if (mssincetx > 5000) {
+ if (mssincetx > 5000 || (!tpeer->txtrunktime.tv_sec && !tpeer->txtrunktime.tv_usec)) {
/* If it's been at least 5 seconds since the last time we transmitted on this trunk, reset our timers */
tpeer->txtrunktime.tv_sec = tv->tv_sec;
tpeer->txtrunktime.tv_usec = tv->tv_usec;
More information about the svn-commits
mailing list