- log
[oweals/gnunet.git] / src / conversation / conversation_api_call.c
index 4a671cbda714786c65518d19926eb47921c6e68f..8722e24520fd95b40026bb0be036c1669f7bf790 100644 (file)
@@ -254,12 +254,12 @@ handle_call_resume (void *cls,
     break;
   case CS_SUSPENDED_CALLEE:
     call->state = CS_ACTIVE;
-    call->event_handler (call->event_handler_cls,
-                         GNUNET_CONVERSATION_EC_CALL_RESUMED);
     call->speaker->enable_speaker (call->speaker->cls);
     call->mic->enable_microphone (call->mic->cls,
                                   &transmit_call_audio,
                                   call);
+    call->event_handler (call->event_handler_cls,
+                         GNUNET_CONVERSATION_EC_CALL_RESUMED);
     break;
   case CS_SUSPENDED_BOTH:
     call->state = CS_SUSPENDED_CALLER;
@@ -296,12 +296,12 @@ handle_call_picked_up (void *cls,
     break;
   case CS_RINGING:
     call->state = CS_ACTIVE;
-    call->event_handler (call->event_handler_cls,
-                         GNUNET_CONVERSATION_EC_CALL_PICKED_UP);
     call->speaker->enable_speaker (call->speaker->cls);
     call->mic->enable_microphone (call->mic->cls,
                                   &transmit_call_audio,
                                   call);
+    call->event_handler (call->event_handler_cls,
+                         GNUNET_CONVERSATION_EC_CALL_PICKED_UP);
     break;
   case CS_SUSPENDED_CALLER:
   case CS_SUSPENDED_CALLEE:
@@ -456,10 +456,13 @@ call_error_handler (void *cls,
 {
   struct GNUNET_CONVERSATION_Call *call = cls;
 
-  GNUNET_break (0);
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-              _("Internal MQ error %d\n"),
-              error);
+  if (CS_SHUTDOWN == call->state)
+  {
+    GNUNET_CONVERSATION_call_stop (call);
+    return;
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+              _("Connection to conversation service lost, trying to reconnect\n"));
   reconnect_call (call);
 }