API Lua
API Lua


odin

Version: stable

FUNCTIONS
odin.init()
odin.create_room()
odin.close_room()
odin.send()

Functions

odin.init()

odin.init(listener)

Initialize ODIN Voice

PARAMETERS

listener function

RETURNS

boolean

odin.create_room()

odin.create_room(room_id,user_id,access_key)

Create or join a room.

PARAMETERS

room_id string
Id of the room to join
user_id string
Id of the user
access_key string
The access key used when generating a token for room access. Will use odin.access_key if none is provided.

RETURNS

boolean

odin.close_room()

odin.close_room()

Close/leave a previously created/joined room.

PARAMETERS

None

RETURNS

boolean

odin.send()

odin.send(data,target_peer_ids,msgid)

Send a message to the current room.

PARAMETERS

data string
Data to send.
target_peer_ids table
Optional table with peers to send message to. Nil to send to all.
msgid number
Optional message id to identify message by. The id will be used in the response.

RETURNS

boolean