org.mobicents.media.server.impl.resource.dtmf
Class InbandGeneratorImpl
java.lang.Object
org.mobicents.media.server.impl.BaseComponent
org.mobicents.media.server.impl.AbstractSource
org.mobicents.media.server.impl.resource.dtmf.InbandGeneratorImpl
- All Implemented Interfaces:
- java.io.Serializable, org.mobicents.media.Component, org.mobicents.media.MediaSource, org.mobicents.media.server.spi.resource.DtmfGenerator
public class InbandGeneratorImpl
- 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
|
static org.apache.log4j.Logger |
logger
|
| Fields inherited from interface org.mobicents.media.server.spi.resource.DtmfGenerator |
GENERATOR_DURATION, GENERATOR_VOLUME |
| Fields inherited from interface org.mobicents.media.Component |
AUDIO_PLAYER, AUDIO_RECORDER, DTMF_DETECTOR, DTMF_GENERATOR |
| Methods inherited from class org.mobicents.media.server.impl.BaseComponent |
addListener, getConnection, getEndpoint, getId, getName, getResourceType, removeListener, sendEvent, setConnection, setEndpoint, setResourceType, 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 |
disconnect |
| Methods inherited from interface org.mobicents.media.Component |
addListener, getConnection, getEndpoint, getId, getName, getResourceType, removeListener, setConnection, setEndpoint, setResourceType |
logger
public static org.apache.log4j.Logger logger
events
public static final java.lang.String[][] events
InbandGeneratorImpl
public InbandGeneratorImpl(java.lang.String name)
init
public void init()
getToneName
public static java.lang.String getToneName(int row,
int column)
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
setDuration
public void setDuration(int duration)
- Specified by:
setDuration in interface org.mobicents.media.server.spi.resource.DtmfGenerator
getDuration
public int getDuration()
- Specified by:
getDuration 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
print
public static void print(byte[] data)
getFormat
public org.mobicents.media.Format getFormat()
start
public void start()
- Specified by:
start in interface org.mobicents.media.MediaSource
stop
public void stop()
- Specified by:
stop in interface org.mobicents.media.MediaSource
getFormats
public org.mobicents.media.Format[] getFormats()
- Specified by:
getFormats in interface org.mobicents.media.MediaSource
connect
public void connect(org.mobicents.media.MediaSink otherParty)
- Description copied from class:
AbstractSource
- (Non Java-doc).
- Specified by:
connect in interface org.mobicents.media.MediaSource- Overrides:
connect in class AbstractSource
- See Also:
org.mobicents.MediaStream#connect(MediaSink).
main
public static void main(java.lang.String[] args)
Copyright © 2009. All Rights Reserved.