Hi,

I have a SEMS-based application that does not send/receive RTP for potentially 
a long while (it's an announcement server on the standy). If the other parts 
of the call takes long time (more than the dead_rtp_time), the first 
nextPacket rises RtpTimeout error. This is because when I add the session to 
the mediaprocessor, the timestamp remains the same (the one from the begining 
of the session). The attached patch resets the timestamp when the session is 
added.

br

Szo
diff -ruw sems-orig//core/AmMediaProcessor.cpp sems//core/AmMediaProcessor.cpp
--- sems-orig//core/AmMediaProcessor.cpp	2011-01-31 16:26:08.000000000 +0100
+++ sems//core/AmMediaProcessor.cpp	2011-11-30 11:15:07.000000000 +0100
@@ -395,6 +395,7 @@
   case AmMediaProcessor::InsertSession:
     DBG("Session inserted to the scheduler\n");
     sessions.insert(sr->s);
+    sr->s->RTPStream()->clearRTPTimeout();
     break;
 
   case AmMediaProcessor::RemoveSession:{
diff -ruw sems-orig//core/AmRtpStream.cpp sems//core/AmRtpStream.cpp
--- sems-orig//core/AmRtpStream.cpp	2011-09-02 11:03:04.000000000 +0200
+++ sems//core/AmRtpStream.cpp	2011-11-30 11:14:48.000000000 +0100
@@ -678,6 +678,10 @@
  memcpy(&last_recv_time, recv_time, sizeof(struct timeval));
 }
 
+void AmRtpStream::clearRTPTimeout() {
+  gettimeofday(&last_recv_time,NULL);
+}
+
 unsigned int AmRtpStream::bytes2samples(unsigned int) const {
   ERROR("bytes2samples called on AmRtpStream\n");
   return 0;
diff -ruw sems-orig//core/AmRtpStream.h sems//core/AmRtpStream.h
--- sems-orig//core/AmRtpStream.h	2011-03-18 15:56:31.000000000 +0100
+++ sems//core/AmRtpStream.h	2011-11-30 11:14:06.000000000 +0100
@@ -308,6 +308,11 @@
    */
   void clearRTPTimeout(struct timeval* recv_time);
 
+  /*
+   * clear RTP timeout to current time 
+   */
+  void clearRTPTimeout();
+
   virtual unsigned int bytes2samples(unsigned int) const;
 
   /** set relay stream for  RTP relaying */
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to