aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/conversation_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-05 18:17:37 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-05 18:17:37 +0000
commit23fe13890f31317cc2ab86ef55264622ed72375f (patch)
treeb07ba0c79131fcc4cb524f8870dc98b09226dbfb /src/conversation/conversation_api.c
parent7de0ce15a52e32e4258d8008f8bbab3c71599a0e (diff)
downloadgnunet-23fe13890f31317cc2ab86ef55264622ed72375f.tar.gz
gnunet-23fe13890f31317cc2ab86ef55264622ed72375f.zip
-fix message type
Diffstat (limited to 'src/conversation/conversation_api.c')
-rw-r--r--src/conversation/conversation_api.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index 0ad85131c..671315f74 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -980,7 +980,14 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call)
980 0 }, 980 0 },
981 { NULL, 0, 0 } 981 { NULL, 0, 0 }
982 }; 982 };
983 if (NULL != call->mq) 983 struct GNUNET_CRYPTO_EccPublicSignKey my_zone;
984
985 if (CS_ACTIVE == call->state)
986 {
987 call->speaker->disable_speaker (call->speaker->cls);
988 call->mic->disable_microphone (call->mic->cls);
989 }
990 if (NULL != call->mq)
984 { 991 {
985 GNUNET_MQ_destroy (call->mq); 992 GNUNET_MQ_destroy (call->mq);
986 call->mq = NULL; 993 call->mq = NULL;
@@ -990,6 +997,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call)
990 GNUNET_CLIENT_disconnect (call->client); 997 GNUNET_CLIENT_disconnect (call->client);
991 call->client = NULL; 998 call->client = NULL;
992 } 999 }
1000 call->state = CS_SHUTDOWN;
993 call->client = GNUNET_CLIENT_connect ("conversation", call->cfg); 1001 call->client = GNUNET_CLIENT_connect ("conversation", call->cfg);
994 if (NULL == call->client) 1002 if (NULL == call->client)
995 return; 1003 return;
@@ -997,6 +1005,17 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call)
997 handlers, 1005 handlers,
998 &call_error_handler, 1006 &call_error_handler,
999 call); 1007 call);
1008 call->state = CS_LOOKUP;
1009 GNUNET_IDENTITY_ego_get_public_key (call->caller_id,
1010 &my_zone);
1011 call->gns_lookup = GNUNET_GNS_lookup (call->gns,
1012 call->callee,
1013 &my_zone,
1014 GNUNET_NAMESTORE_TYPE_PHONE,
1015 GNUNET_NO,
1016 NULL /* FIXME: add shortening support */,
1017 &handle_gns_response, call);
1018 GNUNET_assert (NULL != call->gns_lookup);
1000} 1019}
1001 1020
1002 1021
@@ -1024,10 +1043,7 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1024 void *event_handler_cls) 1043 void *event_handler_cls)
1025{ 1044{
1026 struct GNUNET_CONVERSATION_Call *call; 1045 struct GNUNET_CONVERSATION_Call *call;
1027 struct GNUNET_CRYPTO_EccPublicSignKey my_zone;
1028 1046
1029 GNUNET_IDENTITY_ego_get_public_key (caller_id,
1030 &my_zone);
1031 call = GNUNET_new (struct GNUNET_CONVERSATION_Call); 1047 call = GNUNET_new (struct GNUNET_CONVERSATION_Call);
1032 call->cfg = cfg; 1048 call->cfg = cfg;
1033 call->caller_id = caller_id; 1049 call->caller_id = caller_id;
@@ -1045,13 +1061,6 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1045 GNUNET_CONVERSATION_call_stop (call, NULL); 1061 GNUNET_CONVERSATION_call_stop (call, NULL);
1046 return NULL; 1062 return NULL;
1047 } 1063 }
1048 call->gns_lookup = GNUNET_GNS_lookup (call->gns, callee,
1049 &my_zone,
1050 GNUNET_NAMESTORE_TYPE_PHONE,
1051 GNUNET_NO,
1052 NULL /* FIXME: add shortening support */,
1053 &handle_gns_response, call);
1054 GNUNET_assert (NULL != call->gns_lookup);
1055 return call; 1064 return call;
1056} 1065}
1057 1066
@@ -1105,7 +1114,7 @@ GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call,
1105 GNUNET_GNS_disconnect (call->gns); 1114 GNUNET_GNS_disconnect (call->gns);
1106 call->gns = NULL; 1115 call->gns = NULL;
1107 } 1116 }
1108 1117 GNUNET_free (call->callee);
1109 GNUNET_free (call); 1118 GNUNET_free (call);
1110} 1119}
1111 1120