资源简介

java版本的sip软电话。本地安装SIP服务(比如freeswitch)之后,导入源码,运行 net.sourceforge.peers.gui.MainFrame类中的main函数。设置账号(1001),密码(1234),domain(192.168.1.10)。即可注册。亲测有效...

资源截图

代码片段和文件信息

package net.sourceforge.peers.demo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CommandsReader extends Thread {

    public static final String CALL = “call“;
    public static final String HANGUP = “hangup“;

    private boolean isRunning;
    private EventManager eventManager;
    
    public CommandsReader(EventManager eventManager) {
        this.eventManager = eventManager;
    }
    
    @Override
    public void run() {
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        setRunning(true);
        while (isRunning()) {
            String command;
            try {
                command = bufferedReader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                break;
            }
            command = command.trim();
            if (command.startsWith(CALL)) {
                String callee = command.substring(
                        command.lastIndexOf(‘ ‘) + 1);
                eventManager.call(callee);
            } else if (command.startsWith(HANGUP)) {
                eventManager.hangup();
            } else {
                System.out.println(“unknown command “ + command);
            }
        }
    }

    
    public synchronized boolean isRunning() {
        return isRunning;
    }


    public synchronized void setRunning(boolean isRunning) {
        this.isRunning = isRunning;
    }
    
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-10-21 22:01  peers-master\
     文件         113  2016-10-21 22:01  peers-master\.gitignore
     文件        7012  2016-10-21 22:01  peers-master\README.txt
     目录           0  2016-10-21 22:01  peers-master\conf\
     文件        3371  2016-10-21 22:01  peers-master\conf\peers.xml
     文件        2272  2016-10-21 22:01  peers-master\conf\peers.xsd
     文件       35147  2016-10-21 22:01  peers-master\gpl.txt
     目录           0  2016-10-21 22:01  peers-master\logs\
     文件           0  2016-10-21 22:01  peers-master\logs\.gitignore
     文件         886  2016-10-21 22:01  peers-master\maven-help.txt
     目录           0  2016-10-21 22:01  peers-master\media\
     文件       68558  2016-10-21 22:01  peers-master\media\message.raw
     目录           0  2016-10-21 22:01  peers-master\peers-demo\
     文件          11  2016-10-21 22:01  peers-master\peers-demo\.gitignore
     文件        1091  2016-10-21 22:01  peers-master\peers-demo\pom.xml
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\java\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\peers\
     目录           0  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\peers\demo\
     文件        1612  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\peers\demo\CommandsReader.java
     文件        2636  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\peers\demo\CustomConfig.java
     文件        2882  2016-10-21 22:01  peers-master\peers-demo\src\main\java\net\sourceforge\peers\demo\EventManager.java
     目录           0  2016-10-21 22:01  peers-master\peers-doc\
     文件          31  2016-10-21 22:01  peers-master\peers-doc\.gitignore
     文件        1630  2016-10-21 22:01  peers-master\peers-doc\pom.xml
     文件          60  2016-10-21 22:01  peers-master\peers-doc\readme.txt
     目录           0  2016-10-21 22:01  peers-master\peers-doc\src\
     目录           0  2016-10-21 22:01  peers-master\peers-doc\src\docbkx\
............此处省略375个文件信息

评论

共有 条评论