12#define LIVEKIT_RPC_MAX_PAYLOAD_BYTES 15360
17 LIVEKIT_RPC_RESULT_OK = 0,
20 LIVEKIT_RPC_RESULT_APPLICATION = 1500,
23 LIVEKIT_RPC_RESULT_CONNECTION_TIMEOUT = 1501,
26 LIVEKIT_RPC_RESULT_RESPONSE_TIMEOUT = 1502,
29 LIVEKIT_RPC_RESULT_RECIPIENT_DISCONNECTED = 1503,
32 LIVEKIT_RPC_RESULT_RESPONSE_PAYLOAD_TOO_LARGE = 1504,
35 LIVEKIT_RPC_RESULT_SEND_FAILED = 1505,
38 LIVEKIT_RPC_RESULT_UNSUPPORTED_METHOD = 1400,
41 LIVEKIT_RPC_RESULT_RECIPIENT_NOT_FOUND = 1401,
44 LIVEKIT_RPC_RESULT_REQUEST_PAYLOAD_TOO_LARGE = 1402,
47 LIVEKIT_RPC_RESULT_UNSUPPORTED_SERVER = 1403,
50 LIVEKIT_RPC_RESULT_UNSUPPORTED_VERSION = 1404
51} livekit_rpc_result_code_t;
60 livekit_rpc_result_code_t
code;
102#define livekit_rpc_return_ok(_payload) \
103 invocation->send_result(&(livekit_rpc_result_t){ \
104 .id = invocation->id, \
105 .code = LIVEKIT_RPC_RESULT_OK, \
106 .payload = (_payload), \
107 .error_message = NULL \
114#define livekit_rpc_return_error(_error_message) \
115 invocation->send_result(&(livekit_rpc_result_t){ \
116 .id = invocation->id, \
117 .code = LIVEKIT_RPC_RESULT_APPLICATION, \
119 .error_message = (_error_message) \
void(* livekit_rpc_handler_t)(const livekit_rpc_invocation_t *invocation, void *ctx)
Handler for an RPC invocation.
Definition livekit_rpc.h:96
char * id
Invocation identifier.
Definition livekit_rpc.h:56
char * payload
Payload returned to the caller.
Definition livekit_rpc.h:66
char * payload
Caller provided payload.
Definition livekit_rpc.h:85
char * method
The name of the method being invoked.
Definition livekit_rpc.h:75
char * id
Invocation identifier.
Definition livekit_rpc.h:72
void * ctx
Context for the callback.
Definition livekit_rpc.h:91
livekit_rpc_result_code_t code
The error code if the RPC method failed.
Definition livekit_rpc.h:60
char * error_message
Optional, textual description of the error that occurred.
Definition livekit_rpc.h:63
char * caller_identity
Participant identity of the caller.
Definition livekit_rpc.h:78
bool(* send_result)(const livekit_rpc_result_t *res, void *ctx)
Sends the result of the invocation to the caller.
Definition livekit_rpc.h:88
Details about an RPC method invocation.
Definition livekit_rpc.h:70
The result of an RPC method invocation.
Definition livekit_rpc.h:54