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)
{
|