⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modem.java

📁 jtapi for telephone
💻 JAVA
字号:
// NAME
//      $RCSfile: Modem.java,v $
// DESCRIPTION
//      [given below in javadoc format]
// DELTA
//      $Revision: 1.1 $
// CREATED
//      $Date: 2003/01/16 10:48:49 $
// COPYRIGHT
//      Westhawk Ltd
// TO DO
//

package net.sourceforge.gjtapi.raw.modem;

import java.io.InputStream;
import java.io.OutputStream;

import net.sourceforge.gjtapi.CallId;

/**
 * An interface which defines the action which a modem should perform.
 *
 * @author <a href="mailto:ray@westhawk.co.uk">Ray Tran</a>
 * @version $Revision: 1.1 $ $Date: 2003/01/16 10:48:49 $
 */
public interface Modem {
    static final String     version_id =
            "@(#)$Id: Modem.java,v 1.1 2003/01/16 10:48:49 raytran Exp $ Copyright Westhawk Ltd";

    public static final int INVALID = 0;
    public static final int IDLE = 1;
    public static final int BUSY = 2;
    public static final int RINGING = 3;
    public static final int DROPPING = 4;
    
    /**
     * Initialize the modem.
     * 
     * @param portname - The name of the port which is attached to the modem.
     * @return boolean - whether the initialization succeeded of not.
     */
    public boolean initialize(String portname);
    
    /**
     * Drop the current call.
     * 
     * @param id - CallId of the current call.
     */
    public void drop(CallId id);
    
    /**
     * Place a call to the specified destination.
     * 
     * @param id - A unique CallId to identify this call.
     * @param dest - The phone number to dial.
     * @return boolean - whether the call was placed successfully
     */
    public boolean call(CallId id, String dest);
    
    /**
     * Answer an incoming call.
     * 
     * @param id -  unique CallId to identify this call.
     */
    public void answer(CallId id);
    
    /**
     * Shutdown the modem and return any resources.
     */
    public void shutdown();
    
    /**
     * Return the current state of the modem.
     * 
     * @return int - the current state of the modem.
     */
    public int getState();
    
    /**
     * Return the DTMF digits which have been detected.
     * 
     * @param num - the maximum number of tones to return.
     * @return String - The digits (0-9, *, #) received.
     */
    public String reportDTMF(int num);
    
    /**
     * Send some DTMF digits out.
     * 
     * @param tones - The digits (0-9, *, #) to be sent.
     */
    public void sendDTMF(String tones);
    
    /**
     * Output sounds over the modem.
     * 
     * @param is - An InputStream which streams the sounds.
     */
    public void play(InputStream is);
    
    /**
     * Receive sounds over the modem.
     * 
     * @param os - An OutputStream which the sounds are streamed to.
     */
    public void record(OutputStream os);
    
    /**
     * Deal with the DLE shielded character which has been received
     * 
     * @param shielded - The character which must be handled.
     */
    public void dleReceived(char shielded);
    
    /**
     * The modem is ringing.
     */
     public void ringing();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -