Bugs: Browse | Submit New | Admin

[#28991] SipperMedia add some voice stopped detect for half-duplex rtp

Date:
2011-02-24 14:25
Priority:
3
Submitted By:
M Dup (mdup)
Assigned To:
Nobody (None)
Category:
minor-enhancement
State:
Open
Summary:
SipperMedia add some voice stopped detect for half-duplex rtp

Detailed description
SipperMedia considers the absence of RTP packets after a delay to be a lost connection. But in half-duplex modes this
is quite common. The max. timeout should be allowed to be set much higher than 10 seconds, and I've modified the silence
detection a little to allow the absence of RTP packets for silentDuration also to create a VOICE_ACTIVITY_STOPPED event.

Index: SipperMediaCodec.cpp
===================================================================
--- SipperMediaCodec.cpp        (revision 253)
+++ SipperMediaCodec.cpp        (working copy)
@@ -399,7 +399,6 @@
 
    struct timeval tolerance = _lastrecvTime;
    tolerance.tv_sec += audioStopDuration;
-
    if(SipperMediaPortable::isGreater(&currtime, &tolerance))
    {
       char evt[200];
@@ -408,6 +407,18 @@
       _lastrecvTime.tv_sec = 0;
       _lastrecvTime.tv_usec = 0;
    }
+   
+   // Fixup voice time in case there are no rtp packets, it should be regarded as silence too.
+   tolerance = _lastrecvTime;
+   tolerance.tv_usec += silentDuration;
+   if(tolerance.tv_usec >= 1000000)
+   {
+      tolerance.tv_sec += (tolerance.tv_usec / 1000000);
+      tolerance.tv_usec %= 1000000;
+   }
+   if(SipperMediaPortable::isGreater(&currtime, &tolerance)) {
+          _lastSilentTime=currtime;
+   }
 
    if(_voiceMode)
    {

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item