public class Call extends SubSession
The capability of a Call is determined when it is created. This capability is configured in the
CallConfig object and input as the second parameter in CallPackage.createCall(java.lang.String)
.
Modifier and Type | Class and Description |
---|---|
static class |
Call.Observer
Observer class that the application can implement to be informed of changes in the
Call . |
static class |
Call.TrickleIceMode
Trickle ICE modes.
|
Modifier and Type | Field and Description |
---|---|
static String |
PROP_PEER_CONNECTION_FORCE_NEW
Compatibility flag to force a new peer connection on every SDP exchange.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(CallConfig config,
Map extHeaders,
org.webrtc.MediaStream[] localStreams)
Accepts the received Call invitation.
|
void |
accept(CallConfig config,
org.webrtc.MediaStream[] localStreams)
Accepts the received Call invitation.
|
void |
decline(int code)
Decline the call with a reason code.
|
void |
decline(int code,
Map extHeaders)
Decline the call with a reason code.
|
protected void |
dispose()
Disposes of any resources allocated by the subsession.
|
void |
end()
Ends the current call.
|
void |
end(Map extHeaders)
Ends the current call.
|
CallConfig |
getCallConfig()
Gets the CallConfig for the current call.
|
String |
getCallee()
Gets the callee of the current call.
|
String |
getCaller()
Gets the caller of the current call.
|
CallState |
getCallState()
Gets the current state of a call.
|
DataTransfer |
getDataTransfer(String label)
Gets the DataTransfer object of the current call by label.
|
CallPackage |
getPackage()
Gets the package.
|
org.webrtc.PeerConnection |
getPeerConnection()
Gets the peerConnection of the current call.
Note: The peerConnection may change. |
org.webrtc.PeerConnectionFactory |
getPeerConnectionFactory()
Gets the Peer Connection Factory instance to create media streams while initiating or accepting a call.
|
Call.TrickleIceMode |
getTrickleIceMode() |
protected void |
onMessage(Frame frame)
Receives message.
|
void |
setObserver(Call.Observer observer) |
void |
setPeerConnectionFactory(org.webrtc.PeerConnectionFactory pcf)
Sets the Peer Connection Factory
Before a call is started the application should set the locally created peer connection factory on the call object.
|
void |
setTrickleIceMode(Call.TrickleIceMode trickleIceMode) |
void |
start(CallConfig config,
Map extHeaders,
org.webrtc.MediaStream[] localStreams)
Starts the call represented by itself.
|
void |
start(CallConfig config,
org.webrtc.MediaStream[] localStreams)
Starts the call represented by itself.
|
String |
toString() |
void |
update(CallConfig config,
Map extHeaders,
org.webrtc.MediaStream[] localStreams)
Updates the call, for example, to add video, remove video, mute and unmute audio, or mute and unmute video
and so on.
|
void |
update(CallConfig config,
org.webrtc.MediaStream[] localStreams)
Updates the call, for example, to add video, remove video, mute and unmute audio, or mute and unmute video
and so on.
|
getId, sendMessage
public static final String PROP_PEER_CONNECTION_FORCE_NEW
public DataTransfer getDataTransfer(String label)
label
- DataTransfer object labelpublic String getCaller()
public String getCallee()
public CallState getCallState()
public CallConfig getCallConfig()
public org.webrtc.PeerConnection getPeerConnection()
PeerConnection
of the current callpublic org.webrtc.PeerConnectionFactory getPeerConnectionFactory()
public void setObserver(Call.Observer observer)
public void setPeerConnectionFactory(org.webrtc.PeerConnectionFactory pcf)
pcf
- the peer connection factory.public void setTrickleIceMode(Call.TrickleIceMode trickleIceMode)
public Call.TrickleIceMode getTrickleIceMode()
public void accept(CallConfig config, org.webrtc.MediaStream[] localStreams) throws IllegalArgumentException
config
- Local capability configuration of the Call.
This callConfig must not conflict with rules of RFC 3264. For example, if the callConfig of call.onIncomingCall or call.onUpdate is (SENDONLY, NONE), this callConfig cannot be (SENDONLY, NONE), but it can be (RECVONLY, NONE) or (NONE, NONE).
localStreams
- pre-created local media streams arrayIllegalArgumentException
- thrown if no local streams were createdpublic void accept(CallConfig config, Map extHeaders, org.webrtc.MediaStream[] localStreams) throws IllegalArgumentException
config
- Local capability configuration of the Call.
This callConfig must not conflict with rules of RFC 3264. For example, if callConfig of call.onIncomingCall or call.onUpdate is (SENDONLY, NONE), this callConfig cannot be (SENDONLY, NONE), but it can be (RECVONLY, NONE) or (NONE, NONE).
extHeaders
- extension headers. If provided, they are inserted into the JSON message.
For example an extHeaders formatted like this,
{'customerKey1':'value1','customerKey2':'value2'}
will be in the message formatted like this :
{ "control" : {}, "header" : {...,'customerKey1':'value1','customerKey2':'value2'},
"payload" : {}}
localStreams
- pre-created local media streams arrayIllegalArgumentException
- thrown if no local streams were createdpublic void decline(int code)
code
- code The decline code reasonpublic void decline(int code, Map extHeaders)
code
- code The decline code reasonextHeaders
- extension headers. If provided, they are inserted into the JSON message. {'customerKey1':'value1','customerKey2':'value2'}
{ "control" : {}, "header" : {...,'customerKey1':'value1','customerKey2':'value2'},
"payload" : {}}
public void start(CallConfig config, org.webrtc.MediaStream[] localStreams) throws IllegalArgumentException
config
- an instance of the CallConfig object that represents the capabilities of the calllocalStreams
- pre-created local media streams arrayIllegalArgumentException
- thrown if no local streams were createdpublic void start(CallConfig config, Map extHeaders, org.webrtc.MediaStream[] localStreams) throws IllegalArgumentException
config
- an instance of the CallConfig object that represents the capabilities of the callextHeaders
- extension headers. If provided, they are inserted into the JSON message. {'customerKey1':'value1','customerKey2':'value2'}
{ "control" : {}, "header" : {...,'customerKey1':'value1','customerKey2':'value2'},
"payload" : {}}
localStreams
- pre-created local media streams arrayIllegalArgumentException
- thrown if no local streams were createdpublic void update(CallConfig config, org.webrtc.MediaStream[] localStreams)
config
- The call configuration used to update the current call.localStreams
- pre-created local media streams arraypublic void update(CallConfig config, Map extHeaders, org.webrtc.MediaStream[] localStreams)
config
- The call configuration used to update the current call.localStreams
- pre-created local media streams arrayextHeaders
- extension headers. If provided, they are inserted into the JSON message. {'customerKey1':'value1','customerKey2':'value2'}
{ "control" : {}, "header" : {...,'customerKey1':'value1','customerKey2':'value2'},
"payload" : {}}
public void end()
public void end(Map extHeaders)
extHeaders
- extension headers. If provided, they are inserted into the JSON message. {'customerKey1':'value1','customerKey2':'value2'}
{ "control" : {}, "header" : {...,'customerKey1':'value1','customerKey2':'value2'},
"payload" : {}}
public CallPackage getPackage()
SubSession
getPackage
in class SubSession
protected void dispose()
SubSession
dispose
in class SubSession
protected void onMessage(Frame frame)
onMessage
in class SubSession
frame
- Frame