Use the configuration file FILENAME.
.B
.IP "\-e NAME, \-\-ego=NAME"
-Specifies the NAME of the ego to use (for caller ID) and the GNS master zone for our own lookups.
+Specifies the NAME of the ego to use (for caller ID).
.B
.IP "\-h, \-\-help"
Print short help on options.
*/
#include "platform.h"
#include "gnunet_conversation_service.h"
-#include "gnunet_gnsrecord_lib.h"
-#include "gnunet_gns_service.h"
#include "conversation.h"
check_phone_audio (void *cls,
const struct ClientAudioMessage *am)
{
+ (void) cls;
+ (void) am;
+
/* any variable-size payload is OK */
return GNUNET_OK;
}
{
struct GNUNET_CONVERSATION_Phone *phone = cls;
+ (void) error;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Connection to conversation service lost, trying to reconnect\n"));
reconnect_phone (phone);
*/
struct GNUNET_IDENTITY_Ego *caller_id;
- /**
- * GNS zone to use to resolve @e callee.
- */
- struct GNUNET_IDENTITY_Ego *zone_id;
-
/**
* Target callee as a GNS address/name.
*/
/**
* Active GNS lookup (or NULL).
*/
- struct GNUNET_GNS_LookupRequest *gns_lookup;
+ struct GNUNET_GNS_LookupWithTldRequest *gns_lookup;
/**
* Target phone record, only valid after the lookup is done.
{
struct GNUNET_CONVERSATION_Call *call = cls;
+ (void) msg;
switch (call->state)
{
case CS_LOOKUP:
{
struct GNUNET_CONVERSATION_Call *call = cls;
+ (void) msg;
switch (call->state)
{
case CS_LOOKUP:
{
struct GNUNET_CONVERSATION_Call *call = cls;
+ (void) msg;
switch (call->state)
{
case CS_LOOKUP:
GNUNET_CONVERSATION_CallEventHandler eh;
void *eh_cls;
+ (void) msg;
switch (call->state)
{
case CS_LOOKUP:
check_call_audio (void *cls,
const struct ClientAudioMessage *am)
{
+ (void) cls;
+ (void) am;
/* any payload is OK */
return GNUNET_OK;
}
* Iterator called on obtained result for a GNS lookup.
*
* @param cls closure with the `struct GNUNET_CONVERSATION_Call`
+ * @param was_gns #GNUNET_NO if name was not a GNS name
* @param rd_count number of records in @a rd
* @param rd the records in reply
*/
static void
handle_gns_response (void *cls,
+ int was_gns,
uint32_t rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
{
struct GNUNET_CONVERSATION_Call *call = cls;
- uint32_t i;
struct GNUNET_MQ_Envelope *e;
struct ClientCallMessage *ccm;
+ (void) was_gns;
GNUNET_break (NULL != call->gns_lookup);
GNUNET_break (CS_LOOKUP == call->state);
call->gns_lookup = NULL;
- for (i=0;i<rd_count;i++)
+ for (uint32_t i=0;i<rd_count;i++)
{
if (GNUNET_GNSRECORD_TYPE_PHONE == rd[i].record_type)
{
{
struct GNUNET_CONVERSATION_Call *call = cls;
+ (void) error;
if (CS_SHUTDOWN == call->state)
{
GNUNET_CONVERSATION_call_stop (call);
*
* @param cfg configuration to use, specifies our phone service
* @param caller_id identity of the caller
- * @param zone_id GNS zone to use to resolve @a callee
* @param callee GNS name of the callee (used to locate the callee's record)
* @param speaker speaker to use (will be used automatically immediately once the
* #GNUNET_CONVERSATION_EC_CALL_PICKED_UP event is generated); we will NOT generate
struct GNUNET_CONVERSATION_Call *
GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_IDENTITY_Ego *caller_id,
- struct GNUNET_IDENTITY_Ego *zone_id,
const char *callee,
struct GNUNET_SPEAKER_Handle *speaker,
struct GNUNET_MICROPHONE_Handle *mic,
call),
GNUNET_MQ_handler_end ()
};
- struct GNUNET_CRYPTO_EcdsaPublicKey my_zone;
call->mq = GNUNET_CLIENT_connect (cfg,
"conversation",
}
call->cfg = cfg;
call->caller_id = caller_id;
- call->zone_id = zone_id;
call->callee = GNUNET_strdup (callee);
call->speaker = speaker;
call->mic = mic;
return NULL;
}
call->state = CS_LOOKUP;
- GNUNET_IDENTITY_ego_get_public_key (call->zone_id,
- &my_zone);
- call->gns_lookup = GNUNET_GNS_lookup (call->gns,
- call->callee,
- &my_zone,
- GNUNET_GNSRECORD_TYPE_PHONE,
- GNUNET_NO,
- &handle_gns_response, call);
- GNUNET_assert (NULL != call->gns_lookup);
+ call->gns_lookup = GNUNET_GNS_lookup_with_tld (call->gns,
+ call->callee,
+ GNUNET_GNSRECORD_TYPE_PHONE,
+ GNUNET_NO,
+ &handle_gns_response,
+ call);
+ if (NULL == call->gns_lookup)
+ {
+ GNUNET_CONVERSATION_call_stop (call);
+ return NULL;
+ }
return call;
}
}
if (NULL != call->gns_lookup)
{
- GNUNET_GNS_lookup_cancel (call->gns_lookup);
+ GNUNET_GNS_lookup_with_tld_cancel (call->gns_lookup);
call->gns_lookup = NULL;
}
if (NULL != call->gns)
{
struct CallList *cl;
+ (void) cls;
switch (code)
{
case GNUNET_CONVERSATION_EC_PHONE_RING:
call_event_handler (void *cls,
enum GNUNET_CONVERSATION_CallEventCode code)
{
+ (void) cls;
+
switch (code)
{
case GNUNET_CONVERSATION_EC_CALL_RINGING:
*
* @param arguments arguments given to the function
*/
-typedef void (*ActionFunction) (const char *arguments);
+typedef void
+(*ActionFunction) (const char *arguments);
/**
static void
do_quit (const char *args)
{
+ (void) args;
GNUNET_SCHEDULER_shutdown ();
}
call_state = CS_RESOLVING;
GNUNET_assert (NULL == call);
call = GNUNET_CONVERSATION_call_start (cfg,
- my_caller_id,
my_caller_id,
arg,
speaker,
static void
do_address (const char *args)
{
+ (void) args;
if (NULL == address)
{
FPRINTF (stdout,
{
struct CallList *cl;
+ (void) args;
switch (phone_state)
{
case PS_LOOKUP_EGO:
static void
do_suspend (const char *args)
{
+ (void) args;
if (NULL != call)
{
switch (call_state)
static void
do_stop_task (void *cls)
{
+ (void) cls;
#ifdef WINDOWS
if (NULL != stdin_hlp)
{
{
char *chars;
size_t str_size;
+
+ (void) cls;
switch (ntohs (message->type))
{
case GNUNET_MESSAGE_TYPE_W32_CONSOLE_HELPER_CHARS:
}
#endif
+
/**
* Task to handle commands from the terminal.
*
{
char message[MAX_MESSAGE_LENGTH + 1];
+ (void) cls;
handle_cmd_task =
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
stdin_fh,
&handle_command, NULL);
/* read message from command line and handle it */
- memset (message, 0, MAX_MESSAGE_LENGTH + 1);
- if (NULL == fgets (message, MAX_MESSAGE_LENGTH, stdin))
+ memset (message,
+ 0,
+ MAX_MESSAGE_LENGTH + 1);
+ if (NULL == fgets (message,
+ MAX_MESSAGE_LENGTH,
+ stdin))
return;
- handle_command_string (message, strlen (message));
+ handle_command_string (message,
+ strlen (message));
}
void **ctx,
const char *name)
{
+ (void) cls;
+ (void) ctx;
if (NULL == name)
return;
if (ego == my_caller_id)
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
+ (void) cls;
+ (void) args;
+ (void) cfgfile;
cfg = GNUNET_CONFIGURATION_dup (c);
speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
mic = GNUNET_MICROPHONE_create_from_hardware (cfg);
* @return 0 ok, 1 on error
*/
int
-main (int argc, char *const *argv)
+main (int argc,
+ char *const *argv)
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
-
GNUNET_GETOPT_option_string ('e',
"ego",
"NAME",
- gettext_noop ("sets the NAME of the ego to use for the phone (and name resolution)"),
+ gettext_noop ("sets the NAME of the ego to use for the caller ID"),
&ego_name),
-
GNUNET_GETOPT_option_string ('p',
"phone",
"LINE",
gettext_noop ("sets the LINE to use for the phone"),
&line),
-
GNUNET_GETOPT_OPTION_END
};
int ret;
stdin_fh = GNUNET_DISK_get_handle_from_int_fd (0);
#endif
- if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
return 2;
- ret = GNUNET_PROGRAM_run (argc, argv,
+ ret = GNUNET_PROGRAM_run (argc,
+ argv,
"gnunet-conversation",
gettext_noop ("Enables having a conversation with other GNUnet users."),
- options, &run, NULL);
+ options,
+ &run, NULL);
GNUNET_free ((void *) argv);
if (NULL != cfg)
{
*
* @param cfg configuration to use, specifies our phone service
* @param caller_id identity of the caller
- * @param zone_id GNS zone to use to resolve @a callee
* @param callee GNS name of the callee (used to locate the callee's record)
* @param speaker speaker to use (will be used automatically immediately once the
* #GNUNET_CONVERSATION_EC_CALL_PICKED_UP event is generated); we will NOT generate
struct GNUNET_CONVERSATION_Call *
GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_IDENTITY_Ego *caller_id,
- struct GNUNET_IDENTITY_Ego *zone_id,
const char *callee,
struct GNUNET_SPEAKER_Handle *speaker,
struct GNUNET_MICROPHONE_Handle *mic,