[Asterisk-cvs] asterisk/channels chan_iax2.c,1.204,1.205
markster at lists.digium.com
markster at lists.digium.com
Sun Oct 10 16:27:08 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv19249/channels
Modified Files:
chan_iax2.c
Log Message:
Keep back delivery times on trunk (bug #2587)
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- chan_iax2.c 10 Oct 2004 01:42:46 -0000 1.204
+++ chan_iax2.c 10 Oct 2004 20:27:54 -0000 1.205
@@ -1729,7 +1729,7 @@
}
}
-static int schedule_delivery(struct iax_frame *fr, int reallydeliver, int updatehistory)
+static int schedule_delivery(struct iax_frame *fr, int reallydeliver, int updatehistory, int fromtrunk)
{
int ms,x;
int delay;
@@ -1792,7 +1792,7 @@
ms = 0;
/* delivery time is sender's sent timestamp converted back into absolute time according to our clock */
- if (iaxs[fr->callno]->rxcore.tv_sec || iaxs[fr->callno]->rxcore.tv_usec) {
+ if ( (!fromtrunk) && (iaxs[fr->callno]->rxcore.tv_sec || iaxs[fr->callno]->rxcore.tv_usec) ) {
fr->af.delivery.tv_sec = iaxs[fr->callno]->rxcore.tv_sec;
fr->af.delivery.tv_usec = iaxs[fr->callno]->rxcore.tv_usec;
fr->af.delivery.tv_sec += fr->ts / 1000;
@@ -1805,7 +1805,7 @@
else {
#if 0
if (reallydeliver)
- ast_log(LOG_DEBUG, "schedule_delivery: set delivery to 0 as we don't have an rxcore yet.\n");
+ ast_log(LOG_DEBUG, "schedule_delivery: set delivery to 0 as we don't have an rxcore yet, or frame is from trunk.\n");
#endif
fr->af.delivery.tv_sec = 0;
fr->af.delivery.tv_usec = 0;
@@ -1886,7 +1886,8 @@
delay = maxjitterbuffer;
/* If jitter buffer is disabled then just pretend the frame is "right on time" */
- if (!iaxs[fr->callno]->usejitterbuf)
+ /* If frame came from trunk, also don't do any delay */
+ if ( (!iaxs[fr->callno]->usejitterbuf) || fromtrunk )
delay = 0;
if (option_debug) {
@@ -5090,10 +5091,10 @@
if (iaxs[fr.callno]->bridgecallno) {
forward_delivery(&fr);
} else {
- schedule_delivery(iaxfrdup2(&fr), 1, updatehistory);
+ schedule_delivery(iaxfrdup2(&fr), 1, updatehistory, 1);
}
#else
- schedule_delivery(iaxfrdup2(&fr), 1, updatehistory);
+ schedule_delivery(iaxfrdup2(&fr), 1, updatehistory, 1);
#endif
}
} else {
@@ -5346,7 +5347,7 @@
if (option_debug)
ast_log(LOG_DEBUG, "IAX subclass %d received\n", f.subclass);
/* Go through the motions of delivering the packet without actually doing so */
- schedule_delivery(&fr, 0, updatehistory);
+ schedule_delivery(&fr, 0, updatehistory, 0);
switch(f.subclass) {
case IAX_COMMAND_ACK:
/* Do nothing */
@@ -6004,12 +6005,12 @@
forward_delivery(&fr);
} else {
duped_fr = iaxfrdup2(&fr);
- schedule_delivery(duped_fr, 1, updatehistory);
+ schedule_delivery(duped_fr, 1, updatehistory, 0);
fr.ts = duped_fr->ts;
}
#else
duped_fr = iaxfrdup2(&fr);
- schedule_delivery(duped_fr, 1, updatehistory);
+ schedule_delivery(duped_fr, 1, updatehistory, 0);
fr.ts = duped_fr->ts;
#endif
More information about the svn-commits
mailing list