org.mobicents.media.server.impl.resource.dtmf
Class GeneratorImpl

java.lang.Object
  extended by org.mobicents.media.server.impl.BaseComponent
      extended by org.mobicents.media.server.impl.AbstractSource
          extended by org.mobicents.media.server.impl.resource.dtmf.GeneratorImpl
All Implemented Interfaces:
Serializable, Component, MediaSource, DtmfGenerator

public class GeneratorImpl
extends AbstractSource
implements 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:
yulian oifa, amit bhayani
See Also:
Serialized Form

Field Summary
static String[][] events
           
 
Fields inherited from class org.mobicents.media.server.impl.AbstractSource
duration, mediaSink
 
Constructor Summary
GeneratorImpl(String name, org.mobicents.media.server.scheduler.Scheduler scheduler)
           
 
Method Summary
 void activate()
           
 void addListener(DtmfGeneratorListener listener)
           
 void clearAllListeners()
           
 void completed()
           
 void deactivate()
           
 Frame evolve(long timestamp)
           
 AudioInput getAudioInput()
           
 String getDigit()
           
 Formats getNativeFormats()
           
 String getOOBDigit()
           
 OOBInput getOOBInput()
           
 int getToneDuration()
           
 int getVolume()
           
 void removeListener(DtmfGeneratorListener listener)
           
 void setDigit(String digit)
           
 void setOOBDigit(String digit)
           
 void setToneDuration(int duration)
           
 void setVolume(int volume)
           
 void wakeup()
           
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSource
connect, disconnect, failed, getBytesTransmitted, getDuration, getMediaTime, getPacketsTransmitted, isConnected, isStarted, report, reset, setDuration, setInitialDelay, setMediaTime, start, started, stop, stopped
 
Methods inherited from class org.mobicents.media.server.impl.BaseComponent
clearEndpoint, getEndpoint, getId, getName, setEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mobicents.media.server.spi.dtmf.DtmfGenerator
start, stop
 
Methods inherited from interface org.mobicents.media.MediaSource
getBytesTransmitted, getDuration, getMediaTime, getPacketsTransmitted, isConnected, isStarted, setDuration, setInitialDelay, setMediaTime
 
Methods inherited from interface org.mobicents.media.Component
clearEndpoint, getEndpoint, getId, getName, reset, setEndpoint
 

Field Detail

events

public static final String[][] events
Constructor Detail

GeneratorImpl

public GeneratorImpl(String name,
                     org.mobicents.media.server.scheduler.Scheduler scheduler)
Method Detail

addListener

public void addListener(DtmfGeneratorListener listener)
Specified by:
addListener in interface DtmfGenerator

removeListener

public void removeListener(DtmfGeneratorListener listener)
Specified by:
removeListener in interface DtmfGenerator

clearAllListeners

public void clearAllListeners()
Specified by:
clearAllListeners in interface DtmfGenerator

getAudioInput

public AudioInput getAudioInput()

getOOBInput

public OOBInput getOOBInput()

activate

public void activate()
Specified by:
activate in interface Component
Overrides:
activate in class AbstractSource

setOOBDigit

public void setOOBDigit(String digit)
Specified by:
setOOBDigit in interface DtmfGenerator

setDigit

public void setDigit(String digit)
Specified by:
setDigit in interface DtmfGenerator

completed

public void completed()
Overrides:
completed in class AbstractSource

getDigit

public String getDigit()
Specified by:
getDigit in interface DtmfGenerator

getOOBDigit

public String getOOBDigit()
Specified by:
getOOBDigit in interface DtmfGenerator

setToneDuration

public void setToneDuration(int duration)
Specified by:
setToneDuration in interface DtmfGenerator

getToneDuration

public int getToneDuration()
Specified by:
getToneDuration in interface DtmfGenerator

getVolume

public int getVolume()
Specified by:
getVolume in interface DtmfGenerator

setVolume

public void setVolume(int volume)
Specified by:
setVolume in interface DtmfGenerator

getNativeFormats

public Formats getNativeFormats()

evolve

public Frame evolve(long timestamp)
Specified by:
evolve in class AbstractSource

deactivate

public void deactivate()
Specified by:
deactivate in interface Component
Overrides:
deactivate in class AbstractSource

wakeup

public void wakeup()
Overrides:
wakeup in class AbstractSource


Copyright © 2013 TeleStax, Inc.. All Rights Reserved.