diff -Naur asterisk-11.7.0/res/res_rtp_asterisk.c asterisk-11.7.0_edited/res/res_rtp_asterisk.c --- asterisk-11.7.0/res/res_rtp_asterisk.c 2013-10-23 19:37:15.000000000 +0200 +++ asterisk-11.7.0_edited/res/res_rtp_asterisk.c 2014-02-25 13:30:17.379414390 +0100 @@ -2172,7 +2172,7 @@ /* We simply set this bit so that the next packet sent will have the marker bit turned on */ ast_set_flag(rtp, FLAG_NEED_MARKER_BIT); - ast_debug(3, "Setting the marker bit due to a source update\n"); + ast_debug(3, "RTP instance, '%p', Setting the marker bit due to a source update\n", instance); return; } @@ -2499,6 +2499,8 @@ struct ast_sockaddr remote_address = { {0,} }; int rate = rtp_get_rate(&frame->subclass.format) / 1000; + ast_debug(3, "RTP preraw instance '%p', seqno is %d, lastts is %d\n", instance, rtp->seqno, rtp->lastts); + if (frame->subclass.format.id == AST_FORMAT_G722) { frame->samples /= 2; } @@ -2510,15 +2512,18 @@ if (frame->frametype == AST_FRAME_VOICE) { pred = rtp->lastts + frame->samples; + ast_debug(3, "RTP preraw2 instance '%p', seqno is %d, lastts is %d\n, pred is %d", instance, rtp->seqno, rtp->lastts, pred); /* Re-calculate last TS */ rtp->lastts = rtp->lastts + ms * rate; + ast_debug(3, "RTP preraw3 instance '%p', seqno is %d, lastts is %d\n, pred is %d", instance, rtp->seqno, rtp->lastts, pred); if (ast_tvzero(frame->delivery)) { /* If this isn't an absolute delivery time, Check if it is close to our prediction, and if so, go with our prediction */ if (abs(rtp->lastts - pred) < MAX_TIMESTAMP_SKEW) { rtp->lastts = pred; + ast_debug(3, "RTP preraw4 instance '%p', seqno is %d, lastts is %d\n, pred is %d", instance, rtp->seqno, rtp->lastts, pred); } else { - ast_debug(3, "Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms); + ast_debug(3, "RTP voice instance '%p', Difference is %d, ms is %d\n", instance, abs(rtp->lastts - pred), ms); mark = 1; } } @@ -2533,7 +2538,7 @@ rtp->lastts = pred; rtp->lastovidtimestamp += frame->samples; } else { - ast_debug(3, "Difference is %d, ms is %d (%d), pred/ts/samples %d/%d/%d\n", abs(rtp->lastts - pred), ms, ms * 90, rtp->lastts, pred, frame->samples); + ast_debug(3, "RTP video instance '%p', Difference is %d, ms is %d (%d), pred/ts/samples %d/%d/%d\n", instance, abs(rtp->lastts - pred), ms, ms * 90, rtp->lastts, pred, frame->samples); rtp->lastovidtimestamp = rtp->lastts; } } @@ -2547,7 +2552,7 @@ rtp->lastts = pred; rtp->lastotexttimestamp += frame->samples; } else { - ast_debug(3, "Difference is %d, ms is %d, pred/ts/samples %d/%d/%d\n", abs(rtp->lastts - pred), ms, rtp->lastts, pred, frame->samples); + ast_debug(3, "RTP other instance '%p', Difference is %d, ms is %d, pred/ts/samples %d/%d/%d\n", instance, abs(rtp->lastts - pred), ms, rtp->lastts, pred, frame->samples); rtp->lastotexttimestamp = rtp->lastts; } } @@ -2559,6 +2564,8 @@ ast_clear_flag(rtp, FLAG_NEED_MARKER_BIT); } + ast_debug(3, "RTP preraw5 instance '%p', seqno is %d, lastts is %d\n", instance, rtp->seqno, rtp->lastts); + /* If the timestamp for non-digt packets has moved beyond the timestamp for digits, update the digit timestamp */ if (rtp->lastts > rtp->lastdigitts) { rtp->lastdigitts = rtp->lastts; @@ -2568,6 +2575,8 @@ rtp->lastts = frame->ts * rate; } + ast_debug(3, "RTP preraw6 instance '%p', seqno is %d, lastts is %d\n", instance, rtp->seqno, rtp->lastts); + ast_rtp_instance_get_remote_address(instance, &remote_address); /* If we know the remote address construct a packet and send it out */ @@ -2612,7 +2621,8 @@ #endif if (rtp_debug_test_addr(&remote_address)) { - ast_verbose("Sent RTP packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n", + ast_verbose("RTP instance '%p', Sent RTP packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n", + instance, ast_sockaddr_stringify(&remote_address), ice ? " (via ICE)" : "", codec, rtp->seqno, rtp->lastts, res - hdrlen);