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.DetectorImpl
All Implemented Interfaces:
Serializable, Component, MediaSink, DtmfDetector

public class DetectorImpl
extends AbstractSink
implements DtmfDetector

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

Nested Class Summary
 class DetectorImpl.EventSender
           
 
Field Summary
static String[][] events
           
 
Fields inherited from interface org.mobicents.media.server.spi.dtmf.DtmfDetector
DEFAULT_INTERDIGIT_INTERVAL, DEFAULT_SIGNAL_LEVEL
 
Constructor Summary
DetectorImpl(String name, org.mobicents.media.server.scheduler.Scheduler scheduler)
          Creates new instance of Detector.
 
Method Summary
 void addListener(DtmfDetectorListener listener)
          (Non Java-doc.)
 void clearBuffer()
           
 void clearDigits()
           
protected  void fireEvent(Collection<DtmfEventImpl> evts)
           
protected  void fireEvent(DtmfEventImpl evt)
           
protected  void fireEvent(String tone)
           
 void flushBuffer()
           
 int getDuration()
           
 int getInterdigitInterval()
           
<T> T
getInterface(Class<T> interfaceType)
           
 String getMask()
           
 Formats getNativeFormats()
           
 int getVolume()
           
 void onMediaTransfer(Frame buffer)
          (Non Java-doc).
 void removeListener(DtmfDetectorListener listener)
           
 void setDuration(int duartion)
           
 void setInterdigitInterval(int interval)
           
 void setLasy(boolean isLazy)
           
 void setMask(String mask)
           
 void setVolume(int level)
           
 void start()
           
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSink
connect, disconnect, failed, getBytesReceived, getPacketsReceived, isConnected, isStarted, report, reset, started, stop, stopped, wakeup
 
Methods inherited from class org.mobicents.media.server.impl.BaseComponent
getId, getName, inc
 
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.DtmfDetector
stop
 
Methods inherited from interface org.mobicents.media.MediaSink
connect, disconnect, getBytesReceived, getPacketsReceived, isConnected, isStarted
 
Methods inherited from interface org.mobicents.media.Component
getId, getName, reset
 

Field Detail

events

public static final String[][] events
Constructor Detail

DetectorImpl

public DetectorImpl(String name,
                    org.mobicents.media.server.scheduler.Scheduler scheduler)
Creates new instance of Detector.

Method Detail

start

public void start()
Specified by:
start in interface MediaSink
Specified by:
start in interface DtmfDetector
Overrides:
start in class AbstractSink

setDuration

public void setDuration(int duartion)

getDuration

public int getDuration()

setVolume

public void setVolume(int level)
Specified by:
setVolume in interface DtmfDetector

setLasy

public void setLasy(boolean isLazy)

getVolume

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

onMediaTransfer

public void onMediaTransfer(Frame buffer)
                     throws IOException
(Non Java-doc).

Specified by:
onMediaTransfer in class AbstractSink
Throws:
IOException
See Also:
org.mobicents.media.protocol.BufferTransferHandler.transferData().

getNativeFormats

public Formats getNativeFormats()

getInterface

public <T> T getInterface(Class<T> interfaceType)
Specified by:
getInterface in interface Component
Overrides:
getInterface in class AbstractSink

getMask

public String getMask()

setMask

public void setMask(String mask)

setInterdigitInterval

public void setInterdigitInterval(int interval)
Specified by:
setInterdigitInterval in interface DtmfDetector

getInterdigitInterval

public int getInterdigitInterval()
Specified by:
getInterdigitInterval in interface DtmfDetector

fireEvent

protected void fireEvent(String tone)

fireEvent

protected void fireEvent(DtmfEventImpl evt)

fireEvent

protected void fireEvent(Collection<DtmfEventImpl> evts)

flushBuffer

public void flushBuffer()
Specified by:
flushBuffer in interface DtmfDetector

clearBuffer

public void clearBuffer()

addListener

public void addListener(DtmfDetectorListener listener)
                 throws TooManyListenersException
(Non Java-doc.)

Specified by:
addListener in interface DtmfDetector
Throws:
TooManyListenersException
See Also:
org.mobicents.media.Component#addListener(NotificationListener).

removeListener

public void removeListener(DtmfDetectorListener listener)
Specified by:
removeListener in interface DtmfDetector

clearDigits

public void clearDigits()
Specified by:
clearDigits in interface DtmfDetector


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