27#define LIVEKIT_RPC_MAX_PAYLOAD_BYTES 15360
32 LIVEKIT_RPC_RESULT_OK = 0,
35 LIVEKIT_RPC_RESULT_APPLICATION = 1500,
38 LIVEKIT_RPC_RESULT_CONNECTION_TIMEOUT = 1501,
41 LIVEKIT_RPC_RESULT_RESPONSE_TIMEOUT = 1502,
44 LIVEKIT_RPC_RESULT_RECIPIENT_DISCONNECTED = 1503,
47 LIVEKIT_RPC_RESULT_RESPONSE_PAYLOAD_TOO_LARGE = 1504,
50 LIVEKIT_RPC_RESULT_SEND_FAILED = 1505,
53 LIVEKIT_RPC_RESULT_UNSUPPORTED_METHOD = 1400,
56 LIVEKIT_RPC_RESULT_RECIPIENT_NOT_FOUND = 1401,
59 LIVEKIT_RPC_RESULT_REQUEST_PAYLOAD_TOO_LARGE = 1402,
62 LIVEKIT_RPC_RESULT_UNSUPPORTED_SERVER = 1403,
65 LIVEKIT_RPC_RESULT_UNSUPPORTED_VERSION = 1404
66} livekit_rpc_result_code_t;
75 livekit_rpc_result_code_t
code;
117#define livekit_rpc_return_ok(_payload) \
118 invocation->send_result(&(livekit_rpc_result_t){ \
119 .id = invocation->id, \
120 .code = LIVEKIT_RPC_RESULT_OK, \
121 .payload = (_payload), \
122 .error_message = NULL \
129#define livekit_rpc_return_error(_error_message) \
130 invocation->send_result(&(livekit_rpc_result_t){ \
131 .id = invocation->id, \
132 .code = LIVEKIT_RPC_RESULT_APPLICATION, \
134 .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:111
char * id
Invocation identifier.
Definition livekit_rpc.h:71
char * payload
Payload returned to the caller.
Definition livekit_rpc.h:81
char * payload
Caller provided payload.
Definition livekit_rpc.h:100
char * method
The name of the method being invoked.
Definition livekit_rpc.h:90
char * id
Invocation identifier.
Definition livekit_rpc.h:87
void * ctx
Context for the callback.
Definition livekit_rpc.h:106
livekit_rpc_result_code_t code
The error code if the RPC method failed.
Definition livekit_rpc.h:75
char * error_message
Optional, textual description of the error that occurred.
Definition livekit_rpc.h:78
char * caller_identity
Participant identity of the caller.
Definition livekit_rpc.h:93
bool(* send_result)(const livekit_rpc_result_t *res, void *ctx)
Sends the result of the invocation to the caller.
Definition livekit_rpc.h:103
Details about an RPC method invocation.
Definition livekit_rpc.h:85
The result of an RPC method invocation.
Definition livekit_rpc.h:69