Package com.flashphoner.fpwcsapi.session
Class Session
java.lang.Object
com.flashphoner.fpwcsapi.session.Session
Stream and call management API
Session object is a session between Android app and WCS server
One session can create many streams or SIP calls
-
Constructor Summary
ConstructorDescriptionSession
(SessionOptions sessionOptions, Consumer<Session> disconnectConsumer) New session based on sessionOptions -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(Connection connection) Connect to server with additional connection parametersvoid
connect
(Connection connection, Map<String, String> customHeaders) Connect to server with additional connection parameters and custom HTTP headerscreateCall
(CallOptions callOptions) Create a new SIP callcreateStream
(StreamOptions streamOptions) Create new stream for publishing or playingvoid
Disconnect from server (status: DISCONNECTED)void
disconnect
(String status) Disconnect from server with custom statusgetId()
Get identifier of sessionGet rest application communicator of data (currently used in room)Get SessionOptions of created sessionvoid
on
(IncomingCallEvent incomingCallEvent) Handle incoming callvoid
on
(SessionEvent sessionEvent) Set event listener statuses and datavoid
Send rpc message to handlervoid
Send rpc message to handler with data
-
Constructor Details
-
Session
New session based on sessionOptions- Parameters:
sessionOptions
-
-
-
Method Details
-
connect
Connect to server with additional connection parameters and custom HTTP headers- Parameters:
connection
- Additional connection parameterscustomHeaders
- Custom HTTP headers
-
connect
Connect to server with additional connection parameters- Parameters:
connection
- Additional connection parameters
-
createStream
Create new stream for publishing or playing- Parameters:
streamOptions
- options for stream: stream name, renderer for displaying video, constraints for audio and video- Returns:
- Created stream
-
createCall
Create a new SIP call- Parameters:
callOptions
-- Returns:
- Created call
- See Also:
-
send
Send rpc message to handler- Parameters:
message
- Method name
-
send
Send rpc message to handler with data- Parameters:
message
- Method namedata
- Custom data (will be converted to json)
-
disconnect
public void disconnect()Disconnect from server (status: DISCONNECTED) -
disconnect
Disconnect from server with custom status- Parameters:
status
-
-
getId
Get identifier of session- Returns:
-
getSessionOptions
Get SessionOptions of created session- Returns:
-
getRestAppCommunicator
Get rest application communicator of data (currently used in room)- Returns:
-
on
Set event listener statuses and data- Parameters:
sessionEvent
-
-
on
Handle incoming call- Parameters:
incomingCallEvent
-
-