Merged revisions 195991 via svnmerge from
[asterisk/asterisk.git] / channels / chan_iax2.c
index 74303ec..f343b3d 100644 (file)
@@ -4667,6 +4667,9 @@ static unsigned int calc_timestamp(struct chan_iax2_pvt *p, unsigned int ts, str
        /* If we have a time that the frame arrived, always use it to make our timestamp */
        if (delivery && !ast_tvzero(*delivery)) {
                ms = ast_tvdiff_ms(*delivery, p->offset);
+               if (ms < 0) {
+                       ms = 0;
+               }
                if (iaxdebug)
                        ast_debug(3, "calc_timestamp: call %d/%d: Timestamp slaved to delivery time\n", p->callno, iaxs[p->callno]->peercallno);
        } else {