Hi,

here is a patch for the DTMF problem.
I am still trying to figure out how to best solve the supervised transfer 
problem.

   ...Carsten


Carsten Avenhaus wrote:
Paul Whitfield wrote:

For my application I have re-worked the code to not call MprDecode::pushPacket() for DTMF packets,
 this then caused a problem that the DTMF packets
never got decoded, I fixed this and my application is working fine now.

I thought about that too, but that means DTMFs can probably overtake
audio in the jitter buffer. Since the jitter buffer is probably not that
big it's probably not a big deal for most applications.
But I think that not calling MpJbeFixed::update() for DTMFs from MprDecode::pushPacket() is a cleaner and easier fix. Would you give it a try and see if that fixes your
problem as well?


Keith Kyzivat wrote:
> Might you have a patch file you can send up so this can be reviewed and checked into the repository?

Not quite yet, but I will send it once I did some more testing.


   ...Carsten

Index: sipXtapi-3.2/sipXmediaLib/src/mp/MprDecode.cpp
===================================================================
--- sipXtapi-3.2/sipXmediaLib/src/mp/MprDecode.cpp      (revision 10928)
+++ sipXtapi-3.2/sipXmediaLib/src/mp/MprDecode.cpp      (working copy)
@@ -219,11 +219,17 @@
       // Initialize JB estimator.
       mpJbEstimationState->init(mStreamState.sampleRate);
 
-      // Update jitter state data
-      mpJbEstimationState->update(&pRtp->getRtpHeader(),
-                                  mStreamState.rtpStreamPosition,
-                                  mStreamState.playbackStreamPosition,
-                                  &mStreamState.rtpStreamHint);
+      // DTMF telephone-events may have a different rtp->timestamp
+      // and mess up the jitter state calculation, causing audio and
+      // DTMF to stop working.
+      if (!pDecoderInfo->isSignalingCodec())
+      {
+         // Update jitter state data
+         mpJbEstimationState->update(&pRtp->getRtpHeader(),
+                                     mStreamState.rtpStreamPosition,
+                                     mStreamState.playbackStreamPosition,
+                                     &mStreamState.rtpStreamHint);
+      }
 
       mStreamState.rtpStreamPosition += mStreamState.rtpStreamHint;
 
@@ -234,11 +240,17 @@
       // Sample rate mustn't change during the live stream.
       assert(pDecoderInfo->getSampleRate() == mStreamState.sampleRate);
 
-      // Update jitter state data
-      mpJbEstimationState->update(&pRtp->getRtpHeader(),
-                                  mStreamState.rtpStreamPosition,
-                                  mStreamState.playbackStreamPosition,
-                                  &mStreamState.rtpStreamHint);
+      // DTMF telephone-events may have a different rtp->timestamp
+      // and mess up the jitter state calculation, causing audio and
+      // DTMF to stop working.
+      if (!pDecoderInfo->isSignalingCodec())
+      {
+         // Update jitter state data
+         mpJbEstimationState->update(&pRtp->getRtpHeader(),
+                                     mStreamState.rtpStreamPosition,
+                                     mStreamState.playbackStreamPosition,
+                                     &mStreamState.rtpStreamHint);
+      }
    }
 
    RTL_EVENT(str_fg+"_MprDecode_pushPacket_rtp_stream_hint",
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to