summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-25 13:57:57 +0000
committerMark Spencer <markster@digium.com>2004-05-25 13:57:57 +0000
commit2cc7d3e8dbd7eaf28f5b503036f7ce287439224c (patch)
treec506640c09f637b10a00c7d2d7efc0e0ecb20cc0 /channels
parent67b3ab9ee5ec9fe3c0ec3094edfeb7b82a81a2cf (diff)
Make sure transmitted timestamps are solid on trunks (bug #1713)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_iax2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 5905cd05e..2683bce2a 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -2551,12 +2551,12 @@ static struct ast_channel *ast_iax2_new(struct chan_iax2_pvt *i, int state, int
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;