org.mobicents.media.server.spi
Interface Endpoint

All Superinterfaces:
java.io.Serializable

public interface Endpoint
extends java.io.Serializable

The basic implementation of the endpoint. An Endpoint is a logical representation of a physical entity, such as an analog phone or a channel in a trunk. Endpoints are sources or sinks of data and can be physical or virtual. Physical endpoint creation requires hardware installation while software is sufficient for creating a virtual Endpoint. An interface on a gateway that terminates a trunk connected to a PSTN switch is an example of a physical Endpoint. An audio source in an audio-content server is an example of a virtual Endpoint.

Author:
Oleg Kulikov., amit.bhayani

Field Summary
static AudioFormat DTMF
           
static AudioFormat G729
           
static AudioFormat GSM
           
static AudioFormat LINEAR_AUDIO
           
static AudioFormat PCMA
           
static AudioFormat PCMU
           
static AudioFormat SPEEX
           
 
Method Summary
 void addConnectionListener(ConnectionListener listener)
          Register ConnectionListener to listen for changes in MsConnection state handled by this Endpoint
 void addNotificationListener(NotificationListener listener)
          Register NotificationListener to listen for MsNotifyEvent which are fired due to events detected by Endpoints like DTMF.
 Endpoint clone()
           
 Connection createConnection(ConnectionMode mode)
          Creates new connection with specified mode.
 Connection createLocalConnection(ConnectionMode mode)
          Creates new connection with specified mode.
 void deleteAllConnections()
          Deletes all connection associated with this Endpoint.
 void deleteConnection(java.lang.String connectionID)
          Deletes specified connection.
 java.lang.String describe(MediaType mediaType)
           
 Component getComponent(java.lang.String resourceName)
           
 Connection getConnection(java.lang.String connectionID)
           
 int getConnectionIndex()
           
 java.lang.String getLocalAddress(java.lang.String media)
          Gets local IP Address to which specified media channel is attached
 java.lang.String getLocalName()
          Gets the local name attribute.
 int getLocalPort(java.lang.String media)
          Gets the port number to which specified media channel is attached
 MediaSink getSink(MediaType media)
           
 MediaSource getSource(MediaType media)
           
 Timer getTimer()
           
 boolean hasConnections()
          Indicates does this endpoint has connections.
 boolean isInUse()
          Shows is this endpoint in use
 void removeConnectionListener(ConnectionListener listener)
          Removes the ConnectionListener
 void removeNotificationListener(NotificationListener listener)
          Remove the NotificationListener
 void setInUse(boolean inUse)
          Marks this endpoint as used/unsed.
 void setLocalName(java.lang.String localName)
           
 void setTimer(Timer timer)
           
 void start()
          Starts endpoint.
 void stop()
          Terminates endpoint's execution.
 

Field Detail

LINEAR_AUDIO

static final AudioFormat LINEAR_AUDIO

PCMA

static final AudioFormat PCMA

PCMU

static final AudioFormat PCMU

SPEEX

static final AudioFormat SPEEX

G729

static final AudioFormat G729

GSM

static final AudioFormat GSM

DTMF

static final AudioFormat DTMF
Method Detail

getLocalName

java.lang.String getLocalName()
Gets the local name attribute.

Returns:
the local name.

getTimer

Timer getTimer()

setTimer

void setTimer(Timer timer)

getLocalAddress

java.lang.String getLocalAddress(java.lang.String media)
Gets local IP Address to which specified media channel is attached

Parameters:
media - the media type
Returns:
IP adress in text form.

getLocalPort

int getLocalPort(java.lang.String media)
Gets the port number to which specified media channel is attached

Parameters:
media - the media type
Returns:
port number

start

void start()
           throws ResourceUnavailableException
Starts endpoint.

Throws:
ResourceUnavailableException

stop

void stop()
Terminates endpoint's execution.


createConnection

Connection createConnection(ConnectionMode mode)
                            throws TooManyConnectionsException,
                                   ResourceUnavailableException
Creates new connection with specified mode.

Parameters:
mode - the constant which identifies mode of the connection to be created.
Throws:
TooManyConnectionsException
ResourceUnavailableException

createLocalConnection

Connection createLocalConnection(ConnectionMode mode)
                                 throws TooManyConnectionsException,
                                        ResourceUnavailableException
Creates new connection with specified mode.

Parameters:
mode - the constant which identifies mode of the connection to be created.
Throws:
TooManyConnectionsException
ResourceUnavailableException

deleteConnection

void deleteConnection(java.lang.String connectionID)
Deletes specified connection.

Parameters:
connectionID - the identifier of the connection to be deleted.

deleteAllConnections

void deleteAllConnections()
Deletes all connection associated with this Endpoint.


hasConnections

boolean hasConnections()
Indicates does this endpoint has connections.

Returns:
true if endpoint has connections.

getConnection

Connection getConnection(java.lang.String connectionID)

getComponent

Component getComponent(java.lang.String resourceName)

isInUse

boolean isInUse()
Shows is this endpoint in use

Returns:
true if this endpoint is in use.

setInUse

void setInUse(boolean inUse)
Marks this endpoint as used/unsed.

Parameters:
inUse - true if endpoint is in use.

addNotificationListener

void addNotificationListener(NotificationListener listener)
Register NotificationListener to listen for MsNotifyEvent which are fired due to events detected by Endpoints like DTMF. Use above execute methods to register for event passing appropriate RequestedEvent

Parameters:
listener -

removeNotificationListener

void removeNotificationListener(NotificationListener listener)
Remove the NotificationListener

Parameters:
listener -

addConnectionListener

void addConnectionListener(ConnectionListener listener)
Register ConnectionListener to listen for changes in MsConnection state handled by this Endpoint

Parameters:
listener -

removeConnectionListener

void removeConnectionListener(ConnectionListener listener)
Removes the ConnectionListener

Parameters:
listener -

getConnectionIndex

int getConnectionIndex()

clone

Endpoint clone()

setLocalName

void setLocalName(java.lang.String localName)

getSink

MediaSink getSink(MediaType media)

getSource

MediaSource getSource(MediaType media)

describe

java.lang.String describe(MediaType mediaType)
                          throws ResourceUnavailableException
Throws:
ResourceUnavailableException


Copyright © 2010. All Rights Reserved.