call API to the conversation service More...
#include "platform.h"
#include "gnunet_conversation_service.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_gns_service.h"
#include "conversation.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CONVERSATION_Call |
Handle for an outgoing call. More... | |
Enumerations | |
enum | CallState { CS_LOOKUP = 0 , CS_RINGING , CS_ACTIVE , CS_SHUTDOWN , CS_SUSPENDED_CALLER , CS_SUSPENDED_CALLEE , CS_SUSPENDED_BOTH , CS_RESOLVING , CS_RINGING , CS_CONNECTED , CS_SUSPENDED } |
Possible states of the phone. More... | |
call API to the conversation service
Definition in file conversation_api_call.c.
enum CallState |
Possible states of the phone.
Definition at line 38 of file conversation_api_call.c.
|
static |
The call got disconnected, reconnect to the service.
The call got disconnected, destroy the handle.
call | call to reconnect |
Definition at line 532 of file conversation_api_call.c.
References call, GNUNET_MICROPHONE_Handle::cls, GNUNET_SPEAKER_Handle::cls, CS_ACTIVE, CS_SHUTDOWN, GNUNET_MICROPHONE_Handle::disable_microphone, GNUNET_SPEAKER_Handle::disable_speaker, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_ERROR, GNUNET_MQ_destroy(), GNUNET_CONVERSATION_Call::mic, GNUNET_CONVERSATION_Call::mq, GNUNET_CONVERSATION_Call::speaker, and GNUNET_CONVERSATION_Call::state.
Referenced by call_error_handler(), handle_call_audio(), handle_call_hangup(), handle_call_picked_up(), handle_call_resume(), and handle_call_suspend().
|
static |
Process recorded audio data.
cls | closure with the struct GNUNET_CONVERSATION_Call |
data_size | number of bytes in data |
data | audio data to play |
Definition at line 161 of file conversation_api_call.c.
References call, CS_ACTIVE, data, data_size, GNUNET_assert, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_CONVERSATION_Call::mq, and GNUNET_CONVERSATION_Call::state.
Referenced by GNUNET_CONVERSATION_call_resume(), handle_call_picked_up(), and handle_call_resume().
|
static |
We received a GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND.
cls | the struct GNUNET_CONVERSATION_Call |
msg | the message |
Definition at line 188 of file conversation_api_call.c.
References call, GNUNET_MICROPHONE_Handle::cls, GNUNET_SPEAKER_Handle::cls, CS_ACTIVE, CS_LOOKUP, CS_RINGING, CS_SHUTDOWN, CS_SUSPENDED_BOTH, CS_SUSPENDED_CALLEE, CS_SUSPENDED_CALLER, GNUNET_MICROPHONE_Handle::disable_microphone, GNUNET_SPEAKER_Handle::disable_speaker, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, fail_call(), GNUNET_break, GNUNET_break_op, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_SUSPENDED, GNUNET_CONVERSATION_Call::mic, msg, GNUNET_CONVERSATION_Call::speaker, and GNUNET_CONVERSATION_Call::state.
|
static |
We received a GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME.
cls | the struct GNUNET_CONVERSATION_Call |
msg | the message |
Definition at line 239 of file conversation_api_call.c.
References call, GNUNET_MICROPHONE_Handle::cls, GNUNET_SPEAKER_Handle::cls, CS_ACTIVE, CS_LOOKUP, CS_RINGING, CS_SHUTDOWN, CS_SUSPENDED_BOTH, CS_SUSPENDED_CALLEE, CS_SUSPENDED_CALLER, GNUNET_MICROPHONE_Handle::enable_microphone, GNUNET_SPEAKER_Handle::enable_speaker, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, fail_call(), GNUNET_break, GNUNET_break_op, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_RESUMED, GNUNET_CONVERSATION_Call::mic, msg, GNUNET_CONVERSATION_Call::speaker, GNUNET_CONVERSATION_Call::state, and transmit_call_audio().
|
static |
We received a GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP.
cls | the struct GNUNET_CONVERSATION_Call |
msg | the message |
Definition at line 295 of file conversation_api_call.c.
References call, GNUNET_MICROPHONE_Handle::cls, GNUNET_SPEAKER_Handle::cls, CS_ACTIVE, CS_LOOKUP, CS_RINGING, CS_SHUTDOWN, CS_SUSPENDED_BOTH, CS_SUSPENDED_CALLEE, CS_SUSPENDED_CALLER, GNUNET_MICROPHONE_Handle::enable_microphone, GNUNET_SPEAKER_Handle::enable_speaker, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, fail_call(), GNUNET_break, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_PICKED_UP, GNUNET_CONVERSATION_Call::mic, msg, GNUNET_CONVERSATION_Call::speaker, GNUNET_CONVERSATION_Call::state, and transmit_call_audio().
|
static |
We received a #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_HANG_UP.
cls | the struct GNUNET_CONVERSATION_Call |
msg | the message |
Definition at line 340 of file conversation_api_call.c.
References call, CS_ACTIVE, CS_LOOKUP, CS_RINGING, CS_SHUTDOWN, CS_SUSPENDED_BOTH, CS_SUSPENDED_CALLEE, CS_SUSPENDED_CALLER, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, fail_call(), GNUNET_break, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_HUNG_UP, msg, and GNUNET_CONVERSATION_Call::state.
|
static |
We received a struct ClientAudioMessage
, check it is well-formed.
cls | the struct GNUNET_CONVERSATION_Call |
am | the message |
Definition at line 382 of file conversation_api_call.c.
References GNUNET_OK.
|
static |
We received a struct ClientAudioMessage
cls | the struct GNUNET_CONVERSATION_Call |
am | the message |
Definition at line 399 of file conversation_api_call.c.
References call, GNUNET_SPEAKER_Handle::cls, CS_ACTIVE, CS_LOOKUP, CS_RINGING, CS_SHUTDOWN, CS_SUSPENDED_BOTH, CS_SUSPENDED_CALLEE, CS_SUSPENDED_CALLER, fail_call(), GNUNET_break, GNUNET_CONVERSATION_call_stop(), ClientAudioMessage::header, GNUNET_SPEAKER_Handle::play, GNUNET_MessageHeader::size, GNUNET_CONVERSATION_Call::speaker, and GNUNET_CONVERSATION_Call::state.
|
static |
Iterator called on obtained result for a GNS lookup.
cls | closure with the struct GNUNET_CONVERSATION_Call |
was_gns | GNUNET_NO if name was not a GNS name |
rd_count | number of records in rd |
rd | the records in reply |
Definition at line 450 of file conversation_api_call.c.
References call, GNUNET_CONVERSATION_Call::caller_id, CS_LOOKUP, CS_RINGING, GNUNET_GNSRECORD_Data::data, data_size, GNUNET_GNSRECORD_Data::data_size, GNUNET_CONVERSATION_Call::event_handler, GNUNET_CONVERSATION_Call::event_handler_cls, GNUNET_CONVERSATION_Call::gns_lookup, GNUNET_break, GNUNET_break_op, GNUNET_CONVERSATION_call_stop(), GNUNET_CONVERSATION_EC_CALL_GNS_FAIL, GNUNET_CONVERSATION_EC_CALL_RINGING, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_GNSRECORD_TYPE_PHONE, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), ClientCallMessage::key_len, ClientCallMessage::line_port, GNUNET_CONVERSATION_PhoneRecord::line_port, GNUNET_CONVERSATION_Call::mq, GNUNET_CONVERSATION_PhoneRecord::peer, GNUNET_CONVERSATION_Call::phone_record, rd, rd_count, GNUNET_CONVERSATION_Call::state, and ClientCallMessage::target.
Referenced by GNUNET_CONVERSATION_call_start().
|
static |
We encountered an error talking with the conversation service.
cls | the struct GNUNET_CONVERSATION_Call |
error | details about the error |
Definition at line 508 of file conversation_api_call.c.
References _, call, CS_SHUTDOWN, fail_call(), GNUNET_CONVERSATION_call_stop(), GNUNET_ERROR_TYPE_WARNING, GNUNET_log, and GNUNET_CONVERSATION_Call::state.
Referenced by GNUNET_CONVERSATION_call_start().