/** Create the softphone handlers and stack */ public void createSoftPhone(String server) throws MediaException { this.server = server; SIPConfig.setServer(server); if (sipManager != null) { destroySoftPhone(); } sipManager = new SipManager(); softPhoneMedia = new SoftPhoneMedia(); softPhoneSecurity = new SoftPhoneSecurity(); sipManager.addCommunicationsListener(this); sipManager.setSecurityAuthority(softPhoneSecurity); try { // put in a seperate thread sipManager.start(); if (sipManager.isStarted()) { Log.debug("createSoftPhone", "SIP STARTED"); } } catch (CommunicationsException exc) { Log.error("createSoftPhone", exc); } }
/** * Add a CommunicationsListener * * @param communicationsListener CommunicationsListener */ public void addCommunicationsListener(CommunicationsListener communicationsListener) { sipManager.addCommunicationsListener(communicationsListener); }