summaryrefslogtreecommitdiff
path: root/src/include/gnunet_conversation_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_conversation_service.h')
-rw-r--r--src/include/gnunet_conversation_service.h89
1 files changed, 51 insertions, 38 deletions
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h
index a15e71f0d..4566caad0 100644
--- a/src/include/gnunet_conversation_service.h
+++ b/src/include/gnunet_conversation_service.h
@@ -86,7 +86,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
86 * may also specify the phone line that is used (typically zero). 86 * may also specify the phone line that is used (typically zero).
87 * The version is also right now always zero. 87 * The version is also right now always zero.
88 */ 88 */
89struct GNUNET_CONVERSATION_PhoneRecord { 89struct GNUNET_CONVERSATION_PhoneRecord
90{
90 /** 91 /**
91 * Version of the phone record, for now always one. We may 92 * Version of the phone record, for now always one. We may
92 * use other versions for anonymously hosted phone lines in 93 * use other versions for anonymously hosted phone lines in
@@ -115,7 +116,8 @@ GNUNET_NETWORK_STRUCT_END
115/** 116/**
116 * Information about active callers to a phone. 117 * Information about active callers to a phone.
117 */ 118 */
118enum GNUNET_CONVERSATION_PhoneEventCode { 119enum GNUNET_CONVERSATION_PhoneEventCode
120{
119 /** 121 /**
120 * We are the callee and the phone is ringing. 122 * We are the callee and the phone is ringing.
121 * We should accept the call or hang up. 123 * We should accept the call or hang up.
@@ -140,9 +142,12 @@ enum GNUNET_CONVERSATION_PhoneEventCode {
140 */ 142 */
141typedef void 143typedef void
142(*GNUNET_CONVERSATION_PhoneEventHandler)(void *cls, 144(*GNUNET_CONVERSATION_PhoneEventHandler)(void *cls,
143 enum GNUNET_CONVERSATION_PhoneEventCode code, 145 enum GNUNET_CONVERSATION_PhoneEventCode
144 struct GNUNET_CONVERSATION_Caller *caller, 146 code,
145 const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id); 147 struct GNUNET_CONVERSATION_Caller *
148 caller,
149 const struct
150 GNUNET_CRYPTO_EcdsaPublicKey *caller_id);
146 151
147 152
148/** 153/**
@@ -150,7 +155,8 @@ typedef void
150 * progresses from ring over ready to terminated. Steps may 155 * progresses from ring over ready to terminated. Steps may
151 * be skipped. 156 * be skipped.
152 */ 157 */
153enum GNUNET_CONVERSATION_CallerEventCode { 158enum GNUNET_CONVERSATION_CallerEventCode
159{
154 /** 160 /**
155 * We are the callee and the caller suspended the call. Note that 161 * We are the callee and the caller suspended the call. Note that
156 * both sides can independently suspend and resume calls; a call is 162 * both sides can independently suspend and resume calls; a call is
@@ -177,7 +183,9 @@ enum GNUNET_CONVERSATION_CallerEventCode {
177 */ 183 */
178typedef void 184typedef void
179(*GNUNET_CONVERSATION_CallerEventHandler)(void *cls, 185(*GNUNET_CONVERSATION_CallerEventHandler)(void *cls,
180 enum GNUNET_CONVERSATION_CallerEventCode code); 186 enum
187 GNUNET_CONVERSATION_CallerEventCode
188 code);
181 189
182 190
183/** 191/**
@@ -204,10 +212,11 @@ struct GNUNET_CONVERSATION_Phone;
204 * @param event_handler_cls closure for @a event_handler 212 * @param event_handler_cls closure for @a event_handler
205 */ 213 */
206struct GNUNET_CONVERSATION_Phone * 214struct GNUNET_CONVERSATION_Phone *
207GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 215GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
208 const struct GNUNET_IDENTITY_Ego *ego, 216 const struct GNUNET_IDENTITY_Ego *ego,
209 GNUNET_CONVERSATION_PhoneEventHandler event_handler, 217 GNUNET_CONVERSATION_PhoneEventHandler
210 void *event_handler_cls); 218 event_handler,
219 void *event_handler_cls);
211 220
212 221
213/** 222/**
@@ -219,8 +228,8 @@ GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg,
219 * @param rd namestore record to fill in 228 * @param rd namestore record to fill in
220 */ 229 */
221void 230void
222GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, 231GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone,
223 struct GNUNET_GNSRECORD_Data *rd); 232 struct GNUNET_GNSRECORD_Data *rd);
224 233
225 234
226/** 235/**
@@ -234,11 +243,12 @@ GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone,
234 * @param mic microphone to use 243 * @param mic microphone to use
235 */ 244 */
236void 245void
237GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, 246GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller,
238 GNUNET_CONVERSATION_CallerEventHandler event_handler, 247 GNUNET_CONVERSATION_CallerEventHandler
239 void *event_handler_cls, 248 event_handler,
240 struct GNUNET_SPEAKER_Handle *speaker, 249 void *event_handler_cls,
241 struct GNUNET_MICROPHONE_Handle *mic); 250 struct GNUNET_SPEAKER_Handle *speaker,
251 struct GNUNET_MICROPHONE_Handle *mic);
242 252
243 253
244/** 254/**
@@ -249,7 +259,7 @@ GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller,
249 * @param caller call to suspend 259 * @param caller call to suspend
250 */ 260 */
251void 261void
252GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller); 262GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller);
253 263
254 264
255/** 265/**
@@ -260,9 +270,9 @@ GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller);
260 * @param mic microphone to use 270 * @param mic microphone to use
261 */ 271 */
262void 272void
263GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, 273GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller,
264 struct GNUNET_SPEAKER_Handle *speaker, 274 struct GNUNET_SPEAKER_Handle *speaker,
265 struct GNUNET_MICROPHONE_Handle *mic); 275 struct GNUNET_MICROPHONE_Handle *mic);
266 276
267 277
268/** 278/**
@@ -272,7 +282,7 @@ GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller,
272 * @param caller who should we hang up on 282 * @param caller who should we hang up on
273 */ 283 */
274void 284void
275GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller); 285GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller);
276 286
277 287
278/** 288/**
@@ -281,7 +291,7 @@ GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller);
281 * @param phone phone to destroy 291 * @param phone phone to destroy
282 */ 292 */
283void 293void
284GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone); 294GNUNET_CONVERSATION_phone_destroy (struct GNUNET_CONVERSATION_Phone *phone);
285 295
286 296
287/* *********************** CALL API ************************ */ 297/* *********************** CALL API ************************ */
@@ -295,7 +305,8 @@ struct GNUNET_CONVERSATION_Call;
295/** 305/**
296 * Information about the current status of a call. 306 * Information about the current status of a call.
297 */ 307 */
298enum GNUNET_CONVERSATION_CallEventCode { 308enum GNUNET_CONVERSATION_CallEventCode
309{
299 /** 310 /**
300 * We are the caller and are now ringing the other party (GNS lookup 311 * We are the caller and are now ringing the other party (GNS lookup
301 * succeeded). 312 * succeeded).
@@ -355,7 +366,8 @@ enum GNUNET_CONVERSATION_CallEventCode {
355 */ 366 */
356typedef void 367typedef void
357(*GNUNET_CONVERSATION_CallEventHandler)(void *cls, 368(*GNUNET_CONVERSATION_CallEventHandler)(void *cls,
358 enum GNUNET_CONVERSATION_CallEventCode code); 369 enum GNUNET_CONVERSATION_CallEventCode
370 code);
359 371
360 372
361/** 373/**
@@ -374,13 +386,14 @@ typedef void
374 * @return handle for the call 386 * @return handle for the call
375 */ 387 */
376struct GNUNET_CONVERSATION_Call * 388struct GNUNET_CONVERSATION_Call *
377GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 389GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
378 struct GNUNET_IDENTITY_Ego *caller_id, 390 struct GNUNET_IDENTITY_Ego *caller_id,
379 const char *callee, 391 const char *callee,
380 struct GNUNET_SPEAKER_Handle *speaker, 392 struct GNUNET_SPEAKER_Handle *speaker,
381 struct GNUNET_MICROPHONE_Handle *mic, 393 struct GNUNET_MICROPHONE_Handle *mic,
382 GNUNET_CONVERSATION_CallEventHandler event_handler, 394 GNUNET_CONVERSATION_CallEventHandler
383 void *event_handler_cls); 395 event_handler,
396 void *event_handler_cls);
384 397
385 398
386/** 399/**
@@ -390,7 +403,7 @@ GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
390 * @param call call to pause 403 * @param call call to pause
391 */ 404 */
392void 405void
393GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call); 406GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call);
394 407
395 408
396/** 409/**
@@ -401,9 +414,9 @@ GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call);
401 * @param mic microphone to use 414 * @param mic microphone to use
402 */ 415 */
403void 416void
404GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call, 417GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call,
405 struct GNUNET_SPEAKER_Handle *speaker, 418 struct GNUNET_SPEAKER_Handle *speaker,
406 struct GNUNET_MICROPHONE_Handle *mic); 419 struct GNUNET_MICROPHONE_Handle *mic);
407 420
408 421
409/** 422/**
@@ -412,7 +425,7 @@ GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call,
412 * @param call call to terminate 425 * @param call call to terminate
413 */ 426 */
414void 427void
415GNUNET_CONVERSATION_call_stop(struct GNUNET_CONVERSATION_Call *call); 428GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call);
416 429
417 430
418#if 0 /* keep Emacsens' auto-indent happy */ 431#if 0 /* keep Emacsens' auto-indent happy */