Index: rtpsession.c
===================================================================
--- rtpsession.c	(revision 10158)
+++ rtpsession.c	(working copy)
@@ -2107,7 +2107,12 @@
     if (created)
       on_new_ssrc (sess, source);
 
-    on_bye_ssrc (sess, source);
+    if( RTP_SOURCE_IS_SENDER (source) && sess->stats.sender_sources == 0){
+        GST_WARNING ("BYE received from last source");
+    	on_bye_ssrc (sess, source);
+    }else {
+        GST_WARNING ("ignore BYE from %s (tot senders=%d)", (RTP_SOURCE_IS_SENDER (source)?"sender":"receiver"), sess->stats.sender_sources );
+    }
 
     g_object_unref (source);
   }
@@ -2771,10 +2776,17 @@
     if (is_active)
       sess->stats.active_sources--;
 
-    if (byetimeout)
-      on_bye_timeout (sess, source);
-    else
-      on_timeout (sess, source);
+    if (is_sender && sess->stats.sender_sources == 0){
+     	GST_WARNING("last sender T.O. -> call on_%stimeout",(byetimeout?"bye_":""));
+    	if (byetimeout){
+      		on_bye_timeout (sess, source);
+    	}
+    	else{
+    		on_timeout (sess, source);
+    	}
+    }else{
+        GST_WARNING("ignore %s T.O. from %s (tot senders=%d), just remove source",(byetimeout?"BYE":"") , is_sender?"sender":"receiver", sess->stats.sender_sources);
+    }
   } else {
     if (sendertimeout)
       on_sender_timeout (sess, source);
