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:
yulian oifa, 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 activate()
           
 void addListener(DtmfDetectorListener listener)
          (Non Java-doc.)
 void clearAllListeners()
           
 void clearBuffer()
           
 void clearDigits()
           
 void deactivate()
           
protected  void fireEvent(Collection<DtmfEventImpl> evts)
           
protected  void fireEvent(DtmfEventImpl evt)
           
protected  void fireEvent(String tone)
           
 void flushBuffer()
           
 AudioOutput getAudioOutput()
           
 int getDuration()
           
 int getInterdigitInterval()
           
 String getMask()
           
 Formats getNativeFormats()
           
 OOBOutput getOOBOutput()
           
 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)
           
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSink
failed, getBytesReceived, getPacketsReceived, isStarted, perform, report, reset, 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.MediaSink
getBytesReceived, getPacketsReceived, isStarted, perform
 
Methods inherited from interface org.mobicents.media.Component
clearEndpoint, getEndpoint, getId, getName, reset, setEndpoint
 

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

getAudioOutput

public AudioOutput getAudioOutput()

getOOBOutput

public OOBOutput getOOBOutput()

activate

public void activate()
Specified by:
activate in interface Component
Specified by:
activate in interface DtmfDetector
Specified by:
activate in class AbstractSink

deactivate

public void deactivate()
Specified by:
deactivate in interface Component
Specified by:
deactivate in interface DtmfDetector
Specified by:
deactivate 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()

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

clearAllListeners

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

clearDigits

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


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