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

java.lang.Object
  extended by org.mobicents.media.server.impl.BaseComponent
      extended by org.mobicents.media.server.impl.AbstractSink
          extended by org.mobicents.media.server.impl.resource.dtmf.DtmfBuffer
              extended by org.mobicents.media.server.impl.resource.dtmf.DetectorImpl
All Implemented Interfaces:
java.io.Serializable, org.mobicents.media.Component, org.mobicents.media.MediaSink, org.mobicents.media.server.spi.resource.DtmfDetector

public class DetectorImpl
extends DtmfBuffer

Implements inband DTMF detector. Inband means that DTMF is transmitted within the audio of the phone conversation, i.e. it is audible to the conversation partners. Therefore only uncompressed codecs like g711 alaw or ulaw can carry inband DTMF reliably. Female voice are known to once in a while trigger the recognition of a DTMF tone. For analog lines inband is the only possible means to transmit DTMF. Though Inband DTMF detection may work for other codecs like SPEEX, GSM, G729 as DtmfDetector is using DSP in front of InbandDetector there is no guarantee that it will always work. In future MMS may not have DSP in front of InbandDetector and hence Inband detection for codecs like SPEEX, GSM, G729 may completely stop

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.resource.dtmf.DtmfBuffer
interdigitInterval, TIMEOUT
 
Fields inherited from class org.mobicents.media.server.impl.AbstractSink
otherParty
 
Fields inherited from class org.mobicents.media.server.impl.BaseComponent
format
 
Fields inherited from interface org.mobicents.media.server.spi.resource.DtmfDetector
DEFAULT_INTERDIGIT_INTERVAL, DEFAULT_SIGNAL_LEVEL
 
Constructor Summary
DetectorImpl(java.lang.String name)
          Creates new instance of Detector.
 
Method Summary
 int getDuration()
           
 org.mobicents.media.Format[] getFormats()
           
<T> T
getInterface(java.lang.Class<T> interfaceType)
           
 int getVolume()
           
 boolean isAcceptable(org.mobicents.media.Format format)
           
 void onMediaTransfer(org.mobicents.media.Buffer buffer)
          (Non Java-doc).
 org.mobicents.media.Format selectPreffered(java.util.Collection<org.mobicents.media.Format> formats)
          Implements the strategy of selecting preffred format from specified set.
 void setDuration(int duartion)
           
 void setLasy(boolean isLazy)
           
 void setVolume(int level)
           
 
Methods inherited from class org.mobicents.media.server.impl.resource.dtmf.DtmfBuffer
getInterdigitInterval, getMask, push, setInterdigitInterval, setMask
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSink
assignPreffered, connect, connect, disconnect, disconnect, failed, getBytesReceived, getPacketsReceived, getPreffered, isConnected, isMultipleConnectionsAllowed, isStarted, receive, resetStats, start, started, stop, 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.server.spi.resource.DtmfDetector
start, stop
 
Methods inherited from interface org.mobicents.media.MediaSink
connect, connect, disconnect, disconnect, getBytesReceived, getPacketsReceived, isConnected, isMultipleConnectionsAllowed, isStarted, receive
 
Methods inherited from interface org.mobicents.media.Component
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, resetStats, setConnection, setEndpoint
 

Field Detail

events

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

DetectorImpl

public DetectorImpl(java.lang.String name)
Creates new instance of Detector.

Method Detail

selectPreffered

public org.mobicents.media.Format selectPreffered(java.util.Collection<org.mobicents.media.Format> formats)
Description copied from class: AbstractSink
Implements the strategy of selecting preffred format from specified set. The default implemntation takes first from set but other components can override this rule.

Overrides:
selectPreffered in class AbstractSink
Parameters:
formats - the set of formats.
Returns:
preffered format or null if sink can not determine it

setDuration

public void setDuration(int duartion)

getDuration

public int getDuration()

setVolume

public void setVolume(int level)

setLasy

public void setLasy(boolean isLazy)

getVolume

public int getVolume()

onMediaTransfer

public void onMediaTransfer(org.mobicents.media.Buffer buffer)
                     throws java.io.IOException
(Non Java-doc).

Specified by:
onMediaTransfer in class AbstractSink
Parameters:
buffer - the new portion of media data.
Throws:
java.io.IOException
See Also:
org.mobicents.media.protocol.BufferTransferHandler.transferData().

getFormats

public org.mobicents.media.Format[] getFormats()

isAcceptable

public boolean isAcceptable(org.mobicents.media.Format format)

getInterface

public <T> T getInterface(java.lang.Class<T> interfaceType)
Specified by:
getInterface in interface org.mobicents.media.Component
Overrides:
getInterface in class AbstractSink


Copyright © 2010. All Rights Reserved.