Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip.dtmf
Class DTMFInfo

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter
      extended by net.java.sip.communicator.impl.protocol.sip.dtmf.DTMFInfo
All Implemented Interfaces:
MethodProcessor

public class DTMFInfo
extends MethodProcessorAdapter

Sending DTMFs with SIP INFO.

Author:
Damian Minkov, Lyubomir Marinov

Constructor Summary
DTMFInfo(ProtocolProviderServiceSipImpl pps)
          Constructor
 
Method Summary
 void addDTMFListener(DTMFListener listener)
          Registers the specified DTMFListener with this provider so that it could be notified when incoming DTMF tone is received.
 boolean processRequest(javax.sip.RequestEvent requestEvent)
          Processes a Request received on a ProtocolProviderServiceSipImpl upon which this processor is registered.
 boolean processResponse(javax.sip.ResponseEvent responseEvent)
          Just look if the DTMF signal was well received, and log it
 void removeDTMFListener(DTMFListener listener)
          Removes the specified listener from the list of DTMF listeners.
 void startSendingDTMF(CallPeerSipImpl callPeer, DTMFTone tone)
          Saves the tone we need to send and its start time.
 void stopSendingDTMF(CallPeerSipImpl callPeer)
          Sending of the currently saved tone.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter
processDialogTerminated, processIOException, processTimeout, processTransactionTerminated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTMFInfo

public DTMFInfo(ProtocolProviderServiceSipImpl pps)
Constructor

Parameters:
pps - the SIP Protocol provider service
Method Detail

startSendingDTMF

public void startSendingDTMF(CallPeerSipImpl callPeer,
                             DTMFTone tone)
                      throws OperationFailedException,
                             NullPointerException,
                             IllegalArgumentException
Saves the tone we need to send and its start time. With start time we can compute the duration later when we need to send the DTMF.

Parameters:
callPeer - the call peer.
tone - the tone to transmit.
Throws:
OperationFailedException
NullPointerException
IllegalArgumentException

stopSendingDTMF

public void stopSendingDTMF(CallPeerSipImpl callPeer)
Sending of the currently saved tone.

Parameters:
callPeer -

processResponse

public boolean processResponse(javax.sip.ResponseEvent responseEvent)
Just look if the DTMF signal was well received, and log it

Specified by:
processResponse in interface MethodProcessor
Overrides:
processResponse in class MethodProcessorAdapter
Parameters:
responseEvent - the response event
Returns:
true if the specified event has been handled by this processor and shouldn't be offered to other processors registered for the same method; false, otherwise

processRequest

public boolean processRequest(javax.sip.RequestEvent requestEvent)
Description copied from interface: MethodProcessor
Processes a Request received on a ProtocolProviderServiceSipImpl upon which this processor is registered.

Specified by:
processRequest in interface MethodProcessor
Overrides:
processRequest in class MethodProcessorAdapter
Parameters:
requestEvent - requestEvent fired from the ProtocolProviderServiceSipImpl to the processor representing a Request received from the network
Returns:
true if the specified event has been handled by this processor and shouldn't be offered to other processors registered for the same method; false, otherwise

addDTMFListener

public void addDTMFListener(DTMFListener listener)
Registers the specified DTMFListener with this provider so that it could be notified when incoming DTMF tone is received.

Parameters:
listener - the listener to register with this provider.

removeDTMFListener

public void removeDTMFListener(DTMFListener listener)
Removes the specified listener from the list of DTMF listeners.

Parameters:
listener - the listener to unregister.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.