Summary:ASTERISK-01227: [patch] Discontinous RTP transmission (DTX) support
Reporter:Paul Cadach (pcadach)Labels:
Date Opened:2004-03-17 03:40:03.000-0600Date Closed:2008-12-17 23:14:49.000-0600
Versions:Frequency of
Environment:Attachments:( 0) rtp.c.diff
Description:RFC about RTP says that "mark" bit is used (must be set) to indicate of continuation of RTP stream after pause (silence). Basic handling of "mark" bit is provided by attached patch.
Comments:By: zoa (zoa) 2004-03-17 03:47:49.000-0600

is this basic handling of VAD ?

By: Paul Cadach (pcadach) 2004-03-17 05:26:43.000-0600

Don't mix definitions of DTX (discontinuous RTP transmission), VAD (voice-activity detection on transmitting side) and CNG (comfort-noice generation on reciving side) terms. VAD-capable scheme for single direction looks like: ADC->coder+VAD->RTP->decoder(+CNG, optionally)->DAC. RTP frames are: continuous voice (i.e. continuous voice stream without long silence periods), paused voice (no voice RTP traffic when long silence is detected by VAD) plus (optional) SID (silence definition) frames.

To distinguish lost voice packets and paused stream each packet have:
1) sequence number;
2) "mark" bit.
By sequence number receiver can deduce which frames are out-of-order to buffer them and to try to reconstruct original sequence of frames. If VAD detects silence, it just stop generating of voice frames but when voice appears again it sets "mark" bit to one (on all other frames this bit is set to 0) to tell receiver about paused stream, not packet lost (sequence numbers but not timestamps are stay in-sequence when DTX is used, but they will be out-of-sequence if some of packets get lost).

While CNG is optional component, DTX is declared in RTP's RFC so it could be used by ANY equipment (with proper handling of "mark" bit).

This patch is preliminary support for DTX at Asterisk (which must be carefully tested due to changes for timestamp "bypassing"). Also, IMHO at the result Asterisk must cleanly re-transmit SID frames between call legs to utilize endpoint's CNGs (if available) or use internal white-noise generator which must connects to call when no voice RTP packets is available with adaptation by (optional) SID frames.

By: Paul Cadach (pcadach) 2004-03-21 12:41:40.000-0600

I'm currently trying to resolve existing problems with "transparent" timestamping and making RTP/IAX2 stacks to be DTX-capable.

By: Olle Johansson (oej) 2004-04-26 16:19:12

Does the lack of support of this in Asterisk lead to any known problems?`Please help me judge this patch - is it required by some devices or just a clean up to be more RFC-compliant?

By: Paul Cadach (pcadach) 2004-04-26 22:54:16

When endpoint resumes streaming after pause, it must set "marker" bit in RTP packet header. So, "transparency" for "marker" bit is required.

By: Mark Spencer (markster) 2004-05-01 11:11:16

Added to CVS (slightly differently)

By: Digium Subversion (svnbot) 2008-01-15 14:52:57.000-0600

Repository: asterisk
Revision: 2842

U   trunk/rtp.c

r2842 | markster | 2008-01-15 14:52:57 -0600 (Tue, 15 Jan 2008) | 2 lines

Add DTX support (mark bit) (bug ASTERISK-1227)



By: Digium Subversion (svnbot) 2008-12-17 23:14:49.000-0600

Repository: repotools
Revision: 573

U   muffinman/modules/Mantis.pm
U   muffinman/modules/ReviewBoard.pm

r573 | seanbright | 2008-12-17 23:14:48 -0600 (Wed, 17 Dec 2008) | 3 lines

ReviewBoard.pm: Add [R<review number>] in front of the message to the channel as suggested by snuffy.
Mantis.pm: Fix the M12345ASTERISK-1227 and M12345#last functionality.