org.mobicents.media.server.impl.resource.dtmf
Class GeneratorImpl
java.lang.Object
org.mobicents.media.server.impl.BaseComponent
org.mobicents.media.server.impl.AbstractSource
org.mobicents.media.server.impl.resource.dtmf.GeneratorImpl
- All Implemented Interfaces:
- java.io.Serializable, org.mobicents.media.Component, org.mobicents.media.MediaSource, org.mobicents.media.server.spi.clock.Task, org.mobicents.media.server.spi.resource.DtmfGenerator
public class GeneratorImpl
- extends AbstractSource
- implements org.mobicents.media.server.spi.resource.DtmfGenerator
InbandGenerator generates Inband DTMF Tone only for uncompressed LINEAR
codec. After creating instance of InbandGenerator, it needs to be initialized
so that all the Tones are generated and kept ready for transmission once
start is called.
By default the Tone duration is 80ms. This is suited for Tone Detector who
has Tone duration of greater than 40 and less than 80ms. For Tone Detector
who's Tone duration is set greater than 80ms may fail to detect Tone
generated by InbandGenerator(with duration 80ms). In that case increase the
duration here too.
- Author:
- Oleg Kulikov, amit bhayani
- See Also:
- Serialized Form
|
Field Summary |
static java.lang.String[][] |
events
|
| Methods inherited from class org.mobicents.media.server.impl.AbstractSource |
afterStop, beforeStart, cancel, completed, connect, connect, disconnect, disconnect, failed, getBytesTransmitted, getDuration, getMediaTime, getPacketsTransmitted, getSupportedFormatList, isActive, isConnected, isMultipleConnectionsAllowed, isStarted, perform, resetStats, setDuration, setMediaTime, setStarted, started, stopped |
| Methods inherited from class org.mobicents.media.server.impl.BaseComponent |
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, sendEvent, setConnection, setEndpoint, subset, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mobicents.media.MediaSource |
connect, connect, disconnect, disconnect, getBytesTransmitted, getDuration, getMediaTime, getPacketsTransmitted, isConnected, isMultipleConnectionsAllowed, isStarted, setDuration, setMediaTime |
| Methods inherited from interface org.mobicents.media.Component |
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, resetStats, setConnection, setEndpoint |
| Methods inherited from interface org.mobicents.media.server.spi.clock.Task |
cancel, isActive, perform |
events
public static final java.lang.String[][] events
GeneratorImpl
public GeneratorImpl(java.lang.String name)
start
public void start()
- Description copied from class:
AbstractSource
- (Non Java-doc).
- Specified by:
start in interface org.mobicents.media.MediaSource- Specified by:
start in interface org.mobicents.media.server.spi.resource.DtmfGenerator- Overrides:
start in class AbstractSource
- See Also:
MediaSource.start().
setPreffered
public void setPreffered(org.mobicents.media.Format fmt)
- Description copied from class:
AbstractSource
- This methods is called by media sink to setup preffered format.
Media source in opposite direction can ask media sink to get
preffered format by calling
sink.getPreffred(Collection)
where collection is a subset of common formats.
- Overrides:
setPreffered in class AbstractSource
- Parameters:
fmt - preffred format.
setDigit
public void setDigit(java.lang.String digit)
- Specified by:
setDigit in interface org.mobicents.media.server.spi.resource.DtmfGenerator
getDigit
public java.lang.String getDigit()
- Specified by:
getDigit in interface org.mobicents.media.server.spi.resource.DtmfGenerator
setToneDuration
public void setToneDuration(int duration)
- Specified by:
setToneDuration in interface org.mobicents.media.server.spi.resource.DtmfGenerator
getToneDuration
public int getToneDuration()
- Specified by:
getToneDuration in interface org.mobicents.media.server.spi.resource.DtmfGenerator
getVolume
public int getVolume()
- Specified by:
getVolume in interface org.mobicents.media.server.spi.resource.DtmfGenerator
setVolume
public void setVolume(int volume)
- Specified by:
setVolume in interface org.mobicents.media.server.spi.resource.DtmfGenerator
getFormats
public org.mobicents.media.Format[] getFormats()
- Specified by:
getFormats in interface org.mobicents.media.MediaSource
evolve
public void evolve(org.mobicents.media.Buffer buffer,
long timestamp)
- Description copied from class:
AbstractSource
- This method must be overriden by concrete media source. The media have to fill buffer with media data and
attributes.
- Specified by:
evolve in class AbstractSource
- Parameters:
buffer - the buffer object for media.
stop
public void stop()
- Description copied from class:
AbstractSource
- (Non Java-doc).
- Specified by:
stop in interface org.mobicents.media.MediaSource- Specified by:
stop in interface org.mobicents.media.server.spi.resource.DtmfGenerator- Overrides:
stop in class AbstractSource
- See Also:
MediaSource.stop().
getInterface
public <T> T getInterface(java.lang.Class<T> interfaceType)
- Specified by:
getInterface in interface org.mobicents.media.Component- Overrides:
getInterface in class AbstractSource
Copyright © 2010. All Rights Reserved.