phone_state = PS_LOOKUP_EGO;
return;
}
+ GNUNET_assert (NULL == phone);
phone = GNUNET_CONVERSATION_phone_create (cfg,
caller_id,
&phone_event_handler, NULL);
{
case GNUNET_CONVERSATION_EC_CALL_RINGING:
GNUNET_break (CS_RESOLVING == call_state);
- if (verbose)
- FPRINTF (stdout,
- "%s",
- _("Resolved address. Now ringing other party.\n"));
+ FPRINTF (stdout,
+ _("Resolved address of `%s'. Now ringing other party.\n"),
+ peer_name);
call_state = CS_RINGING;
break;
case GNUNET_CONVERSATION_EC_CALL_PICKED_UP:
GNUNET_free_non_null (peer_name);
peer_name = GNUNET_strdup (arg);
call_state = CS_RESOLVING;
+ GNUNET_assert (NULL == call);
call = GNUNET_CONVERSATION_call_start (cfg,
caller_id,
arg,
mic = NULL;
GNUNET_free (ego_name);
ego_name = NULL;
- GNUNET_CONFIGURATION_destroy (cfg);
- cfg = NULL;
GNUNET_free_non_null (peer_name);
phone_state = PS_ERROR;
}
gettext_noop ("Enables having a conversation with other GNUnet users."),
options, &run, NULL);
GNUNET_free ((void *) argv);
+ if (NULL != cfg)
+ {
+ GNUNET_CONFIGURATION_destroy (cfg);
+ cfg = NULL;
+ }
return (GNUNET_OK == ret) ? 0 : 1;
}
}
line = ch->line;
*channel_ctx = NULL;
- hup.header.size = sizeof (hup);
+ hup.header.size = htons (sizeof (hup));
hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
hup.cid = ch->cid;
status = ch->status;
mq_done_finish_caller_shutdown (ch);
return GNUNET_SYSERR;
}
- pick.header.size = sizeof (pick);
+ pick.header.size = htons (sizeof (pick));
pick.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP);
pick.cid = ch->cid;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
return GNUNET_SYSERR;
}
line = ch->line;
- suspend.header.size = sizeof (suspend);
+ suspend.header.size = htons (sizeof (suspend));
suspend.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND);
suspend.cid = ch->cid;
GNUNET_MESH_receive_done (channel);
return GNUNET_SYSERR;
}
line = ch->line;
- resume.header.size = sizeof (resume);
+ resume.header.size = htons (sizeof (resume));
resume.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME);
resume.cid = ch->cid;
GNUNET_MESH_receive_done (channel);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Mesh channel destroyed by mesh in state %d\n",
ch->status);
- hup.header.size = sizeof (hup);
+ hup.header.size = htons (sizeof (hup));
hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
hup.cid = ch->cid;
switch (ch->status)