-transmit termination reason also for caller hanging up
[oweals/gnunet.git] / src / conversation / conversation.h
index ff4795ef807ab5f3336243e0b86ba4c8bd1fdf73..4b42277a55fcf6fb3437d5c98f12079ef56735ea 100644 (file)
@@ -39,355 +39,6 @@ extern "C"
 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
 
-/************************************************************************************************************************
-* Messages for the Client <-> Server communication
-*/
-
-
-/**
- * VoipClient.
- */
-struct VoipClient
-{
-  /**
-   * Handle for a conversation client.
-   */
-  struct GNUNET_SERVER_Client *client;
-};
-
-/**
-* The connection status of the service
-*/
-struct ConnectionStatus
-{
-       /**
-       * The client which is in interaction
-       */
-  struct GNUNET_SERVER_Client *client;
-
-       /**
-       * The PeerIdentity of the peer
-       */
-  struct GNUNET_PeerIdentity peer;
-
-       /**
-       * The status (see enum)
-       */
-  int status;
-};
-
-/**
-* Information about a missed call
-*/
-struct MissedCall
-{
-       /**
-       * The PeerIdentity of the peer
-       */
-  struct GNUNET_PeerIdentity peer;
-
-       /**
-       * The time the call was
-       */
-  struct GNUNET_TIME_Absolute time;
-
-};
-
-
-
-
-/**
- * Client <-> Server message to initiate a new call
- */
-struct ClientServerSessionInitiateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE 
-   */
-  struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
-};
-
-
-/**
- * Client <-> Server meessage to accept an incoming call
- */
-struct ClientServerSessionAcceptMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Client <-> Server message to reject an incoming call
- */
-struct ClientServerSessionRejectMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT
-   */
-  struct GNUNET_MessageHeader header;
-  int reason;
-};
-
-
-/**
- * Client <-> Server message to terminat a call
- */
-struct ClientServerSessionTerminateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Client <-> Server message to initiate a new call
- */
-struct ClientServerTestMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST 
-   */
-  struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
-};
-
-/************************************************************************************************************************
-* Messages for the Server <-> Client communication
-*/
-
-/**
- * Server <-> Client message to initiate a new call
- */
-struct ServerClientSessionInitiateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE
-   */
-  struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
-};
-
-
-/**
- * Server <-> Client meessage to accept an incoming call
- */
-struct ServerClientSessionAcceptMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Server <-> Client message to reject an incoming call
- */
-struct ServerClientSessionRejectMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT 
-   */
-  struct GNUNET_MessageHeader header;
-  int reason;
-  int notify;
-};
-
-
-/**
- * Server <-> Client message to terminat a call
- */
-struct ServerClientSessionTerminateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Server <-> Client message to signalize the client that the service is already in use
- */
-struct ServerClientServiceBlockedMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-/**
- * Server <-> Client message to signalize the client that the called peer is not connected
- */
-struct ServerClientPeerNotConnectedMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Server <-> Client message to signalize the client that called peer does not answer
- */
-struct ServerClientNoAnswerMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-/**
- * Server <-> Client message to notify client of missed call
- */
-struct ServerClientMissedCallMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL 
-   */
-  struct GNUNET_MessageHeader header;
-  int number;
-  struct MissedCall *missed_call;
-};
-
-
-/**
- * Server <-> Client message to signalize the client that there occured an error
- */
-struct ServerClientErrorMessage
-{
-  /**
-   * Type is: #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-
-/**
- * Server <-> Client message to notify client of peer being available
- */
-struct ServerClientPeerAvailableMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE
-   */
-  struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
-  struct GNUNET_TIME_Absolute time;
-};
-
-/************************************************************************************************************************
-* Messages for the Mesh communication
-*/
-
-struct VoIPMeshMessageHeader
-{
-  /**
-   * Type is: 
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-};
-
-
-/**
- * Mesh message to sinal the remote peer the wish to initiate a new call
- */
-struct MeshSessionInitiateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  struct GNUNET_PeerIdentity peer;
-};
-
-/**
- * Mesh message to signal the remote peer the acceptance of an initiated call
- */
-struct MeshSessionAcceptMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-};
-
-
-/**
- * Mesh message to reject an a wish to initiate a new call
- */
-struct MeshSessionRejectMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT 
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  int reason;
-  int notify;
-};
-
-
-/**
- * Mesh message to signal a remote peer the terminatation of a call
- */
-struct MeshSessionTerminateMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE 
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-};
-
-
-/**
- * Server <-> Client message to notify client of peer being available
- */
-struct MeshPeerAvailableMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE 
-   */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  struct GNUNET_PeerIdentity peer;
-  struct GNUNET_TIME_Absolute call;
-};
-
-
-/**
- * Messages for the audio communication
- */
-struct TestMessage
-{
-  /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_TEST 
-   */
-  struct GNUNET_MessageHeader header;
-};
-
-////////////////////////////////////////////////////////////
-
 /**
  * Message to transmit the audio (between client and helpers).
  */
@@ -465,7 +116,7 @@ struct ClientPhonePickupMessage
    * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
    */
   struct GNUNET_MessageHeader header;
-  
+
   /* followed by variable length 0-terminated string with meta data */
 
 };
@@ -481,7 +132,7 @@ struct ClientPhoneHangupMessage
    * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
    */
   struct GNUNET_MessageHeader header;
-  
+
   /* followed by variable length 0-terminated string with meta data */
 
 };
@@ -508,7 +159,7 @@ struct ClientAudioMessage
 struct ClientCallMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
    */
   struct GNUNET_MessageHeader header;
 
@@ -539,7 +190,7 @@ struct ClientPhonePickedupMessage
    * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
    */
   struct GNUNET_MessageHeader header;
-  
+
   /* followed by variable length 0-terminated string with meta data */
 
 };
@@ -558,7 +209,7 @@ struct MeshPhoneRingMessage
   /**
    * Desired target line.
    */
-  uint32_t line GNUNET_PACKED;
+  uint32_t remote_line GNUNET_PACKED;
 
   /**
    * Purpose for the signature.
@@ -582,7 +233,7 @@ struct MeshPhoneRingMessage
 
   /**
    * When does the signature expire?
-   */ 
+   */
   struct GNUNET_TIME_AbsoluteNBO expiration_time;
 
   /**
@@ -590,6 +241,11 @@ struct MeshPhoneRingMessage
    */
   struct GNUNET_CRYPTO_EccSignature signature;
 
+  /**
+   * Source line for audio data in the other direction.
+   */
+  uint32_t source_line GNUNET_PACKED;
+
 };
 
 
@@ -631,7 +287,6 @@ struct MeshPhoneBusyMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable-size 0-terminated metadata string??? */
 };
 
 
@@ -645,6 +300,11 @@ struct MeshAudioMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Target line on the receiving end.
+   */
+  uint32_t remote_line;
+
   /* followed by audio data */
 
 };