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, 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 class org.mobicents.media.server.impl.AbstractSource
otherParty
 
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
 
Constructor Summary
InbandGeneratorImpl(java.lang.String name)
           
 
Method Summary
 void connect(org.mobicents.media.MediaSink otherParty)
          (Non Java-doc).
 java.lang.String getDigit()
           
 int getDuration()
           
 org.mobicents.media.Format getFormat()
           
 org.mobicents.media.Format[] getFormats()
           
static java.lang.String getToneName(int row, int column)
           
 int getVolume()
           
 void init()
           
static void main(java.lang.String[] args)
           
static void print(byte[] data)
           
 void setDigit(java.lang.String digit)
           
 void setDuration(int duration)
           
 void setVolume(int volume)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSource
disconnect, isConnected
 
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
 

Field Detail

logger

public static org.apache.log4j.Logger logger

events

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

InbandGeneratorImpl

public InbandGeneratorImpl(java.lang.String name)
Method Detail

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.