#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_conversation_service.h"
+#include "gnunet_namestore_service.h"
/**
*/
static enum ConversationState state;
+/**
+ * GNS address for this phone.
+ */
+static char *address;
+
/**
* Be verbose.
*/
static void
start_phone ()
{
+ struct GNUNET_NAMESTORE_RecordData rd;
+
if (NULL == caller_id)
{
FPRINTF (stderr,
}
else
{
+ GNUNET_CONVERSATION_phone_get_record (phone,
+ &rd);
+ GNUNET_free_non_null (address);
+ address = GNUNET_NAMESTORE_value_to_string (rd.record_type,
+ rd.data,
+ rd.data_size);
if (verbose)
FPRINTF (stdout,
_("Phone active on line %u\n"),
case GNUNET_CONVERSATION_EC_READY:
GNUNET_break (CS_RINGING == state);
FPRINTF (stdout,
- _("Connection established: %s\n"),
+ _("Connection established to `%s': %s\n"),
+ peer_name,
va_arg (va, const char *));
state = CS_CONNECTED;
break;
case GNUNET_CONVERSATION_EC_GNS_FAIL:
GNUNET_break (CS_RESOLVING == state);
FPRINTF (stdout,
- "%s",
- _("Failed to resolve name\n"));
+ _("Failed to resolve `%s'\n"),
+ ego_name);
GNUNET_CONVERSATION_call_stop (call, NULL);
call = NULL;
start_phone ();
}
+/**
+ * Print address information for this phone.
+ *
+ * @param args arguments given to the command
+ */
+static void
+do_address (const char *args)
+{
+ if (NULL == address)
+ {
+ FPRINTF (stdout,
+ "%s",
+ _("We currently do not have an address.\n"));
+ return;
+ }
+ FPRINTF (stdout,
+ "%s\n",
+ address);
+}
+
+
/**
* Accepting an incoming call
*
* List of supported commands.
*/
static struct VoipCommand commands[] = {
+ {"/address", &do_address,
+ gettext_noop ("Use `/address' to find out which address this phone should have in GNS")},
{"/call", &do_call,
- gettext_noop ("Use `/call USER.gnu'")},
+ gettext_noop ("Use `/call USER.gnu' to call USER")},
{"/accept", &do_accept,
gettext_noop ("Use `/accept MESSAGE' to accept an incoming call")},
{"/cancel", &do_reject,
gettext_noop ("Use `/cancel MESSAGE' to reject or terminate a call")},
{"/status", &do_status,
- gettext_noop ("Use `/status to print status information")},
+ gettext_noop ("Use `/status' to print status information")},
{"/quit", &do_quit,
gettext_noop ("Use `/quit' to terminate gnunet-conversation")},
{"/help", &do_help,