commit a0ce326e5d3ad4275cff23de7a7916e492e54a33 parent aece72e29b041e2dfbc5b49d2fd0d49f8ab2124e Author: Christian Grothoff <christian@grothoff.org> Date: Fri, 6 Jun 2014 08:57:09 +0000 -allow caller ID to differ from zone used for resolution Diffstat:
7 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c @@ -289,7 +289,7 @@ handle_phone_ring (void *cls, /** * We received a `struct ClientPhoneHangupMessage`. * - * @param cls the `struct GNUNET_CONVERSATION_Phone` + * @param cls the `struct GNUNET_CONVERSATION_Phone *` * @param msg the message */ static void diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c @@ -96,6 +96,11 @@ struct GNUNET_CONVERSATION_Call 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. */ char *callee; @@ -530,7 +535,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) &call_error_handler, call); call->state = CS_LOOKUP; - GNUNET_IDENTITY_ego_get_public_key (call->caller_id, + GNUNET_IDENTITY_ego_get_public_key (call->zone_id, &my_zone); call->gns_lookup = GNUNET_GNS_lookup (call->gns, call->callee, @@ -548,6 +553,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *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 @@ -560,6 +566,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) 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, @@ -571,6 +578,7 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, call = GNUNET_new (struct GNUNET_CONVERSATION_Call); call->cfg = cfg; call->caller_id = caller_id; + call->zone_id = zone_id; call->callee = GNUNET_strdup (callee); call->speaker = speaker; call->mic = mic; diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c @@ -558,6 +558,7 @@ do_call (const char *arg) GNUNET_assert (NULL == call); call = GNUNET_CONVERSATION_call_start (cfg, my_caller_id, + my_caller_id, arg, speaker, mic, diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c @@ -458,6 +458,7 @@ identity_cb (void *cls, GNUNET_GNSRECORD_pkey_to_zkey (&pub)); call = GNUNET_CONVERSATION_call_start (cfg, ego, + ego, gns_name, &call_speaker, &call_mic, diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c @@ -291,6 +291,7 @@ identity_cb (void *cls, GNUNET_GNSRECORD_pkey_to_zkey (&pub)); call = GNUNET_CONVERSATION_call_start (cfg, ego, + ego, gns_name, &call_speaker, &call_mic, diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c @@ -560,6 +560,7 @@ identity_cb (void *cls, GNUNET_GNSRECORD_pkey_to_zkey (&pub)); call1 = GNUNET_CONVERSATION_call_start (cfg, ego, + ego, gns_name, &call1_speaker, &call1_mic, @@ -567,6 +568,7 @@ identity_cb (void *cls, (void *) "call1"); call2 = GNUNET_CONVERSATION_call_start (cfg, ego, + ego, gns_name, &call2_speaker, &call2_mic, diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h @@ -363,6 +363,7 @@ typedef void * * @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 @@ -376,6 +377,7 @@ typedef void 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,