syntax = "proto3"; package cald.call.v1; import "Core.proto"; option java_multiple_files = true; option java_package = "nexus.cald.api.call"; // The `cald.call` / `1` content schema: caller ID. CaLD's first builtin content schema beyond plain // text, and a core one: a phone that ignores it can't confirm or deny its own calls. // // Each message travels as the messageBytes of one MessageContent (schemaName "cald.call", // schemaVersion "1", messageTypeName the message's name below) in a CaldMessage, signed by its // sender and sealed to its recipient like any other message, so no relay can read or forge it. The // time a message was sent is the CaldMessage's own sentAtEpochMillis, covered by the same signature; // these messages don't repeat it. // // Not a server call: no relay or server answers these (relays carry them sealed and never parse // them), so unlike the server-facing files this one has no `service` block. // // Every message names both numbers of the call it is about, so a message can't be read as being // about a different call between other numbers. Which of the two signs it is fixed per message: // the caller for CallAnnouncement / CallConfirmation / CallDenial, the callee for CallQuery. // (1) "I am calling you right now; this call is valid." Caller to callee, as the call is placed. // Not tied to a question, so the callee counts it only for a call that rang shortly after it. message CallAnnouncement { cald.core.v1.PhoneNumber callerPhoneNumber = 1; cald.core.v1.PhoneNumber calleePhoneNumber = 2; } // (2) "Are you actually calling me right now?" Callee to the number the call claims to come from, // when a call rings from a registered number and no (1) has arrived. message CallQuery { cald.core.v1.PhoneNumber callerPhoneNumber = 1; cald.core.v1.PhoneNumber calleePhoneNumber = 2; // Random, chosen by the callee for this one question. (3) and (4) repeat it, so an answer can // only ever belong to the question, and so the call, it was asked for. bytes nonce = 3; } // (3) "Yes, I am calling you right now." The claimed caller's answer to a (2), from a phone on an // outgoing call to the asker. message CallConfirmation { cald.core.v1.PhoneNumber callerPhoneNumber = 1; cald.core.v1.PhoneNumber calleePhoneNumber = 2; // The nonce of the CallQuery this answers. bytes nonce = 3; } // (4) "No, I am not calling you right now." The claimed caller's answer to a (2), from a phone that // is not on an outgoing call to the asker. message CallDenial { cald.core.v1.PhoneNumber callerPhoneNumber = 1; cald.core.v1.PhoneNumber calleePhoneNumber = 2; // The nonce of the CallQuery this answers. bytes nonce = 3; }