callmanager.java

来自「First of all, the Applet-phone is a SIP 」· Java 代码 · 共 57 行

JAVA
57
字号
/* * CallManager.java * * Created on May 7, 2003, 9:35 AM */package gov.nist.examples.pcc;import java.util.*;/** * * @author  deruelle */public class CallManager {        protected Vector callAssociationList;    protected CallListener callListener;        /** Creates a new instance of CallManager */    public CallManager(CallListener callListener) {        callAssociationList=new Vector();        this.callListener=callListener;    }        public CallAssociation getCallAssociation(String callId) {        for (int i=0;i<callAssociationList.size();i++) {            CallAssociation callAssociation=(CallAssociation)callAssociationList.elementAt(i);            if (callAssociation.getCallId().equals(callId) ) {                return callAssociation;            }        }        return null;    }        public void initCalls(Agent firstAgent, Agent secondAgent) {                CallLauncherDebug.println("First agent: "+firstAgent.userName+"@"+firstAgent.hostName);        CallLauncherDebug.println("Second agent: "+secondAgent.userName+"@"+secondAgent.hostName);                Call firstCall=new Call(callListener,secondAgent,firstAgent);        CallLauncherDebug.println("Let's send an INVITE to the first agent (the callee).");                        Call secondCall=new Call(callListener,firstAgent,secondAgent);                CallAssociation callAssociation=new CallAssociation(firstCall,secondCall);        callAssociationList.addElement(callAssociation);        try{            // CallId, sdp            firstCall.sendInvite(null,null);                }        catch(Exception e) {            e.printStackTrace();        }    }    }

⌨️ 快捷键说明

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