post

open fun post(@NonNull event: Event): Int

Post an event.

The event is posted to the stream specified by the stream key using the account ID specified in the event. What that means depends on the event that is posted. The event is saved when it is posted successfully.

If the event's account ID is null, the default account ID is used. Only in that case are the number rewriting account overrides computed. The method then can return ACCOUNT_OVERRIDE. See the description of that return value for more information.

If the event's remote users are empty, all the stream parties are used and filled into the event. Otherwise, the filled remote users are used, regardless of the stream parties specified in the stream.

If no stream key is filled, a stream matching the remote user is found, or if no such stream exists, created automatically. The event's stream key is then filled by the correct value. This does not work when there are multiple remote users; in that case, NO_STREAM is returned.

If neither a stream key nor any remote user is provided, the call fails with NO_RECIPIENT.

A call event cannot have multiple remote users. If you want to start a conversation, post multiple call events and then move them to an appropriate conference. Note that the stream key must be either empty or match the remote user's single user stream, or legacy call stream if that is used.

Successfully posting a call updates lastDialedUri.

The event may be modified during processing or any time later. It is guaranteed that the event will be modified on the main thread only. You should not use the posted event in any other thread.

Return

Value indicating what happened.

Parameters

event

The event to post. If successfully posted, its ID will be filled by this method.