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

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.InbandGeneratorImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, 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
           
 
Fields inherited from class org.mobicents.media.server.impl.AbstractSource
otherParty
 
Constructor Summary
InbandGeneratorImpl(java.lang.String name, org.mobicents.media.server.spi.Timer timer)
           
 
Method Summary
 void evolve(org.mobicents.media.Buffer buffer, long seq)
          This method must be overriden by concrete media source.
 java.lang.String getDigit()
           
 int getDuration()
           
 org.mobicents.media.Format getFormat()
           
 org.mobicents.media.Format[] getFormats()
           
 int getVolume()
           
 void setDigit(java.lang.String digit)
           
 void setDuration(int duration)
           
 void setVolume(int volume)
           
 void stop()
          (Non Java-doc).
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSource
afterStop, beforeStart, completed, connect, connect, disconnect, disconnect, failed, getBytesTransmitted, getPacketsTransmitted, getSupportedFormatList, getSyncSource, isConnected, isMultipleConnectionsAllowed, isStarted, resetStats, run, setSyncSource, start, started, stopped
 
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
connect, connect, disconnect, disconnect, getBytesTransmitted, getPacketsTransmitted, getSyncSource, isConnected, isMultipleConnectionsAllowed, isStarted, setSyncSource
 
Methods inherited from interface org.mobicents.media.Component
addListener, getConnection, getEndpoint, getId, getName, removeListener, resetStats, setConnection, setEndpoint, start
 

Field Detail

events

public static final java.lang.String[][] events
Constructor Detail

InbandGeneratorImpl

public InbandGeneratorImpl(java.lang.String name,
                           org.mobicents.media.server.spi.Timer timer)
Method Detail

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

getFormat

public org.mobicents.media.Format getFormat()

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 seq)
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.
seq - the number of timer ticks from the begining.

stop

public void stop()
Description copied from class: AbstractSource
(Non Java-doc).

Specified by:
stop in interface org.mobicents.media.Component
Overrides:
stop in class AbstractSource
See Also:
Component.stop().


Copyright © 2009. All Rights Reserved.