public interface MgcpConnection extends MgcpEventSubject
Each connection will be designated locally by an endpoint unique connection identifier, and will be characterized by connection attributes.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
AudioComponent |
getAudioComponent()
Gets the in-band audio component of the connection.
|
int |
getCallIdentifier()
Gets the call identifier.
|
String |
getCallIdentifierHex()
Gets the call identifier.
|
String |
getHexIdentifier()
Gets the connection identifier.
|
int |
getIdentifier()
Gets the connection identifier.
|
ConnectionMode |
getMode()
Gets the current mode of the connection.
|
OOBComponent |
getOutOfBandComponent()
Gets the out-of-band audio component of the connection.
|
MgcpConnectionState |
getState()
Gets the current state of the connection
|
String |
halfOpen(LocalConnectionOptions options)
The connection allocates resources and becomes half-open, sending an SDP offer to the remote peer.
|
boolean |
isLocal()
Gets whether the connection is local or remote.
|
void |
listen(MgcpRequestedEvent event)
Requests the connection to send notifications about a certain event.
|
String |
open(String sdp)
Moves the connection to an open state.
|
void |
setMode(ConnectionMode mode)
Sets the mode of the connection.
|
forget, notify, observeint getIdentifier()
String getHexIdentifier()
int getCallIdentifier()
String getCallIdentifierHex()
boolean isLocal()
true if connection is local; false if it is remote.ConnectionMode getMode()
MgcpConnectionState getState()
void setMode(ConnectionMode mode) throws IllegalStateException
mode - The new mode of the connectionIllegalStateException - Cannot update mode of closed connectionsString halfOpen(LocalConnectionOptions options) throws MgcpConnectionException
The connection must then wait for the remote peer to reply with MDCX request containing an SDP answer or for a DLCX request that terminates the connection. description.
options - The options that configure the connection.MgcpConnectionException - If connection state is not closed.MgcpConnectionException - If connection could not bind required resourcesString open(String sdp) throws MgcpConnectionException
If the call is inbound, then the remote peer will provide an SDP offer and the connection will allocate resources and provide and SDP answer right away.
If the call is outbound, the connection MUST move from an half-open state. In this case, the remote peer provides the MGCP answer and the connection can be established between both peers.
sdp - The SDP description of the remote peer.null if call is outbound.MgcpConnectionException - If connection state is not closed nor half-open.MgcpConnectionException - If connection fails to open properlyvoid close()
throws MgcpConnectionException
MgcpConnectionException - If connection state is not half-open nor open.void listen(MgcpRequestedEvent event) throws UnsupportedMgcpEventException
event - The event to liste to.UnsupportedMgcpEventException - If the connection does not support the event.AudioComponent getAudioComponent()
OOBComponent getOutOfBandComponent()
Copyright © 2017 TeleStax, Inc.. All Rights Reserved.