50 #ifndef GNUNET_CONVERSATION_SERVICE_H 51 #define GNUNET_CONVERSATION_SERVICE_H 71 #define GNUNET_CONVERSATION_VERSION 0x00000004 void(* GNUNET_CONVERSATION_CallEventHandler)(void *cls, enum GNUNET_CONVERSATION_CallEventCode code)
Function called with an event emitted for a call.
struct GNUNET_PeerIdentity peer
Identity of the peer hosting the phone service.
static struct GNUNET_CONVERSATION_Phone * phone
Phone handle.
struct GNUNET_IDENTITY_PublicKey caller_id
Identity of the person calling us.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
GNUNET_CONVERSATION_PhoneEventHandler event_handler
Function to call for phone events.
We are the caller and the callee suspended the call.
void GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller)
Hang up up a (possibly ringing or paused) phone.
We are the callee and the caller resumed the call.
struct GNUNET_IDENTITY_Ego * caller_id
Our caller identity.
void GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, struct GNUNET_GNSRECORD_Data *rd)
Fill in a namestore record with the contact information for this phone.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
static struct GNUNET_MICROPHONE_Handle * mic
Our microphone.
We are the caller and are now ready to talk as the callee picked up.
A phone is a device that can ring to signal an incoming call and that you can pick up to answer the c...
A phone record specifies which peer is hosting a given user and may also specify the phone line that ...
void * event_handler_cls
Closure for event_handler.
void * event_handler_cls
Closure for event_handler.
char * callee
Target callee as a GNS address/name.
void GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic)
Resumes a call after GNUNET_CONVERSATION_call_suspend.
void GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone)
Destroys a phone.
We are the caller and are now ringing the other party (GNS lookup succeeded).
We are the caller and the callee called GNUNET_CONVERSATION_caller_hang_up.
struct GNUNET_CONVERSATION_Call * GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_IDENTITY_Ego *caller_id, const char *callee, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic, GNUNET_CONVERSATION_CallEventHandler event_handler, void *event_handler_cls)
Call the phone of another user.
A caller is the handle we have for an incoming call.
The conversation was terminated by the caller.
void GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, GNUNET_CONVERSATION_CallerEventHandler event_handler, void *event_handler_cls, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic)
Picks up a (ringing) phone call.
We are the caller and failed to locate a phone record in GNS.
GNUNET_CONVERSATION_CallerEventCode
Information about the current status of a call.
uint32_t version
Version of the phone record, for now always one.
void GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic)
Resume suspended conversation of a phone.
We are the callee and the caller suspended the call.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
static struct GNUNET_CONVERSATION_Call * call
Call handle (for active outgoing call).
The identity of the host (wraps the signing key of the peer).
An identity key as per LSD0001.
void GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller)
Pause conversation of an active call.
#define GNUNET_PACKED
gcc-ism to get packed structs.
struct GNUNET_CONVERSATION_Phone * GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_IDENTITY_Ego *ego, GNUNET_CONVERSATION_PhoneEventHandler event_handler, void *event_handler_cls)
Create a new phone.
We are the callee and the phone is ringing.
struct GNUNET_HashCode line_port
Phone line (CADET port) to connect to.
void GNUNET_CONVERSATION_call_stop(struct GNUNET_CONVERSATION_Call *call)
Terminate a call.
We are the caller and the callee suspended the call.
GNUNET_CONVERSATION_CallEventHandler event_handler
Function to call with events.
Handle for an outgoing call.
GNUNET_CONVERSATION_CallEventCode
Information about the current status of a call.
A microphone is a device that can capture or otherwise produce audio data.
We had an error handing the call, and are now restarting it (back to lookup).
void(* GNUNET_CONVERSATION_PhoneEventHandler)(void *cls, enum GNUNET_CONVERSATION_PhoneEventCode code, struct GNUNET_CONVERSATION_Caller *caller, const struct GNUNET_IDENTITY_PublicKey *caller_id)
Function called with an event emitted by a phone.
uint32_t reserved
Reserved.
A speaker is a device that can play or record audio data.
void GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call)
Pause a call.
GNUNET_CONVERSATION_PhoneEventCode
Information about active callers to a phone.
static struct GNUNET_SPEAKER_Handle * speaker
Handle to the speaker.
void(* GNUNET_CONVERSATION_CallerEventHandler)(void *cls, enum GNUNET_CONVERSATION_CallerEventCode code)
Function called with an event emitted by a caller.